[stage] visiting /v1/view_features/fox causes a SystemExit exception

RESOLVED WONTFIX

Status

developer.mozilla.org
BrowserCompat
RESOLVED WONTFIX
3 years ago
a year ago

People

(Reporter: mbrandt, Unassigned)

Tracking

Details

(Whiteboard: [type:bug][bc:infra][bc:milestone=bicycle], URL)

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Created attachment 8693792 [details]
qa - screenshot of bug

Filing for investigation, note this appear to have "healed" and now returns a 404 error.

/api/v1/view_features/fox causes a System Exit exception to be thrown by Heroku.

Steps to reproduce: 
0. goto https://browsercompat.herokuapp.com/api/v1/view_features/fox

Expected:
A helpful HTTP 404 error is thrown.

Actual:
The application redirects to https://s3.amazonaws.com/heroku_pages/error.html

https://rpm.newrelic.com/accounts/263620/applications/10664840/traced_errors/a2bb89-53653726-97a6-11e5-96d2-c81f66b8ceca


Stack trace
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/api/web_transaction.py", line 717, in __iter__
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/api/web_transaction.py", line 1093, in __call__
File "/app/.heroku/python/lib/python2.7/site-packages/dj_static.py", line 83, in __call__
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/api/web_transaction.py", line 1221, in _nr_wsgi_application_wrapper_
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/response.py", line 158, in render
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/response.py", line 71, in rendered_content
File "/app/webplatformcompat/renderers.py", line 313, in render
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/renderers.py", line 648, in get_context
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/renderers.py", line 499, in get_rendered_html_form
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/renderers.py", line 357, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 210, in render
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/api/function_trace.py", line 98, in dynamic_wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 905, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py", line 224, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py", line 329, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 905, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 1197, in render
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/templatetags/rest_framework.py", line 37, in render_field
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/renderers.py", line 337, in render_field
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 210, in render
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/api/function_trace.py", line 98, in dynamic_wrapper
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 905, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/defaulttags.py", line 155, in render
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 648, in resolve
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 789, in resolve
File "/app/.heroku/python/lib/python2.7/site-packages/django/template/base.py", line 849, in _resolve_lookup
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/relations.py", line 167, in iter_options
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/relations.py", line 163, in grouped_choices
File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/relations.py", line 158, in choices
File "/app/webplatformcompat/drf_fields.py", line 59, in to_representation
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 201, in __getitem__
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 1217, in iterator
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 794, in results_iter
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/hooks/database_dbapi2.py", line 22, in execute
File "<string>", line 8, in __new__
File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 159, in handle_abort
The traceback sent to admins is more useful:

Internal Server Error: /api/v1/browsers/fox
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/hooks/framework_django.py", line 499, in wrapper
    return wrapped(*args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/viewsets.py", line 87, in view
    return self.dispatch(request, *args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/newrelic-2.58.0.43/newrelic/hooks/component_djangorestframework.py", line 27, in _nr_wrapper_APIView_dispatch_
    return wrapped(*args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/rest_framework/mixins.py", line 56, in retrieve
    instance = self.get_object()
  File "/app/.heroku/python/lib/python2.7/site-packages/drf_cached_instances/mixins.py", line 50, in get_object
    obj = self.get_object_or_404(queryset, **filter_kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/drf_cached_instances/mixins.py", line 65, in get_object_or_404
    return queryset.get(*filter_args, **filter_kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/drf_cached_instances/models.py", line 143, in get
    instances = self.cache.get_instances((object_spec,))
  File "/app/.heroku/python/lib/python2.7/site-packages/drf_cached_instances/cache.py", line 136, in get_instances
    obj = loader(obj_pk)
  File "/app/webplatformcompat/cache.py", line 39, in browser_v1_loader
    obj = queryset.get(pk=pk)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 325, in get
    clone = self.filter(*args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 679, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.py", line 697, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1310, in add_q
    clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1338, in _add_q
    allow_joins=allow_joins, split_subq=split_subq,
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1209, in build_filter
    condition = self.build_lookup(lookups, col, value)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/query.py", line 1102, in build_lookup
    return final_lookup(lhs, rhs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/lookups.py", line 101, in __init__
    self.rhs = self.get_prep_lookup()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/lookups.py", line 139, in get_prep_lookup
    return self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 727, in get_prep_lookup
    return self.get_prep_value(value)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/fields/__init__.py", line 985, in get_prep_value
    return int(value)
ValueError: invalid literal for int() with base 10: 'fox'
My previous traceback is not for this bug, but instead for using a string instead of an ID for an API endpoint (for example, /api/v1/browsers/fox).

This bug is caused when Heroku kills a web application that hasn't returned in 30 seconds.  It seems that this request is fast for anonymous users, or if you force JSON (https://browsercompat.herokuapp.com/api/v1/view_features/fox.json), but takes a very long time if you are an authenticated user.
Blocks: 996570
Keywords: in-triage
Keywords: in-triage
OS: Unspecified → All
Hardware: Unspecified → All
Summary: [stage][browsercompat] visiting /v1/view_features/fox causes a SystemExit exception → [stage] visiting /v1/view_features/fox causes a SystemExit exception
Whiteboard: [type:bug][bc:infra]
Blocks: 1240757
No longer blocks: 996570
Whiteboard: [type:bug][bc:infra] → [type:bug][bc:infra][bc:milestone=bicycle]
The page takes a long time to load as an authenticated user, because it is trying to generate a huge dropdown list. This should be fixed when bug 1230584 is fixed.
Mentor: jwhitlock
Depends on: 1230584
Mentor: jwhitlock
The BrowserCompat project is canceled.  See https://github.com/mdn/browsercompat for current effort. Bulk status change includes the random word TEMPOTHRONE.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.