fault source creation failure

Bug #972202 reported by Ben Wyss
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Medium
Matteo Nastasi

Bug Description

The Fault Source generation function ( https://github.com/gem/oq-ui-api/blob/master/geonode/observations/utils.py#L91 ) needs to include logging and or tests in order to have proper test coverage, and to help identify the source of fault generation failure.

Also as part of this bug, we need to add a more meaning full message to the fault source generation error message that is passed on to the end user in the UI.

Currently the error message reads fault source generated, or fault source generation failed. But it should report why the fault source could not be generated.

Tags: earth faulted ui
Ben Wyss (bmwyss)
Changed in openquake:
status: New → In Progress
Revision history for this message
Ben Wyss (bmwyss) wrote :

I have added logging to Django by adding to local_settings.py:

#Logging
ROOT_PATH = os.path.dirname(__file__)
LOG_DIR = "/var/log/geonode/"
LOG_FILE = os.path.join(LOG_DIR, "django.log")

log = logging.getLogger("django")
log.level = logging.DEBUG
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")

# log to file
fh = logging.FileHandler(LOG_FILE)
fh.setFormatter(formatter)
log.addHandler(fh)

Then in utils.py I added:

import logging
log = logging.getLogger("django.feeds.utils")

and in a function:

...log.debug("d'a fault source name %s" % faultsource.fault)
...

Then, in /var/log/geonode/django.log I can follow the logging for django

Revision history for this message
Ben Wyss (bmwyss) wrote :

Postgres is reporting:
could not receive data from client:
Connection reset unexpected EOF on client connection

I will now begin debugging from the client side

Revision history for this message
Ben Wyss (bmwyss) wrote :

This means the client is crashing or dropping the connection--one needs
to be looking at the client end for the problem.

Revision history for this message
matley (matley) wrote :

The client is crashing as it tries to reuse an existing "jvm" jpype connection. In order to do this you to attach the current process to the current jvm thread. You can find a fix in https://github.com/matley/oq-ui-api/blob/963088/geonode/observations/utils.py

matley (matley)
Changed in openquake:
assignee: nobody → matley (matley)
Ben Wyss (bmwyss)
Changed in openquake:
status: In Progress → New
Revision history for this message
matley (matley) wrote :

At this moment, the fault creation feature is working on the production server but not on the development server. There is a problem with the environment configuration as the application is not able to start the JVM (it seems that the JAVA_HOME env is not set).

summary: - add logging and or tests to fault source function
+ fault source creation failure
Changed in openquake:
assignee: matley (matley) → nobody
assignee: nobody → Matteo Nastasi (nastasi-oq)
Revision history for this message
Matteo Nastasi (nastasi-oq) wrote :

Found where add the the JAVA_HOME set from the working production machine; update the installation script to replicate this modification.

Changed in openquake:
status: New → 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.