Prevent OqJob and Hazard/Risk Calculation reference key inconsistencies

Bug #1227502 reported by matley
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenQuake Engine
Fix Released
Critical
matley

Bug Description

We need to prevent the situation where a calculation (Hazard/Risk) is saved without the corresponding job. E.g.

openquake --lhc i get:

calc_id | status | last_update | description
1 | successful | 2013-09-18 11:15:02 | Disaggregation calculation for Portugal with AB2010
2 | successful | 2013-09-18 13:53:21 | Disaggregation calculation for Portugal with Ba2006
4 | pending | 2013-09-18 17:15:22 | Disaggregation calculation for Portugal with bothGMPE
Traceback (most recent call last):
  File "/usr/local/openquake/oq-engine/bin/openquake", line 512, in <module>
    main()
  File "/usr/local/openquake/oq-engine/bin/openquake", line 459, in main
    list_hazard_calculations()
  File "/usr/local/openquake/oq-engine/bin/openquake", line 293, in list_hazard_calculations
    _print_calcs_summary(hcs)
  File "/usr/local/openquake/oq-engine/bin/openquake", line 316, in _print_calcs_summary
    latest_job = calc.oqjob
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/related.py", line 257, in __get__
    rel_obj = self.related.model._base_manager.using(db).get(**params)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 365, in get
    % self.model._meta.object_name)
openquake.engine.db.models.DoesNotExist: OqJob matching query does not exist.

matley (matley)
Changed in oq-engine:
importance: Undecided → Critical
assignee: nobody → matley (matley)
milestone: none → 1.0.1
description: updated
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :
Revision history for this message
matley (matley) wrote :

This happens also when an user uses the import facilities, e.g.:

openquake --load-curve curve.xml

Then, openquake --lhc fails

Revision history for this message
matley (matley) wrote :
Changed in oq-engine:
status: New → In Progress
Changed in oq-engine:
status: In Progress → Fix Committed
Changed in oq-engine:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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