Closed Bug 1393472 Opened 7 years ago Closed 7 years ago

[traceback] KeyError on 'caused_by' in RequestError handling

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Assigned: peterbe)

References

(Blocks 1 open bug)

Details

https://sentry.prod.mozaws.net/operations/socorro-stage/issues/643900/

Seems that when you get a `RequestError` and it tries to poke around [0] in the error it fails some assumption about what the exception object should contain

[0] https://github.com/mozilla-services/socorro/blob/8bca718c1d08e7859e7178a79bebca5851865788/socorro/external/es/supersearch.py#L492-L498
Assignee: nobody → peterbe
Traceback from sentry report:

"""
KeyError: 'caused_by'
  File "django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "newrelic/hooks/framework_django.py", line 499, in wrapper
    return wrapped(*args, **kwargs)
  File "crashstats/signature/views.py", line 65, in inner
    return view(request, *args, **kwargs)
  File "crashstats/signature/views.py", line 432, in signature_summary
    search_results = api.get(**params)
  File "crashstats/supersearch/models.py", line 230, in get
    return super(SuperSearch, self).get(**kwargs)
  File "crashstats/crashstats/models.py", line 333, in get
    return self._get(expect_json=expect_json, **kwargs)
  File "crashstats/crashstats/models.py", line 391, in _get
    expect_json=expect_json,
  File "crashstats/crashstats/models.py", line 174, in inner
    result = method(*args, **kwargs)
  File "crashstats/crashstats/models.py", line 264, in fetch
    result = implementation_method(**params)
  File "socorro/external/es/supersearch.py", line 496, in get
    cause = e.info['error']['caused_by']['type']
"""
Summary: KeyError on 'caused_by' in RequestError handling → [traceback] KeyError on 'caused_by' in RequestError handling
Commit pushed to master at https://github.com/mozilla-services/socorro

https://github.com/mozilla-services/socorro/commit/6870358728e895a57fcdcb51b0ec391ca78f9f69
fixes bug 1393472 - KeyError on 'caused_by' in RequestError handling (#3940)

* fixes bug 1393472 - KeyError on 'caused_by' in RequestError handling

* raise the right exception context

* excess sys import

* comment typo
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.