OOPS when communicating with Launchpad

Bug #1447378 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Daisy
Fix Released
High
Brian Murray

Bug Description

I found the following OOPS recently - OOPS-27d52732fc38de0d36dd34cf64ba6261

The Traceback ends with the following:

  File "/srv/errors.ubuntu.com/production/errors/errors/api/resources.py", line 225, in _handle_request
    for binary in launchpad.get_binaries_in_source_package(package, release):
  File "/srv/errors.ubuntu.com/production/daisy/daisy/launchpad.py", line 336, in get_binaries_in_source_package
    ma = json_request(ma_url)['self_link']
TypeError: string indices must be integers, not str

The package was 'unity8' and the release was unspecified e.g. None.

The json_request function already has some error handling:

def json_request(url):
    try:
        response, content = _http.request(url)
    except httplib2.ServerNotFoundError:
        return ''

    try:
        return json.loads(content)
    except ValueError:
        return ''

However, we don't actually confirm that json_request(ma_url) is not a string and just try and get ['self_link'].

Related branches

Changed in daisy:
assignee: nobody → Brian Murray (brian-murray)
status: New → In Progress
importance: Undecided → High
Changed in daisy:
status: In Progress → Fix Committed
Changed in daisy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.