Error in runnig hazard demos!

307 views
Skip to first unread message

Mehdi Sadeghi

unread,
Jun 10, 2013, 8:58:07 AM6/10/13
to openqua...@googlegroups.com
Hi every one,
I just updated my OQ engine to the 0.9.2 version.
I got these error when I wanted to run command below:

mahdi@ubuntu:~$ openquake --run-hazard=/usr/openquake/engine/demos/hazard/SimpleFaultSourceClassicalPSHA/job.ini --no-distribute

OQ gives an error that is given below:


[2013-06-10 20:52:26,552 hazard #8 ubuntu CRITICAL MainProcess/3388 root] Calculation failed with exception: 'int() argument must be a string or a number, not 'NoneType''
Traceback (most recent call last):
  File "/usr/bin/openquake", line 9, in <module>
    load_entry_point('openquake.engine==0.9.2', 'console_scripts', 'openquake')()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 620, in main
    args.exports)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 286, in run_hazard
    job, log_level, log_file, exports, 'hazard')
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 350, in run_calc
    kvs.mark_job_as_current(job.id)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/kvs/__init__.py", line 128, in mark_job_as_current
    client = get_client()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/kvs/__init__.py", line 59, in get_client
    db = int(config.get('kvs', 'redis_db'))
TypeError: int() argument must be a string or a number, not 'NoneType'
[2013-06-10 20:52:27,592 hazard #8 - ERROR MainProcess/3389 supervisor] job process 3388 crashed or terminated
Traceback (most recent call last):
  File "/usr/bin/openquake", line 9, in <module>
    load_entry_point('openquake.engine==0.9.2', 'console_scripts', 'openquake')()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 620, in main
    args.exports)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 286, in run_hazard
    job, log_level, log_file, exports, 'hazard')
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 366, in run_calc
    supervisor.supervise(job_pid, job.id, log_file=log_file)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/supervising/supervisor.py", line 391, in supervise
    supervisor.run()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/supervising/supervisor.py", line 262, in run
    super(SupervisorLogMessageConsumer, self).run()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/signalling.py", line 89, in run
    self._timeout_callback()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/signalling.py", line 120, in _timeout_callback
    self.timeout_callback()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/supervising/supervisor.py", line 346, in timeout_callback
    cleanup_after_job(self.job_id)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/supervising/supervisor.py", line 107, in cleanup_after_job
    kvs.cache_gc(job_id)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/kvs/__init__.py", line 160, in cache_gc
    client = get_client()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/kvs/__init__.py", line 59, in get_client
    db = int(config.get('kvs', 'redis_db'))
TypeError: int() argument must be a string or a number, not 'NoneType'
Calculation 8 failed

I would be appreciated if somebody can help me.
Best,
Mehdi



Lars Butler

unread,
Jun 14, 2013, 5:32:42 AM6/14/13
to openqua...@googlegroups.com
Hi Mehdi,

There seems to be a problem with your openquake.cfg file. This should be located in /etc/openquake/openquake.cfg.

Can you paste the contents of this file?

Thanks,
Lars





--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mehdi Sadeghi

unread,
Jun 14, 2013, 7:40:07 AM6/14/13
to openqua...@googlegroups.com
Hi Lars
Thank you for your response.
This the contents of openquake.cfg:


# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake.  If not, see <http://www.gnu.org/licenses/>.


[kvs]
port = 6379
host = localhost
test_db = 3
# Turn on Java-side kvs connection caching for bigger deployments. When doing
# so set 'timeout=0' in /etc/redis/redis.conf -- please see
#       https://bugs.launchpad.net/openquake/+bug/907760
# for details.
cache_connections = false

[amqp]
host = localhost
port = 5672
user = guest
password = guest
vhost = /
exchange = oq.signalling

[logging]
backend = amqp

[supervisor]
exe = bin/openquake_supervisor

[database]
name = openquake
host = localhost
port = 5432

admin_password = openquake
admin_user = oq_admin

job_init_password = openquake
job_init_user = oq_job_init

job_superv_password = openquake
job_superv_user = oq_job_superv

reslt_writer_password = openquake
reslt_writer_user = oq_reslt_writer

[java]
# JVM max. memory size (in MB) to be used (per celery worker process!)
max_mem = 768

[nfs]
base_dir = /var/lib/openquake

[hazard]
# The hazard calculations will be performed in blocks of 'block_size' tasks.
# The default block size is 8192.
# If we run e.g. a classical PSHA job with 150000 sites, we will calculate
# and serialize the hazard curves/maps for 8192 sites at a time.
block_size=64

[statistics]
# This setting should only be enabled during development but be omitted/turned
# off in production. It enables statistics counters for debugging purposes. At
# least one Q/A test requires these.
debug = false

Best,
Mehdi

Lars Butler

unread,
Jun 14, 2013, 8:24:57 AM6/14/13
to openqua...@googlegroups.com
Hi Mehdi,

It looks like this config file is missing an important configuration. You should be able to fix this by modifying the file (you'll need sudo/root access to do so) and add the following line to the [kvs] section:

redis_db = 0

That should fix the problem.

Cheers,
Lars

Mehdi Sadeghi

unread,
Jun 17, 2013, 3:35:26 AM6/17/13
to openqua...@googlegroups.com
Dear Lars
Thank you for your help; But I am also getting some error while executing commands below: (with both; my own files and files in demo folder!
)

sadeghi@ubuntu:~$ openquake --run-hazard=/home/sadeghi/Desktop/shiraz/AreaSourceClassicalPSHA/job.ini --no-distribute
[2013-06-17 15:08:46,767 hazard #15 ubuntu PROGRESS MainProcess/2284 root] **  pre_executing (hazard)
[2013-06-17 15:08:46,785 hazard #15 ubuntu PROGRESS MainProcess/2284 root] **  initializing sources
[2013-06-17 15:08:47,359 hazard #15 ubuntu PROGRESS MainProcess/2284 root] **  initializing site model
[2013-06-17 15:08:47,363 hazard #15 ubuntu CRITICAL MainProcess/2284 root] Calculation failed with exception: ''

Traceback (most recent call last):
  File "/usr/bin/openquake", line 9, in <module>
    load_entry_point('openquake.engine==0.9.2', 'console_scripts', 'openquake')()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 620, in main
    args.exports)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 286, in run_hazard
    job, log_level, log_file, exports, 'hazard')
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 351, in run_calc
    _do_run_calc(job, exports, calc, job_type)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 425, in _do_run_calc
    calc.pre_execute()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/classical/core.py", line 222, in pre_execute
    self.initialize_site_model()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/general.py", line 711, in initialize_site_model
    points = self.hc.points_to_compute()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/db/models.py", line 839, in points_to_compute
    self.region_grid_spacing
  File "/usr/lib/python2.7/dist-packages/openquake/hazardlib/geo/polygon.py", line 221, in discretize
    return Mesh(lons, lats, depths=None)
  File "/usr/lib/python2.7/dist-packages/openquake/hazardlib/geo/mesh.py", line 59, in __init__
    assert lons.size > 0
AssertionError
[2013-06-17 15:08:48,366 hazard #15 - ERROR MainProcess/2285 supervisor] job process 2284 crashed or terminated
Calculation 15 failed

I attached my "job" and "source model" file to this message.
Best,
Mehdi
job.ini
source_model.xml

Luigi Panzeri

unread,
Jun 17, 2013, 5:24:13 AM6/17/13
to openqua...@googlegroups.com
Hi Mehdi,

your grid spacing (5.0) is too big for the considered area. Try with other values (e.g. region_grid_spacing = 3).

Otherwise, please consider enumerating the sites (by using the `sites` configuration parameters) instead of using a grid.

Luigi Panzeri


2013/6/17 Mehdi Sadeghi <mehdisa...@gmail.com>

Mehdi Sadeghi

unread,
Jun 18, 2013, 3:21:02 AM6/18/13
to openqua...@googlegroups.com, defm...@gmail.com
Dear Luigi
Thanks for the solution; although I change the region_grid_spacing to 3 and less or SITES configuration instead of region, I have still some errors below.

would you please explain how can I find the source of errors from the commands?

openquake --run-hazard=/home/sadeghi/Desktop/shiraz/AreaSourceClassicalPSHA/job.ini --no-distribute
[2013-06-18 15:08:09,838 hazard #21 ubuntu PROGRESS MainProcess/3114 root] **  pre_executing (hazard)
[2013-06-18 15:08:09,849 hazard #21 ubuntu PROGRESS MainProcess/3114 root] **  initializing sources
[2013-06-18 15:08:10,364 hazard #21 ubuntu PROGRESS MainProcess/3114 root] **  initializing site model
[2013-06-18 15:08:10,672 hazard #21 ubuntu PROGRESS MainProcess/3114 root] **  initializing realizations
[2013-06-18 15:08:11,173 hazard #21 ubuntu PROGRESS MainProcess/3114 root] **  executing (hazard)
[2013-06-18 15:08:11,173 hazard #21 ubuntu WARNING MainProcess/3114 root] Calculation task distribution is disabled
[2013-06-18 15:08:11,209 hazard #21 ubuntu CRITICAL MainProcess/3114 root] Error occurred in task: The following error has occurred with source id='1', name='Area Source': polygon perimeter intersects itself
[2013-06-18 15:08:11,209 hazard #21 ubuntu ERROR MainProcess/3114 root] The following error has occurred with source id='1', name='Area Source': polygon perimeter intersects itself
[2013-06-18 15:08:11,212 hazard #21 ubuntu CRITICAL MainProcess/3114 root] Calculation failed with exception: 'The following error has occurred with source id='1', name='Area Source': polygon perimeter intersects itself'

Traceback (most recent call last):
  File "/usr/bin/openquake", line 9, in <module>
    load_entry_point('openquake.engine==0.9.2', 'console_scripts', 'openquake')()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 620, in main
    args.exports)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 286, in run_hazard
    job, log_level, log_file, exports, 'hazard')
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 351, in run_calc
    _do_run_calc(job, exports, calc, job_type)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 428, in _do_run_calc
    calc.execute()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/base.py", line 223, in execute
    queue_next(self.core_calc_task, task_gen.next())
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/base.py", line 299, in queue_next
    task_func(*task_args)
  File "/usr/lib/python2.7/dist-packages/celery/app/task/__init__.py", line 247, in __call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/celery/app/__init__.py", line 175, in run
    return fun(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/utils/tasks.py", line 146, in wrapped
    res = task_func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/utils/stats.py", line 253, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/classical/core.py", line 48, in hazard_curves
    compute_hazard_curves(job_id, src_ids, lt_rlz_id)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/classical/core.py", line 118, in compute_hazard_curves
    hazard_curves_poissonian(**calc_kwargs)
  File "/usr/lib/python2.7/dist-packages/openquake/hazardlib/calc/hazard_curve.py", line 86, in hazard_curves_poissonian
    for source, s_sites in source_site_filter(sources_sites):
  File "/usr/lib/python2.7/dist-packages/openquake/hazardlib/calc/filters.py", line 67, in filter_func
    for source, sites in sources_sites:
  File "/usr/lib/python2.7/dist-packages/openquake/hazardlib/calc/hazard_curve.py", line 85, in <genexpr>
    sources_sites = ((source, sites) for source in sources)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/general.py", line 238, in gen_sources
    area_source_discretization)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/input/source.py", line 80, in nrml_to_hazardlib
    area_src_disc)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/input/source.py", line 112, in _nrml_source_to_hazardlib
    raise RuntimeError(msg)
RuntimeError: The following error has occurred with source id='1', name='Area Source': polygon perimeter intersects itself
[2013-06-18 15:08:12,216 hazard #21 - ERROR MainProcess/3115 supervisor] job process 3114 crashed or terminated
Calculation 21 failed

Kind Regards,
Mehdi

Lars Butler

unread,
Jun 18, 2013, 4:33:09 AM6/18/13
to openqua...@googlegroups.com
Hi Mehdi,

This is telling you that there is something strange with the geometry of one of your sources. Try plotting the coordinates of your polygon and you will see very quickly the error is. (See attachment.)

Thanks,
Lars
area.png

Mehdi Sadeghi

unread,
Jun 20, 2013, 4:05:53 AM6/20/13
to openqua...@googlegroups.com
Hi Lars,
Thank you for your help...
It works now.
Regards,
Mehdi

Mehdi Sadeghi

unread,
Jan 7, 2014, 9:01:09 AM1/7/14
to openqua...@googlegroups.com
Dear Lars,
Hello
I run my Hazard calculation last week and I got my result quit well, now when I run it again without any changers, I got the following error!
Would you please tell me what is wrong?


mahdi@ubuntu:~$ openquake --run-hazard=/home/mahdi/Desktop/ShirazMainNewLog/job.ini --no-distribute
[2014-01-07 14:45:04,607 hazard #8 - PROGRESS MainProcess/2599 root] **  pre_executing (hazard)
[2014-01-07 14:45:04,741 hazard #8 - PROGRESS MainProcess/2599 root] **  initializing sites
[2014-01-07 14:45:04,908 hazard #8 - PROGRESS MainProcess/2599 root] **  initializing sources
[2014-01-07 14:45:05,008 hazard #8 - CRITICAL MainProcess/2599 root] Calculation failed with exception: 'failed to load external entity "/usr/lib/python2.7/dist-packages/openquake/nrmllib/schema/nrml.xsd"'

Traceback (most recent call last):
  File "/usr/bin/openquake", line 9, in <module>
    load_entry_point('openquake.engine==1.0.0', 'console_scripts', 'openquake')()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/bin/oqscript.py", line 426, in main
    log_file, args.exports)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 633, in run_hazard

    job, log_level, log_file, exports, 'hazard'
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 447, in run_calc
    _job_exec(job, log_level, exports, job_type, calc)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 472, in _job_exec

    _do_run_calc(job, exports, calc, job_type)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/engine.py", line 509, in _do_run_calc
    calc.pre_execute()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/classical/core.py", line 131, in pre_execute
    super(ClassicalHazardCalculator, self).pre_execute()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/general.py", line 217, in pre_execute
    num_sources = self.initialize_sources()
  File "/usr/lib/python2.7/dist-packages/openquake/engine/performance.py", line 120, in newmeth
    return method(self, *args)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/calculators/hazard/general.py", line 239, in initialize_sources
    file(smlt_file).read(), self.hc.base_path, smlt_file)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/input/logictree.py", line 647, in __init__
    super(SourceModelLogicTree, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openquake/engine/input/logictree.py", line 370, in __init__
    parser = etree.XMLParser(schema=self.get_xmlschema())
  File "/usr/lib/python2.7/dist-packages/openquake/engine/input/logictree.py", line 364, in get_xmlschema
    file=openquake.nrmllib.nrml_schema_file())
  File "xmlschema.pxi", line 105, in lxml.etree.XMLSchema.__init__ (src/lxml/lxml.etree.c:132605)
lxml.etree.XMLSchemaParseError: failed to load external entity "/usr/lib/python2.7/dist-packages/openquake/nrmllib/schema/nrml.xsd"

One more question,
If I run the command "openquake --version" and got the "1.0.0", can I suppose that my OQ engine installed well? or is there any other way to understand, if my OQ engine is installed and working well?

All the Best,
Mehdi
Reply all
Reply to author
Forward
0 new messages