简体   繁体   中英

Gunicorn returns an error when running heroku logs

When running heroku logs --tail I am getting the following error looping infinitely. The main error is this "unexpected extra argument" That I can't understand. My procfile is web: gunicorn app:app and my main ".py" file is app.py. So the procfile is fine. Don't really know what's happening here. Thanks in advance

[2020-05-06 22:18:21 +0000] [4256] [INFO] Worker exiting (pid: 4256)
2020-05-06T22:18:21.783472+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4258] [INFO] Booting worker with pid: 4258
2020-05-06T22:18:21.803986+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:21.803987+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:21.803988+00:00 app[web.1]: 
2020-05-06T22:18:21.804014+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:21.804437+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4257] [INFO] Worker exiting (pid: 4257)
2020-05-06T22:18:21.891864+00:00 app[web.1]: [2020-05-06 22:18:21 +0000] [4259] [INFO] Booting worker with pid: 4259
2020-05-06T22:18:22.412798+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:22.412829+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:22.412829+00:00 app[web.1]: 
2020-05-06T22:18:22.412836+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:22.413113+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4258] [INFO] Worker exiting (pid: 4258)
2020-05-06T22:18:22.490604+00:00 app[web.1]: Usage: gunicorn [OPTIONS]
2020-05-06T22:18:22.490606+00:00 app[web.1]: Try 'gunicorn --help' for help.
2020-05-06T22:18:22.490606+00:00 app[web.1]: 
2020-05-06T22:18:22.490613+00:00 app[web.1]: Error: Got unexpected extra argument (app:app)
2020-05-06T22:18:22.490941+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4259] [INFO] Worker exiting (pid: 4259)
2020-05-06T22:18:22.499552+00:00 app[web.1]: [2020-05-06 22:18:22 +0000] [4260] [INFO] Booting worker with pid: 4260

Down here is my profile:

web: gunicorn app:app

I encountered the same issue when using flask on Heroku. This was the issue with mine:

Initdb() is a function that generates the SQL database. I commented out the following code and resolved the issue:

Try:
    Init_db_command()    
Except sqlite3.operationalError:
    Pass

As far as I know, this error happens when you pass a string in a function so avoid doing that. Don't pass a string as a parameter in the function definition

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM