UHS calculator set correct IMT

Bug #984734 reported by Laurentiu D.
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Muharem Hrnjadovic

Bug Description

Traceback (most recent call last):
  File "/usr/bin/openquake", line 163, in <module>
    args.config_file, user_name=getpass.getuser())
  File "/usr/lib/pymodules/python2.7/openquake/engine.py", line 830, in import_job_profile
    job_profile = _prepare_job(params, sections, user_name)
  File "/usr/lib/pymodules/python2.7/django/db/transaction.py", line 217, in inner
    res = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openquake/engine.py", line 591, in _prepare_job
    job_profile = _get_job_profile(input_set, calc_mode, job_type, owner)
  File "/usr/lib/pymodules/python2.7/django/db/transaction.py", line 217, in inner
    res = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openquake/engine.py", line 567, in _get_job_profile
  File "/usr/lib/pymodules/python2.7/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/usr/lib/pymodules/python2.7/django/db/models/base.py", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/usr/lib/pymodules/python2.7/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/usr/lib/pymodules/python2.7/django/db/models/query.py", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/lib/pymodules/python2.7/django/db/models/sql/compiler.py", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/usr/lib/pymodules/python2.7/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.7/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
django.db.utils.IntegrityError: new row for relation "oq_job_profile" violates check constraint "period_is_set"
------------ Comment:
Currently the UHS calculator works only the IMT is set to PGA;

Changed in openquake:
importance: Undecided → High
importance: High → Medium
Changed in openquake:
status: New → Confirmed
Changed in openquake:
importance: Medium → High
description: updated
tags: added: defect hazard uhs
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

The db constraint for uiapi.oq_job_profile.period is wrong

        CHECK(((imt = 'sa' AND calc_mode != 'uhs') AND (period IS NOT NULL))
              OR ((imt != 'sa' OR calc_mode = 'uhs') AND (period IS NULL))),

we should not even consider the IMT

tags: added: database
Changed in openquake:
assignee: nobody → Muharem Hrnjadovic (al-maisan)
milestone: none → 0.8.0
Changed in openquake:
status: Confirmed → In Progress
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

The IMT config.gem parameter should be ignored for UHS type calculations.

Changed in openquake:
status: In Progress → Fix Committed
Changed in openquake:
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

Related blueprints

Remote bug watches

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