R
Railwayβ€’13mo ago
Elibe

Gunicorn failed to load the wsgi module

Hey everyone, I hope you're all doing well. I'm currently working on a Django project, and I've encountered an issue when trying to run it with Gunicorn. I would greatly appreciate your assistance in resolving this problem. Issue Description: I'm trying to deploy my Django application using Gunicorn, but I'm encountering a 'ModuleNotFoundError' related to the wsgi 'locallibrary' module. It seems that Gunicorn cannot find the wsgi path. As a developer I need to say it working on my machine πŸ˜‹ so I can guess it related to the python server path - but i dont know how to see the project structure inside the railway... my project id: 9bc78e3f-4204-46e6-8951-eadca9c6f04f
No description
29 Replies
Percy
Percyβ€’13mo ago
Project ID: 9bc78e3f-4204-46e6-8951-eadca9c6f04f
Brody
Brodyβ€’13mo ago
it works locally, but does it work locally with gunicorn?
Elibe
ElibeOPβ€’13mo ago
Yep I tried to change the path and got the same error so I guess it because the railway deployment use different paths structure then me. But as I said, I don't know how to access the project structure itself...
Brody
Brodyβ€’13mo ago
not sure how much help we can provide since this is a code issue, but send your deployment logs and maybe we will see something simple https://bookmarklets.up.railway.app/log-downloader/
Brody
Brodyβ€’13mo ago
ModuleNotFoundError: No module named 'locallibrary'
ModuleNotFoundError: No module named 'locallibrary'
Elibe
ElibeOPβ€’13mo ago
I saw it, but it related to the wsgi loading. Look at this row: File "/opt/venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker The venv doesn't exist inside the project - it exist in the opt folder and I think it railway folder infra because I dont have any folder with this name...
Brody
Brodyβ€’13mo ago
please tackle this problem first
Elibe
ElibeOPβ€’13mo ago
This is the same problem, the wsgi lloading failed because the import failure. This is my project structure: crm β”œβ”€ .gitignore β”œβ”€ Procfile β”œβ”€ crm β”‚ β”œβ”€ asgi.py β”‚ β”œβ”€ settings.py β”‚ β”œβ”€ urls.py β”‚ └─ wsgi.py β”œβ”€ manage.py β”œβ”€ requirements.txt β”œβ”€ runtime.txt └─ website β”œβ”€ admin.py β”œβ”€ apps.py β”œβ”€ forms.py β”œβ”€ models.py β”œβ”€ templates β”‚ └─ test.html β”œβ”€ tests.py β”œβ”€ urls.py └─ views.py wsgi file: os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crm.settings') application = get_asgi_application() Procfile: web: manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --no-input && gunicorn crm.wsgi
Brody
Brodyβ€’13mo ago
have you fixed this error?
Elibe
ElibeOPβ€’13mo ago
This is the error 😒 I just say the source of it came from the problem with wsgi and Idk how to solve it
Brody
Brodyβ€’13mo ago
do you have locallibrary in your requirements.txt?
Elibe
ElibeOPβ€’13mo ago
no, and not in all my project, idk from where it come I try to search it in all my file without any clue
Brody
Brodyβ€’13mo ago
Elibe
ElibeOPβ€’13mo ago
pip install locallibrary ERROR: Could not find a version that satisfies the requirement locallibrary (from versions: none) ERROR: No matching distribution found for locallibrary
Brody
Brodyβ€’13mo ago
have you tried researching this issue? then issue isnt an issue caused by railway
Elibe
ElibeOPβ€’13mo ago
I know, I tried to search on every existing site. there is any option to get help from railway support? to search the project tree inside the container?
Brody
Brodyβ€’13mo ago
support from the team is only available on pro though you are likely looking in the wrong places if you think looking at the directorys will help, please research this issue further
Elibe
ElibeOPβ€’13mo ago
Actually I jusy deleted the service and create it again and it worked!!!!
Elibe
ElibeOPβ€’13mo ago
No description
Brody
Brodyβ€’13mo ago
hahaha probably had some config on the service wrong
Elibe
ElibeOPβ€’13mo ago
I didnt cahnged a thing, mayby a glicth Thank you bro on your time
Brody
Brodyβ€’13mo ago
haha no problem
Elibe
ElibeOPβ€’13mo ago
just one thing, how can I make it public? it should give a link, no?
No description
Brody
Brodyβ€’13mo ago
click generate domain in the settings
Elibe
ElibeOPβ€’13mo ago
I dont find any option for adding domain...
Brody
Brodyβ€’13mo ago
its in the settings tab
Elibe
ElibeOPβ€’13mo ago
my problem, I forgot to add secert key again... tnx bro, really appreciate your support
Brody
Brodyβ€’13mo ago
of course πŸ™‚
Want results from more Discord servers?
Add your server