do something useful with JSONDecodeError

Bug #1503614 reported by Robert Bruce Park on 2015-10-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CI Train [cu2d]
Fix Released
Robert Bruce Park

Bug Description

Sometimes during publication we see this traceback during copyPackage:

2015-10-07 09:19:36,824 ERROR Uncaught exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/var/lib/citrain/citrain/", line 243, in <module>
    run_script(__name__, __doc__, main)
  File "/var/lib/citrain/cupstream2distro/", line 190, in run_script
  File "/var/lib/citrain/citrain/", line 222, in main
    initiate_publication(dest, ppa, silo_state.set_package_version_list)
  File "/var/lib/citrain/citrain/", line 160, in initiate_publication
    copy_to_dest(sources, dest)
  File "/var/lib/citrain/citrain/", line 201, in copy_to_dest
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/", line 623, in __call__
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/", line 760, in lp_refresh
    super(Entry, self).lp_refresh(new_url, etag)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/", line 347, in lp_refresh
    representation, self.JSON_MEDIA_TYPE)
  File "/usr/lib/python3/dist-packages/wadllib/", line 363, in bind
  File "/usr/lib/python3/dist-packages/wadllib/", line 300, in __init__
  File "/usr/lib/python3/dist-packages/simplejson/", line 488, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/", line 389, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It seems like LP copies the package correctly but fails to send us a response. The exception however prevents further packages from being copied.

We should probably catch this, but I need to think about what we do when we catch it. It seems obvious that we'd want to check that the copy was successful and if not, raise an error, but I guess check-publication-migration will already do that, so it seems ok if we just ignore the error. If migration says "abyss" for a long time we will know to republish.

Changed in cupstream2distro:
importance: Undecided → Medium
assignee: nobody → Robert Bruce Park (robru)
status: New → Triaged
Robert Bruce Park (robru) wrote :

Ok, train now catches & warns about JSONDecodeError.

Changed in cupstream2distro:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers