[prod][traceback] 500 error: UndefinedError: 'waffle' is undefined

RESOLVED FIXED

Status

Websites
Firefox Flicks
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mbrandt, Unassigned)

Tracking

Details

(Whiteboard: [prod][traceback], URL)

(Reporter)

Description

4 years ago
Note: I can't reproduce this, offending uri=/en-US/video/x0pwAq87');select%20pg_sleep(3);%20--%20",

Traceback (most recent call last):

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor-local/src/django/django/core/handlers/base.py", line 148, in get_response
    response = callback(request, **param_dict)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/urls.py", line 30, in handler404
    return render(request, '404.html', status=404)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor-local/src/django/django/shortcuts/__init__.py", line 44, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor-local/src/django/django/template/loader.py", line 176, in render_to_string
    return t.render(context_instance)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/vendor/src/jingo/jingo/__init__.py", line 189, in render
    return super(Template, self).render(context_dict)

  File "/usr/lib64/python2.6/site-packages/newrelic-2.16.0.12/newrelic/api/function_trace.py", line 47, in dynamic_wrapper
    return wrapped(*args, **kwargs)

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/404.html", line 1, in top-level template code
    {% extends 'base.html' %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/base.html", line 1, in top-level template code
    {% extends 'bare.html' %}

  File "/data/www/firefoxflicks.mozilla.org/firefox-flicks/flicks/base/templates/bare.html", line 43, in top-level template code
    <body class="{{ page_type }} {% if waffle.flag('voting') %}voting{% endif %}" data-csrf-token="{{ csrf_token }}" {% block body_data %}{% endblock %}>

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 371, in getattr
    return getattr(obj, attribute)

UndefinedError: 'waffle' is undefined
Also can't reproduce. Code-wise I don't see an obvious reason why waffle would be undefined; it gets loaded into Jinja2's template environment when the first template is rendered by a web process, and should stay there for as long as the web process is alive. Even if there's an error in the request or a 404 or whatever, it should still exist. Odd.

Shall we keep this around in case it comes up again, or mark as WONTFIX and reopen if it proves itself to be more than just a fluke?
(Reporter)

Comment 2

4 years ago
I'm good with wontfixing and we can re-chase the issue if it surfaces again.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.