Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration of EVENT services #38

Open
jan-michalek opened this issue Jan 4, 2022 · 10 comments
Open

Configuration of EVENT services #38

jan-michalek opened this issue Jan 4, 2022 · 10 comments

Comments

@jan-michalek
Copy link

I am struggling with configuration of the event services in webinterface.cfg.

  1. Order of the services in the drop-down dialog menu is not possible to control.
    I tried various options but none of those worked:
    • event.catalogs.preferred = geofon; can not be changed, whole interface crashing otherwise. In addition, this attribute is not unique, not clear how it is linked the the actual EVENT services. The values for .handler are not unique.
    • order is not given by the list of service URLs (example below)
  2. USGS and INGV services not working despite the actual services accessed directly work.
    • logic behind naming of the services is not clear and makes it difficult to configure (trial/error)

Example: Part of the configuration from webinterface.cfg

# All event services which will be enabled.
# Include 'parser' here to support file upload.
#event.catalogs.ids = uib, geofon, comcat, emsc, fdsnws, parser, meteor
event.catalogs.ids = geofon, comcat, emsc, fdsnws, parser, meteor

# The preferred service will appear first in the pull-down menu of event
# services.
event.catalogs.preferred = geofon
#event.catalogs.preferred = uib
#event.catalogs.preferred = fdsnws

# Maximum number of events which are returned if no limit is set.
event.defaultLimit = 100000
# Verbosity level a la SeisComP logging.level.
# 0:quiet, 1:error, 2:warning, 3:info, 4:debug
event.verbosity = 3

# Service URLs:
event.service.uib.description = UIB
event.service.uib.handler = fdsnws
event.service.uib.baseURL = "http://nnsn.geo.uib.no/nnsn_eqcat/fdsnws/event/1/query"
event.service.uib.extraParams = "format=text&limit=100000"

event.service.geofon.description = GFZ
event.service.geofon.handler = geofon
event.service.geofon.baseURL = "http://geofon.gfz-potsdam.de/eqinfo/list.php"
event.service.geofon.extraParams = "fmt=csv"

event.service.comcat.description = USGS
event.service.comcat.handler = fdsnws
event.service.comcat.baseURL = "http://earthquake.usgs.gov/fdsnws/event/1/query"
event.service.comcat.extraParams = "format=text"

event.service.emsc.description = EMSC
event.service.emsc.handler = fdsnws
event.service.emsc.baseURL = "http://www.seismicportal.eu/fdsnws/event/1/query"
event.service.emsc.extraParams = "format=text"

event.service.fdsnws.description = INGV
event.service.fdsnws.handler = fdsnws
event.service.fdsnws.baseURL = "http://webservices.rm.ingv.it/fdsnws/event/1/query"
event.service.fdsnws.extraParams = "format=text&user=webinterface"
@pevans-gfz
Copy link
Contributor

See also #18 regarding catalog order.

@pevans-gfz
Copy link
Contributor

Hmm. It is possible that there is a bug in the code such that it only works when the ISC catalog is present.

@jan-michalek: Could you try visiting your instances' event/catalogs endpoint? For GFZ, we have the following response from http://eida.gfz-potsdam.de/webdc3/wsgi/event/catalogs

{"geofon": {"hasRectangle": true, "hasDate": true, "description": "GFZ",  .... } 
...
 "isc": {"hasRectangle": true, "hasDate": true, "description": "ISC via IRIS (to 2016)", "hasDepth": true, "hasCircle": false, "hasMagnitude": true}}

Do you get a JSON file? Is it valid JSON?

Our configuration includes the following lines in webinterface.cfg which results in the ISC section in the JSON output above, even though ISC doesn't appear in our list of event.catalogs.ids:

event.catalogs.ids = geofon, comcat, sp, parser, meteor

[..]
event.service.isc.description = "ISC via IRIS (to 2016)"
event.service.isc.handler = "fdsnws"
event.service.isc.baseURL = "http://service.iris.edu/fdsnws/event/1/query"
event.service.isc.extraParams = "catalog=ISC&format=text"

This is at least confusing, and probably wrong.

@jan-michalek
Copy link
Author

jan-michalek commented Jan 7, 2022

Yes, the https://eida.geo.uib.no/webdc3/wsgi/event/catalogs produces valid JSON with all catalogs defined in webinterface.cfg. Our event service itself (http://nnsn.geo.uib.no/nnsn_eqcat/fdsnws/event/1/) does not have the catalogs method (yet).

I haven't found any valid combination of catalogs for event.catalogs.ids and the WebDC3 is showing error for any edits other then default.

I tried to add the ISC catalog (copied config lines from above) but getting warning: Got no events for the selected day and options
The other catalogs USGS and INGV also do not work.

@andres-h
Copy link
Contributor

andres-h commented Jan 7, 2022

I think the logic at

# A hack here to force the preferred key to come first:
may not be correct and produce invalid JSON.

@pevans-gfz
Copy link
Contributor

Great that your event/catalogs now produces valid JSON. I think, as @andres-h also observed, that we know where the problem is - this fails to produce correct JSON if ISC is left out. I'll fix that.

When I visit https://eida.geo.uib.no/webdc3/ and search with each catalog service in turn, for events on 2021-01-01 with M>=3, I see:

For ISC, there are no recent events in that catalog - try e.g. http://service.iris.edu/fdsnws/event/1/query?catalog=ISC&minmag=6&format=text&limit=5

@jan-michalek
Copy link
Author

Thanks for reply and investigating!

What do you mean by "That's gone to the wrong place!" for USGS? Is it something wrong in our config? URL for USGS service is correct and works if accessed directly.

@pevans-gfz
Copy link
Contributor

I meant that you'll see the console output above shows that WebDC was trying to query requests from the wrong place: https://eida.geo.uib.no/event/comcat - but that URL gives me a 404 response.

I think that's because WebDC is incorrectly computing what URL to use for the USGS service. I got a similar response from our service when I mistakenly set event.service.NAME.handler = comcat instead of event.service.NAME.handler = fdsnws.

In the meantime, I've committed a few changes - see my pull request https://github.com/pevans-gfz/webdc3/tree/18-event-catalog-order If you update your wsgi/modules/event.py and js/webdc3.min.js and restart your WebDC instance (probably, restart the web server) I hope you'll now be able to set the preferred service correctly with a webinterface.cfg file containing...

event.catalogs.preferred = uib
event.service.uib.description = UIB
event.service.uib.handler = fdsnws
event.service.uib.baseURL = "http://nnsn.geo.uib.no/nnsn_eqcat/fdsnws/event/1/query"
event.service.uib.extraParams = "format=text&limit=100000"
[etc.]

@jan-michalek
Copy link
Author

Thanks @pevans-gfz !
Order of catalogues works after updating code in the two files.

For USGS it still does not work. I renamed the configuration to event.service.NAME. ... to avoid confusion but .handler = fdsnws was there always.

event.service.usgs.description = USGS
event.service.usgs.handler = fdsnws
event.service.usgs.baseURL = "http://earthquake.usgs.gov/fdsnws/event/1/query"
event.service.usgs.extraParams = "format=text"

Now I am getting error in concole:
Failed to get events: Error 503: Temporarily Unavailable Service 'usgs': No answer from URL / HTTP Error 400: Bad Request. Request: https://eida.geo.uib.no/event/usgs?start=2022-01-04&end=2022-01-12&minmag=3&maxmag=10&mindepth=0&maxdepth=999&minlat=27.15&minlon=12.13&maxlat=54.74&maxlon=41.64&format=json&_=1641919304276 Request Submitted: 2022-01-11 16:41:44.676472 Service version: 2015.035

@pevans-gfz
Copy link
Contributor

Good that the ordering works, at least.

I'm puzzled by the problem with other event web services. I can see you have your own UIB service working, and the GFZ catalogue connecting to list.php at GEOFON works, and EMSC works, which also uses fdsnws-event. But is it possible that your server can't connect to http://earthquake.usgs.gov/, perhaps because it is behind some firewall? It might also be that the fdsnws-event requests that the webdc3 instance makes are somehow acceptable to some fdsnws-event services, but not others. For instance, http://eida.geo.uib.no/webdc3/wsgi/event/usgs?start=2021-07-04&end=2022-01-12&minmag=6&maxmag=10&mindepth=0&maxdepth=999&minlat=-90&minlon=-180&maxlat=90&maxlon=180&format=json&_=1641934121890 should return a JSON list of events for the front end to display, not the 503 message you got above.

Could you try adding the following in webinterface.cfg:

  • geofonfdsnws to event.catalog.ids,
  • The following block:
event.service.geofonfdsnws.description = "GFZ"
event.service.geofonfdsnws.handler = fdsnws
event.service.geofonfdsnws.baseURL = "http://geofon.gfz-potsdam.de/fdsnws/event/1/query"
event.service.geofonfdsnws.extraParams = "format=text"

And restart. This adds an event catalog using the GEOFON fdsnws service, and it works for me here.

@jan-michalek
Copy link
Author

How adding geofonfdsnws might be related to USGS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants