gunicorn cant find create_app()
gunicorn cant find create_app()
gunicorn -b 0.0.0.0:6666 "superset.app:create_app()"
[2019-12-09 19:14:22 +0330] [23027] [INFO] Starting gunicorn 19.9.0
[2019-12-09 19:14:22 +0330] [23027] [INFO] Listening at: http://0.0.0.0:6666 (23027)
[2019-12-09 19:14:22 +0330] [23027] [INFO] Using worker: sync
[2019-12-09 19:14:22 +0330] [23031] [INFO] Booting worker with pid: 23031
Loaded your LOCAL configuration at [/home/superset/superset_config.py]
2019-12-09 19:14:24,395:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 362, in import_app
app = eval(obj, vars(mod))
File "<string>", line 1, in <module>
NameError: name 'create_app' is not defined
Failed to find application object 'create_app()' in 'superset.app'
[2019-12-09 19:14:25 +0330] [23031] [INFO] Worker exiting (pid: 23031)
[2019-12-09 19:14:26 +0330] [23027] [INFO] Shutting down: Master
[2019-12-09 19:14:26 +0330] [23027] [INFO] Reason: App failed to load.
Expected results
what you expected to happen.
Actual results
what actually happens.
Screenshots
If applicable, add screenshots to help explain your problem.
How to reproduce the bug
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Environment
(please complete the following information):
- superset version:
superset version - python version:
python --version - node.js version:
node -v - npm version:
npm -v
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
- [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [ ] I have reproduced the issue with at least the latest released version of superset.
- [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.
Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.88. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Hi @blcksrx, can you please add the superset version your using?
Hi @blcksrx, can you please add the superset version your using?
Master branch, I cloned it about an hour ago
@blcksrx - Take a look here: https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#sql-lab-async
Celery needs a pointer to the actual "celery instance": celery worker --app=superset.tasks.celery_app:app -Ofair
@blcksrx - Take a look here: https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#sql-lab-async
Celery needs a pointer to the actual "celery instance":
celery worker --app=superset.tasks.celery_app:app -Ofair
Its not about celery worker or celery beat. Its about running webserver with gunicorn
Oops, didn't see that. I would second @dpgaspar's concern about not being up to date. After pulling latest, did you re-pip? It's possible that you're still pointing at something old in your site-packages...
Ofcourse yes. I did it
Sorry it's not clear to me, is it solved?
No, its not solved yet
I'm not able to replicate the problem, can you please create a clean/new virtualenv and reinstall superset and dependencies, then test and report back. If the problem persists, give us all commands you went through and output
Same error happened to me. Versions: Superset 0.35.1 Python 3.6.8 Flask 1.1.1 Werkzeug 0.16.0
followed setup instructions from official apache-superset "installation how-to" except that I did not created a virtualenv. All other steps done as how-to stated.
same here, ubuntu 18.04.3 followed the installation instructions and also created virtualenv:
NameError: name 'create_app' is not defined
Failed to find application object 'create_app()' in 'superset.app'
[2019-12-14 23:22:23 +0100] [3352] [INFO] Worker exiting (pid: 3352)
Traceback (most recent call last):
File "/root/venv/lib/python3.6/site-packages/gunicorn/util.py", line 362, in import_app
app = eval(obj, vars(mod))
File "
This is starting to make a bit of sense. The docs are for master, whereas 0.35 still does things the old way. Try 'superset.app' instead of 'superset.app:create_app()'.
After the next release, things should be consistent.
(venv) root@mike5:~# gunicorn -w 2 -k gevent --timeout 120 -b 0.0.0.0:6666 --limit-request-line 0 --limit-request-field_size 0 --statsd-host localhost:8125 'superset.app'
[2019-12-15 07:06:54 +0100] [17640] [INFO] Starting gunicorn 19.8.1
[2019-12-15 07:06:54 +0100] [17640] [INFO] Listening at: http://0.0.0.0:6666 (17640)
[2019-12-15 07:06:54 +0100] [17640] [INFO] Using worker: gevent
[2019-12-15 07:06:54 +0100] [17643] [INFO] Booting worker with pid: 17643
[2019-12-15 07:06:54 +0100] [17644] [INFO] Booting worker with pid: 17644
2019-12-15 07:06:55,908:INFO:root:logging was configured successfully
2019-12-15 07:06:55,961:INFO:root:logging was configured successfully
2019-12-15 07:06:56,029:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
2019-12-15 07:06:56,081:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
Traceback (most recent call last):
File "/root/venv/lib/python3.6/site-packages/gunicorn/util.py", line 362, in import_app
app = eval(obj, vars(mod))
File "
try with: superset:app
Confirmed. Works with superset.app
gunicorn -w 10 -k gevent --timeout 120 -b 0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 --statsd-host localhost:8125 superset:app
Yes superset:app instead of superset.app fixed the issue, thank you
If you look at the source code (0.35.1, you can see that the Flask App is defined in the superset module (in particular in init file---> superset:app In master it is defined in superset/app.py with a function named create_app
Agree that documentation should be improved
Agree that documentation should be improved
It's not that it should be improved. It just needs to be understood that the docs represent the master branch and not the pypi release.
The docs are for master, whereas 0.35 still does things the old way.
The online docs have an install section that suggest that one can install and upgrade apache via pip: https://superset.incubator.apache.org/installation.html#upgrading
but the documentation suggesting this is generated from the git master not the pip release.
The building from source section of the docs is misleading. it says:
More advanced users may want to build Superset from sources.
This is incorrect: any user that wants Superset to behave the way to docs advertise would do this.