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

enabling tenant produces "RuntimeError: Working outside of request context." #13

Closed
spike83 opened this issue Jul 25, 2022 · 1 comment

Comments

@spike83
Copy link

spike83 commented Jul 25, 2022

I tried to enable the TENANT_HEADER or the TENANT_URL_RE using the docker image sourcepole/qwc-map-viewer-demo:v2022.07.13.

Once one of the env variables is set I start getting the following errors.

mounting server:app on /
WSGI app 0 (mountpoint='/') ready in 1 seconds on interpreter 0x7fd4a4d69c20 pid: 1 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1)
spawned uWSGI worker 1 (pid: 7, cores: 4)
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python3.9/site-packages/qwc_services_core/tenant_handler.py", line 133, in __call__
    tenant = self.tenant_handler.tenant()
  File "/usr/lib/python3.9/site-packages/qwc_services_core/tenant_handler.py", line 31, in tenant
    return request.headers.get(self.tenant_header, DEFAULT_TENANT)
  File "/usr/lib/python3.9/site-packages/werkzeug/local.py", line 432, in __get__
    obj = instance._get_current_object()
  File "/usr/lib/python3.9/site-packages/werkzeug/local.py", line 554, in _get_current_object
    return self.__local()  # type: ignore
  File "/usr/lib/python3.9/site-packages/flask/globals.py", line 33, in _lookup_req_object
    raise RuntimeError(_request_ctx_err_msg)
RuntimeError: Working outside of request context.

This typically means that you attempted to use functionality that needed
an active HTTP request.  Consult the documentation on testing for
information about how to avoid this problem.
@manisandro
Copy link
Member

I believe this is ince fixed, please reopen if it still applies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants