Regular Deployment Crashing
tak-praveen
FREEOP

8 months ago

Starting Container

[2025-07-24 08:32:44 +0000] [1] [INFO] Starting gunicorn 20.1.0

[2025-07-24 08:32:44 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)

[2025-07-24 08:32:44 +0000] [1] [INFO] Using worker: sync

[2025-07-24 08:32:44 +0000] [2] [INFO] Booting worker with pid: 2

[2025-07-24 08:32:44 +0000] [2] [ERROR] Exception in worker process

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker

worker.init_process()

File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process

self.load_wsgi()

File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi

self.wsgi = self.app.wsgi()

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi

self.callable = self.load()

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load

return self.load_wsgiapp()

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp

return util.import_app(self.app_uri)

File "/usr/local/lib/python3.10/site-packages/gunicorn/util.py", line 359, in import_app

mod = importlib.import_module(module)

File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module

return bootstrap.gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 1050, in gcdimport

File "<frozen importlib._bootstrap>", line 1027, in findand_load

File "<frozen importlib._bootstrap>", line 1004, in findand_load_unlocked

ModuleNotFoundError: No module named 'main'

[2025-07-24 08:32:44 +0000] [2] [INFO] Worker exiting (pid: 2)

[2025-07-24 08:32:44 +0000] [1] [INFO] Shutting down: Master

[2025-07-24 08:32:44 +0000] [1] [INFO] Reason: Worker failed to boot.

[2025-07-24 08:32:45 +0000] [1] [INFO] Starting gunicorn 20.1.0

[2025-07-24 08:32:45 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)

[2025-07-24 08:32:45 +0000] [1] [INFO] Using worker: sync

[2025-07-24 08:32:45 +0000] [2] [INFO] Booting worker with pid: 2

[2025-07-24 08:32:45 +0000] [2] [ERROR] Exception in worker process

Traceback (most recent call last):

mod = importlib.import_module(module)

File "/usr/local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker

File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module

worker.init_process()

return bootstrap.gcd_import(name[level:], package, level)

File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 134, in init_process

File "<frozen importlib._bootstrap>", line 1050, in gcdimport

File "<frozen importlib._bootstrap>", line 1027, in findand_load

self.load_wsgi()

File "<frozen importlib._bootstrap>", line 1004, in findand_load_unlocked

File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi

ModuleNotFoundError: No module named 'main'

self.wsgi = self.app.wsgi()

[2025-07-24 08:32:45 +0000] [2] [INFO] Worker exiting (pid: 2)

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi

self.callable = self.load()

File "/usr/local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load

return self.load_wsgiapp()

I changed my Procfile correctly and added all requiremnts but still able to get all these deploy logs after correctly changing

Solved$10 Bounty

Pinned Solution

clashing
HOBBY

8 months ago

Praveen, as the issue was resolved for you, do mark my post as the solution for this query, so that others visiting this thread would be benefitted!!

17 Replies

Railway
BOT

8 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


clashing
HOBBY

8 months ago

Is the python server running fine, locally? If yes, can you please provide the screenshot for the intial lines of the server file?


clashing

Is the python server running fine, locally? If yes, can you please provide the screenshot for the intial lines of the server file?

tak-praveen
FREEOP

8 months ago

2025-07-22 11:59:18,511 INFO WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
2025-07-22 11:59:18,512 INFO Press CTRL+C to quit

tak-praveen

2025-07-22 11:59:18,511 INFO WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:5000 2025-07-22 11:59:18,512 INFO Press CTRL+C to quit

clashing
HOBBY

8 months ago

So it's running on your machine. Btw, I asked you to share the screen shot of the server file! Also, do share the ss for docker image, if you are using that


clashing

So it's running on your machine. Btw, I asked you to share the screen shot of the server file! Also, do share the ss for docker image, if you are using that

tak-praveen
FREEOP

8 months ago

This is ss of my docker image...

Attachments


tak-praveen

This is ss of my docker image...

clashing
HOBBY

8 months ago

If you are using a pre-defined port in your server file, then you have to do `EXPOSE PORT_NUMBER` in the Docker file. For instance, I am running a Flask server in which I am using a port: 7575 (pre-defined port or magic port acc to Railway)

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=7575)

If you could do that, and provide what your server file looks like, then I guess we can resolve this

(Do share the ss of the initial lines of the server file, as requested above)

Attachments


tak-praveen
FREEOP

8 months ago

This i'm using...


tak-praveen
FREEOP

8 months ago

Starting Container

* Serving Flask app 'main'

* Debug mode: off

Now i'm getting this in deploy logs...


tak-praveen

Starting Container* Serving Flask app 'main'* Debug mode: offNow i'm getting this in deploy logs...

clashing
HOBBY

8 months ago

Now it's working, right? As there are no error build logs!


tak-praveen
FREEOP

8 months ago

Right...

Can you guide me how i can view my website through link?


tak-praveen
FREEOP

8 months ago

Thank you versatilevats


tak-praveen

Right...Can you guide me how i can view my website through link?

clashing
HOBBY

8 months ago

That's great ༼ つ ◕_◕ ༽つ

Yes, follow these steps to see the website (Flask server):

  1. Go to the "settings" tab for the service

  2. Click on Generate Domain and make sure to use 5000, which is your port number.

  3. Then a link would be generated, you can open that, and it would be your up & running Flask server.


clashing

If you are using a pre-defined port in your server file, then you have to do `EXPOSE PORT_NUMBER` in the Docker file. For instance, I am running a Flask server in which I am using a port: 7575 (pre-defined port or magic port acc to Railway)if __name__ == '__main__': app.run(host='0.0.0.0', port=7575)If you could do that, and provide what your server file looks like, then I guess we can resolve this(Do share the ss of the initial lines of the server file, as requested above)

clashing
HOBBY

8 months ago

Do mark the referenced post as your solution which helped you in updating the docker file, and exposing the port (the button would be at the bottom of that post) ^_^


clashing

That's great ༼ つ ◕_◕ ༽つYes, follow these steps to see the website (Flask server):Go to the "settings" tab for the serviceClick on Generate Domain and make sure to use 5000, which is your port number.Then a link would be generated, you can open that, and it would be your up & running Flask server.

clashing
HOBBY

8 months ago

Any issues in generating the domain link for the service, praveen?


tak-praveen

Thank you versatilevats

clashing
HOBBY

8 months ago

Praveen, as the issue was resolved for you, do mark my post as the solution for this query, so that others visiting this thread would be benefitted!!


tak-praveen
FREEOP

8 months ago

Done!


tak-praveen

Done!

clashing
HOBBY

8 months ago

Thanks a lot. But you have to mark the post in which I defined the steps to resolve this issue, which is this post: https://station.railway.com/questions/regular-deployment-crashing-c31ec8f6#k62f

I know things are not much intuitive on a new platform


Status changed to Solved itsrems 8 months ago


Loading...