mozilla-services / updatebot

Automation for updating third party libraries for Firefox
Mozilla Public License 2.0
8 stars 5 forks source link

KeyError: 'bugs' in `findOpenBugs` #363

Open sentry-io[bot] opened 3 months ago

sentry-io[bot] commented 3 months ago

Sentry Issue: UPDATEBOT-PROD-1V

KeyError: 'bugs'
  File "automation.py", line 233, in run
    taskRunner.process_task(lib, task)
  File "/builds/worker/updatebot/tasktypes/vendoring.py", line 35, in process_task
    open_bugs = self.bugzillaProvider.find_open_bugs([j.bugzilla_id for j in all_jobs])
  File "components/logging.py", line 38, in func_wrapper
    ret = func(*args, **kwargs)
  File "components/bugzilla.py", line 242, in find_open_bugs
    return findOpenBugs(self.config['url'], filtered_ids)
  File "apis/bugzilla_api.py", line 159, in findOpenBugs
    return [b['id'] for b in j['bugs']]
mozfreddyb commented 3 months ago

Looks like this is connected to an API change? The JSON response we got was

{
code: 100500,
documentation: "https://bmo.readthedocs.io/en/latest/api/"

,
error: True,
message: None
}
maltejur commented 3 months ago

I am not sure what happened there, the api endpoint still works as expected for me locally, and we have only seen this issue one time. I will open a PR to also include the "faulty" JSON in the exception, so that if this happens again, we can investigate further.

tomrittervg commented 3 months ago

It seems like a transient error, but I wonder if this could occur if a bug was made confidential and there were no results from the request that were non-confidential.