do something useful with JSONDecodeError

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

Bug Description

Sometimes during publication we see this traceback during copyPackage:

https://ci-train.ubuntu.com/job/ubuntu-landing-041-2-publish/21/console

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/publisher.py", line 243, in <module>
    run_script(__name__, __doc__, main)
  File "/var/lib/citrain/cupstream2distro/utils.py", line 190, in run_script
    sys.exit(main())
  File "/var/lib/citrain/citrain/publisher.py", line 222, in main
    initiate_publication(dest, ppa, silo_state.set_package_version_list)
  File "/var/lib/citrain/citrain/publisher.py", line 160, in initiate_publication
    copy_to_dest(sources, dest)
  File "/var/lib/citrain/citrain/publisher.py", line 201, in copy_to_dest
    version=source.source_package_version)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 623, in __call__
    self.resource.lp_refresh()
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 760, in lp_refresh
    super(Entry, self).lp_refresh(new_url, etag)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 347, in lp_refresh
    representation, self.JSON_MEDIA_TYPE)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 363, in bind
    representation_definition)
  File "/usr/lib/python3/dist-packages/wadllib/application.py", line 300, in __init__
    _make_unicode(representation))
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 488, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", 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