#6949 Error on export: artifact ref and cleanup

v1.2.0
closed
nobody
42cc (432)
General
2015-08-20
2013-12-05
No
Traceback (most recent call last):
  File "/var/local/allura/Allura/allura/tasks/export_tasks.py", line 68, in _bulk_export
    app.bulk_export(f)
  File "/var/local/allura/ForgeTracker/forgetracker/tracker_main.py", line 424, in bulk_export
    json.dump(ticket, f, cls=jsonify.GenericJSON, indent=2)
  File "/usr/lib64/python2.7/json/__init__.py", line 181, in dump
    for chunk in iterable:
  File "/var/local/env-allura/lib/python2.7/site-packages/simplejson-2.2.1-py2.7-linux-x86_64.egg/simplejson/encoder.py", line 528, in _iterencode
    o = _default(o)
  File "/var/local/env-allura/lib/python2.7/site-packages/TurboGears2-2.1.5-py2.7.egg/tg/jsonify.py", line 37, in default
    return obj.__json__()
  File "/var/local/allura/ForgeTracker/forgetracker/model/ticket.py", line 1009, in __json__
    parents_json.update(parent.__json__(self))
  File "/var/local/allura/Allura/allura/model/artifact.py", line 104, in __json__
    related_artifacts=[a.url() for a in self.related_artifacts()],
  File "/var/local/allura/Allura/allura/model/artifact.py", line 179, in related_artifacts
    if artifact.type_s == 'Commit' and not artifact.repo:
AttributeError: 'NoneType' object has no attribute 'type_s'

This must occur when artifact.primary() returns a None, and that is only possible in discuss.py:Thread.primary And that must mean index.py:ArtifactReference.artifact is returning a None. We should handle that situation.

Also, when an error like this happens, we log it ("Something went wrong during export of...") but the partial file is left there, and it gets zipped up. This means we're delivering a partial file to the project admin. I think it'd be better if we removed the file at that point, so it doesn't get zipped and shipped.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2013-12-20
    • Labels: --> 42cc
    • Status: open --> in-progress
     
  • Igor Bondarenko - 2014-02-05
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2014-02-05

    Closed #509. je/42cc_6949

     
  • Dave Brondsema

    Dave Brondsema - 2014-02-14
    • status: code-review --> validation
    • QA: Dave Brondsema
    • Milestone: forge-backlog --> forge-feb-21
     
  • Dave Brondsema

    Dave Brondsema - 2014-02-19
    • status: validation --> closed
     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.