Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"RuntimeError: Working outside of application context." in Celery #8944

Closed
wooram1125 opened this issue Jan 10, 2020 · 6 comments
Closed

"RuntimeError: Working outside of application context." in Celery #8944

wooram1125 opened this issue Jan 10, 2020 · 6 comments
Labels

Comments

@wooram1125
Copy link

@wooram1125 wooram1125 commented Jan 10, 2020

A clear and concise description of what the bug is.

Actual results

Traceback (most recent call last):
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\billiard\process.py", line 327, in _bootstrap
    self.run()
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\billiard\process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\billiard\pool.py", line 286, in __call__
    self.after_fork()
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\billiard\pool.py", line 395, in after_fork
    self.initializer(*self.initargs)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\concurrency\prefork.py", line 55, in process_initializer
    app.loader.init_worker()
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 114, in init_worker
    self.import_default_modules()
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 109, in import_default_modules
    return [self.import_task_module(m) for m in self.default_modules]
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 109, in <listcomp>
    return [self.import_task_module(m) for m in self.default_modules]
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 89, in import_task_module
    return self.import_from_cwd(module)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 98, in import_from_cwd
    package=package,
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\utils\imports.py", line 111, in import_from_cwd
    return imp(module, package=package)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\celery\loaders\base.py", line 92, in import_module
    return importlib.import_module(module, package=package)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\wooram\PycharmProjects\dighty-superset\superset\sql_lab.py", line 43, in <module>
    from superset.db_engine_specs import BaseEngineSpec
  File "C:\Users\wooram\PycharmProjects\dighty-superset\superset\db_engine_specs\__init__.py", line 36, in <module>
    from superset.db_engine_specs.base import BaseEngineSpec
  File "C:\Users\wooram\PycharmProjects\dighty-superset\superset\db_engine_specs\base.py", line 55, in <module>
    config = app.config
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\werkzeug\local.py", line 348, in __getattr__
    return getattr(self._get_current_object(), name)
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\werkzeug\local.py", line 307, in _get_current_object
    return self.__local()
  File "c:\users\wooram\pycharmprojects\dighty-superset\venv\lib\site-packages\flask\globals.py", line 52, in _find_app
    raise RuntimeError(_app_ctx_err_msg)
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
to interface with the current application object in some way. To solve
this, set up an application context with app.app_context().  See the
documentation for more information.

How to reproduce the bug

celery worker --app=superset.tasks.celery_app:app --pool=prefork -O fair -c 4

Environment

  • superset version: 0.999.0dev
  • python version: Python 3.6.8
  • node.js version: v8.11.1
  • npm version: 6.8.0

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.
@issue-label-bot issue-label-bot bot added the #bug label Jan 10, 2020
@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Jan 10, 2020

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.90. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@dpgaspar

This comment has been minimized.

Copy link
Contributor

@dpgaspar dpgaspar commented Jan 10, 2020

I'm not able to reproduce this issue, are you using the latest master?

If not, please update and re-test

@dpgaspar dpgaspar added #question and removed #bug labels Jan 10, 2020
@wooram1125

This comment has been minimized.

Copy link
Author

@wooram1125 wooram1125 commented Jan 14, 2020

@dpgaspar yes, I am using latest mater.. 😭

@wooram1125

This comment has been minimized.

Copy link
Author

@wooram1125 wooram1125 commented Jan 16, 2020

@dpgaspar I installed it in other system(linux) then it worked.

@dpgaspar

This comment has been minimized.

Copy link
Contributor

@dpgaspar dpgaspar commented Jan 16, 2020

Glad to ear that, going to close the issue, feel free to reopen if necessary

@dpgaspar dpgaspar closed this Jan 16, 2020
@sunshinetan

This comment has been minimized.

Copy link

@sunshinetan sunshinetan commented Jan 23, 2020

@dpgaspar I installed it in other system(linux) then it worked.
i got the same problem on win10,
then how to handle it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.