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

Template crash during login #43

Open
spenczar opened this issue Apr 13, 2021 · 1 comment
Open

Template crash during login #43

spenczar opened this issue Apr 13, 2021 · 1 comment

Comments

@spenczar
Copy link
Collaborator

Spotted in logs during today's workshop:

[pid: 9|app: 0|req: 44/248] 172.49.58.129 () {40 vars in 598 bytes} [Tue Apr 13 09:27:59 2021] GET /hopauth/login?next=/ => generated 787 bytes in 2 msecs (HTTP/1.1 200) 5 headers in 150 bytes (1 switches on core 0)
2021-04-13 09:27:59,846 DEBUG [django.template:867] base 11 140031216490304 Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 100, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/usr/local/lib/python3.8/site-packages/django/urls/resolvers.py", line 575, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'tried': [[<URLPattern ''>], [<URLPattern 'health_check/'>], [<URLResolver <URLPattern list> (admin:admin) 'admin/'>], [<URLResolver <module 'hopskotch_auth.urls' from './hopskotch_auth/urls.py'> (None:None) 'hopauth/'>], [<URLResolver <module 'mozilla_django_oidc.urls' from '/usr/local/lib/python3.8/site-packages/mozilla_django_oidc/urls.py'> (None:None) 'auth/'>]], 'path': 'favicon.ico'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 828, in _resolve_lookup
    current = current[bit]
TypeError: 'URLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 836, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'URLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 842, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 847, in _resolve_lookup
    raise VariableDoesNotExist("Failed lookup for key "
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in <URLResolver <URLPattern list> (admin:admin) 'admin/'>
2021-04-13 09:27:59,847 DEBUG [django.template:867] base 11 140031216490304 Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 100, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/usr/local/lib/python3.8/site-packages/django/urls/resolvers.py", line 575, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'tried': [[<URLPattern ''>], [<URLPattern 'health_check/'>], [<URLResolver <URLPattern list> (admin:admin) 'admin/'>], [<URLResolver <module 'hopskotch_auth.urls' from './hopskotch_auth/urls.py'> (None:None) 'hopauth/'>], [<URLResolver <module 'mozilla_django_oidc.urls' from '/usr/local/lib/python3.8/site-packages/mozilla_django_oidc/urls.py'> (None:None) 'auth/'>]], 'path': 'favicon.ico'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 828, in _resolve_lookup
    current = current[bit]
TypeError: 'URLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 836, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'URLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 842, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 847, in _resolve_lookup
    raise VariableDoesNotExist("Failed lookup for key "
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in <URLResolver <module 'hopskotch_auth.urls' from './hopskotch_auth/urls.py'> (None:None) 'hopauth/'>
2021-04-13 09:27:59,847 DEBUG [django.template:867] base 11 140031216490304 Exception while resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 100, in _get_response
    resolver_match = resolver.resolve(request.path_info)
  File "/usr/local/lib/python3.8/site-packages/django/urls/resolvers.py", line 575, in resolve
    raise Resolver404({'tried': tried, 'path': new_path})
django.urls.exceptions.Resolver404: {'tried': [[<URLPattern ''>], [<URLPattern 'health_check/'>], [<URLResolver <URLPattern list> (admin:admin) 'admin/'>], [<URLResolver <module 'hopskotch_auth.urls' from './hopskotch_auth/urls.py'> (None:None) 'hopauth/'>], [<URLResolver <module 'mozilla_django_oidc.urls' from '/usr/local/lib/python3.8/site-packages/mozilla_django_oidc/urls.py'> (None:None) 'auth/'>]], 'path': 'favicon.ico'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 828, in _resolve_lookup
    current = current[bit]
TypeError: 'URLResolver' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 836, in _resolve_lookup
    current = getattr(current, bit)
AttributeError: 'URLResolver' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 842, in _resolve_lookup
    current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/template/base.py", line 847, in _resolve_lookup
    raise VariableDoesNotExist("Failed lookup for key "
django.template.base.VariableDoesNotExist: Failed lookup for key [name] in <URLResolver <module 'mozilla_django_oidc.urls' from '/usr/local/lib/python3.8/site-packages/mozilla_django_oidc/urls.py'> (None:None) 'auth/'>
@cnweaver
Copy link
Collaborator

Yes, this is a known issue. It mostly happens when user agents request favicon.ico, which doesn't exist. I have no idea why Django reacts so badly to this; I've tried to fix it before but it was never a very priority sine it doesn't do much harm except pollute the logs.

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