R
Railway6mo ago
Renzo

I can't get my project to run correctly, crashed.

After loading almost completely, and being in green, the project simply crashes and the service is not available at any time, I tried several things with my docker file, but none of this solved it. 4de4b796-fa65-4a2f-9c38-187fd073fed7
No description
Solution:
then line 15 of your dockerfile should be
CMD gunicorn copy:app
CMD gunicorn copy:app
...
Jump to solution
40 Replies
Percy
Percy6mo ago
Project ID: 4de4b796-fa65-4a2f-9c38-187fd073fed7
Brody
Brody6mo ago
please share your repo
Renzo
Renzo6mo ago
4de4b796-fa65-4a2f-9c38-187fd073fed7 This?
Brody
Brody6mo ago
thats a project id, but id like you to share your github repo if possible, it would speed debugging up
Renzo
Renzo6mo ago
No description
No description
No description
Renzo
Renzo6mo ago
thats all
Brody
Brody6mo ago
some of the issues i see - this is a flask app, but you are trying to use uvicorn - you are copying in your requirements.txt file but aren't installing the packages in it - you may be missing some packages in your requirements.txt file - you are scraping Instagram, scraping is a big grey area on railway and is even listed in their tos
Renzo
Renzo6mo ago
If I am installing the requirements, and I review it, I think I am not missing anything Regarding flask app, how should I use it? What I found on the internet about how to run a test for this is what I put in the code And regarding the terms of service, I am running a selenium test and I use my own resources
Brody
Brody6mo ago
it doesnt matter, you are running the service on railway, but im not going to police you on that, so just know people have been banned for less. maybe look into using Instagram's api? unless im blind (its possible) i dont see the line in your dockerfile to install from the requirements.txt file you want to use gunicorn
Renzo
Renzo6mo ago
On line 11 pip install -r requirements.txt, that doesn't work?
Brody
Brody6mo ago
see, told you its possible that im blind okay then back to my first point, line 15 of your dockerfile, you are trying to start you app with uvicorn, you need to be using gunicorn instead
Renzo
Renzo6mo ago
I'm confused, I thought it was the same
Brody
Brody6mo ago
uvicorn is not the same as gunicorn for flask, you want gunicorn
Renzo
Renzo6mo ago
Then I would have to find a way to change the command on line 15 where gunicorn runs.
Brody
Brody6mo ago
just change it? with your text editor of choice, you can even edit the file in github itself
CMD gunicorn app:app
CMD gunicorn app:app
Renzo
Renzo6mo ago
And the syntax is the same? that's what I mean
Brody
Brody6mo ago
yeah just how i wrote it, theres no need to overthink this
Renzo
Renzo6mo ago
Now it seems that if I load the module, but after trying the same thing several times it always gives the error ModuleNotFoundError: No module named 'app'
Renzo
Renzo6mo ago
No description
Renzo
Renzo6mo ago
I am always amazed, on my localhost everything always works, when I deploy something always fails hahaha
Brody
Brody6mo ago
do you have an app.py or a main.py?
Renzo
Renzo6mo ago
No, my file has another name, should it have one of those?
Brody
Brody6mo ago
what is your file name
Renzo
Renzo6mo ago
original copy.py I thought that doesn't affect anything, actually a newbie here
Brody
Brody6mo ago
this is the copy.py file?
No description
Renzo
Renzo6mo ago
Yes, it is the only .py file
Brody
Brody6mo ago
as someone who has helped thousands of people here, running locally is always going to be easier than running in a production environment
Solution
Brody
Brody6mo ago
then line 15 of your dockerfile should be
CMD gunicorn copy:app
CMD gunicorn copy:app
Renzo
Renzo6mo ago
And my .py file should be called app.py?
Brody
Brody6mo ago
no? the app part of that is referring to line 9 of your copy.py file
Renzo
Renzo6mo ago
ok
Brody
Brody6mo ago
let me know how this goes
Renzo
Renzo6mo ago
It works perfectly, thank you very much. I'm new to all this and people like you help a lot!
Brody
Brody6mo ago
happy to help!
Renzo
Renzo6mo ago
Out of curiosity, how many years of experience do you have?
Brody
Brody6mo ago
with python? none, im not a python dev
Renzo
Renzo6mo ago
I mean this whole world
Brody
Brody6mo ago
uh maybe 4-5 years in tech stuff
Renzo
Renzo6mo ago
That's a lot! Have a good night, greetings!
Brody
Brody6mo ago
have a good/day night as well!
Want results from more Discord servers?
Add your server
More Posts