Project

General

Profile

Actions

Bug #6481

closed

AttributeError: '_AppCtxGlobals' object has no attribute 'identity'

Added by Pavel Kácha about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Development - GUI
Target version:
Start date:
08/26/2020
Due date:
% Done:

100%

Estimated time:
To be discussed:
No

Description

We've got a traceback during handling of 404, it seems some attribute does not bubble through (or is not yet initialised). Authentication related maybe?

Message type: ERROR
Location:     /var/mentat/venv/lib/python3.7/site-packages/vial/app.py:168
Module:       app
Function:     log_exception
Time:         2020-08-26 01:31:32,094

Message:

Exception on /static/design/vendor/cldr/main/cs/ca-gregorian.json? [GET]
Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/helpers.py", line 1082, in send_static_file
    self.static_folder, filename, cache_timeout=cache_timeout
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/helpers.py", line 767, in send_from_directory
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your
spelling and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1815, in handle_user_exception
    return self.handle_http_exception(e)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/app.py", line 1743, in handle_http_exception
    return handler(e)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/app.py", line 394, in eh_page_not_found
    return vial.errors.error_handler_switch(404, err)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/errors.py", line 30, in error_handler_switch
    return error_response(status_code, exception = exc)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/errors.py", line 57, in error_response
    **payload
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/var/mentat/venv/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/blueprints/design_bs3/templates/http_error.html", line 1, in top-level template cod
e
    {% extends "_layout.html" %}
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/environment.py", line 1005, in render
    return concat(self.root_render_func(self.new_context(vars)))
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/blueprints/design_bs3/templates/http_error.html", line 14, in root
    {%- if exception and exception.description %}
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/blueprints/design_bs3/templates/_layout.html", line 22, in root
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/blueprints/design_bs3/templates/_layout.html", line 188, in block_body
    {%- endblock head %}
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/blueprints/design_bs3/templates/http_error.html", line 93, in block_content
  File "/var/mentat/venv/lib/python3.7/site-packages/jinja2/runtime.py", line 262, in call
    return __obj(*args, **kwargs)
  File "/var/mentat/venv/lib/python3.7/site-packages/vial/app.py", line 829, in permission_can
    return vial.acl.PERMISSIONS[permission_name].can()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask_principal.py", line 347, in can
    return self.require().can()
  File "/var/mentat/venv/lib/python3.7/site-packages/flask_principal.py", line 193, in can
    return self.identity.can(self.permission)
  File "/var/mentat/venv/lib/python3.7/site-packages/flask_principal.py", line 188, in identity
    return g.identity
  File "/var/mentat/venv/lib/python3.7/site-packages/werkzeug/local.py", line 348, in __getattr__
    return getattr(self._get_current_object(), name)
AttributeError: '_AppCtxGlobals' object has no attribute 'identity'


Related issues

Related to Mentat - Bug #7781: Identity error on /static/*ClosedRajmund Hruška09/13/2024

Actions
Actions

Also available in: Atom PDF