Icebox traceback reports wrong errors

Bug #1434177 reported by Daniele Viganò
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake Platform
Fix Committed
High
Daniele Viganò

Bug Description

Sometime the traceback that can be displayed through the icebox page contains the wrong stacktrace.

How to reproduce:
- Upload non zip file -> you get the BadZip error
- Upload a zip file with missing files (i.e. no ini) -> you get again the BadZip error instead of the real error

The Engine server log reports the true error.

Tags: icebox
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :

The BadZip file error is

  File "/usr/local/openquake/oq-risklib/openquake/commonlib/parallel.py", line 111, in safely_call
    res = func(*args), None
  File "/usr/local/openquake/oq-engine/openquake/server/views.py", line 99, in _prepare_job
    return readinput.extract_from_zip(arch, detect_job_file)
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/readinput.py", line 102, in extract_from_zip
    with zipfile.ZipFile(path) as archive:
  File "/usr/lib/python2.7/zipfile.py", line 714, in __init__
    self._GetContents()
  File "/usr/lib/python2.7/zipfile.py", line 748, in _GetContents
    self._RealGetContents()
  File "/usr/lib/python2.7/zipfile.py", line 763, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file

Instead of

IOError:
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/parallel.py", line 111, in safely_call
    res = func(*args), None
  File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 339, in inner
    return func(*args, **kwargs)
  File "/usr/local/openquake/oq-engine/openquake/engine/engine.py", line 474, in job_from_file
    oqparam = readinput.get_oqparam(params, calculators=calculators)
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/readinput.py", line 175, in get_oqparam
    oqparam = OqParam(**job_ini)
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/oqvalidation.py", line 132, in __init__
    self.risk_imtls = get_imtls_from_vulnerabilities(self.inputs)
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/riskmodels.py", line 172, in get_imtls_from_vulnerabilities
    for (imt, taxonomy), vf in get_vulnerability_functions(fname).items():
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/riskmodels.py", line 131, in get_vulnerability_functions
    nodefactory['vulnerabilityModel']):
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/node.py", line 544, in read_nodes
    for _, el in iterparse(fname, remove_comments=remove_comments):
  File "/usr/local/openquake/oq-risklib/openquake/commonlib/node.py", line 162, in iterparse
    return etree.iterparse(source, events, **kw)
  File "iterparse.pxi", line 374, in lxml.etree.iterparse.__init__ (src/lxml/lxml.etree.c:97327)
IOError: [Errno 2] No such file or directory: '/tmp/tmphjbvnL/hazard_PSHA/structural_vulnerability_model.xml'

when for example an exposure file is missing

Revision history for this message
Daniele Viganò (daniele-vigano) wrote :
Changed in oq-platform:
status: Confirmed → In Progress
Changed in oq-platform:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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