[ERROR] Exception in worker process

Building my first little Django app and decided to deploy with Fly, however I’m encountering an error.
Although fle deploy runs without showing any error, I’m then welcomed by a blank page when I navigate to the URL of my app.

When running fly logs, I can see the error mentioned in the title, possibly linked to Gunicorn.
Here’s the full log.

While fly doctor, on the other hand, shows that everything is fine:

Testing authentication token... PASSED
Testing flyctl agent... PASSED
Testing local Docker instance... Nope
Pinging WireGuard gateway (give us a sec)... PASSED
Testing WireGuard DNS... PASSED
Testing WireGuard Flaps... PASSED

App specific checks for ping-check:
Checking that app has ip addresses allocated... PASSED
Checking A record for ping-check.fly.dev... PASSED
Checking AAAA record for ping-check.fly.dev... PASSED

Build checks for ping-check:
Checking docker context size (this may take little bit)... PASSED (14 kB)
Checking for .dockerignore... PASSED

Happy to provide any other info needed for debug.

Hi @mickeymarse ! :wave:

What I first noted was:

ModuleNotFoundError: No module named 'pingmysite.wsgi'

Is pingmysite your project name? That’s the location of a module containing a WSGI application object named application:

application = get_wsgi_application()

This is used to start the Gunicorn server when you define this on Dockerfile:

gunicorn --bind :8000 --workers 2 pingmysite.wsgi

Let’s start by checking that and see if that’s the only problem.


Example

For this :top: example, the project name is hello_django then defined in the Dockerfile as

Hi @katia and thank you for your help.

I checked what you suggested, everything seem in order on that front. Hence, Fly should be able to find my pingmysite.wsgi. Allegedly. :sweat_smile:

One thing I have that’s different from the example repo you shared, is the extra folder within, in which I’m actually building my app. The folder that contains views.py, urls.py and so on.

My directories tree is as follows:

* pingmysite
1. * pingmysite
2. * core

Very bad representation, but I hope it makes sense.

Mentioning the folder structure, made me think the issue might have been there, and so it was.
I had to update the final command in my Dockerfile like so:

CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "--chdir", "/code/pingmysite/", "pingmysite.wsgi"]

Thank you very much for your support. :blush: