Reputation: 425
I have a new server being set up, and as part of the process I set up gunicorn to serve the web files. However, when transferring the data, a command that works on the old servers does not work on this server.
The gunicorn master process appears to spin up workers, but the workers immediately quit due to "unrecognized arguments". The command is :/home/postgres/venv/bin/gunicorn [app]:app
. This is identical to the previous server, except that this server is using a virtualenv instead of the global packages. I suspect this might be the issue, but I'm unsure why or how to fix it.
Same Python version, but the gunicorn version is newer (19.4.5 on old vs 19.9.0 on new).
I've replaced the the app name with [app] to prevent confusion, but there are no invalid characters or anything in the name.
Log:
root@ns500738:/home/postgres/[app]# /home/postgres/venv/bin/gunicorn [app]:app
[2018-07-18 13:27:56 -0400] [10080] [INFO] Starting gunicorn 19.9.0
[2018-07-18 13:27:56 -0400] [10080] [INFO] Listening at: http://127.0.0.1:8000 (10080)
[2018-07-18 13:27:56 -0400] [10080] [INFO] Using worker: sync
[2018-07-18 13:27:56 -0400] [10083] [INFO] Booting worker with pid: 10083
usage: gunicorn [-h] [-c]
gunicorn: error: unrecognized arguments: [app]:app
[2018-07-18 13:27:56 -0400] [10083] [INFO] Worker exiting (pid: 10083)
[2018-07-18 13:27:56 -0400] [10085] [INFO] Booting worker with pid: 10085
usage: gunicorn [-h] [-c]
gunicorn: error: unrecognized arguments: [app]:app
[2018-07-18 13:27:57 -0400] [10085] [INFO] Worker exiting (pid: 10085)
[2018-07-18 13:27:57 -0400] [10087] [INFO] Booting worker with pid: 10087
usage: gunicorn [-h] [-c]
gunicorn: error: unrecognized arguments: [app]:app
[2018-07-18 13:27:57 -0400] [10087] [INFO] Worker exiting (pid: 10087)
^C[2018-07-18 13:27:57 -0400] [10080] [INFO] Handling signal: int
[2018-07-18 13:27:57 -0400] [10080] [INFO] Shutting down: Master
Upvotes: 1
Views: 3164
Reputation: 425
I have figured it out.
I recently added argparse
argument parsing to the script and that is causing it to catch the arguments meant to be passed to gunicorn.
If I remove the argparse parts, it works again.
Upvotes: 5