krischer/jane

FDSNWS: "internal server error" for any dataselect request that matches a continuous waveform with sampling rate 0

megies opened this issue · 0 comments

Any waveform request that matches at least one continuous waveform in the postgres DB with sampling rate 0 (happens e.g. for LOG channels of reftek digitizers), will always result in an FDSNException: Service responds: Internal server error.

from obspy.clients.fdsn import Client
c = Client('http://jane')
start = UTCDateTime(2017, 1, 1, 12)
for cha in ('LOG', '*'):
    try:
        c.get_waveforms('GR', 'FUR', '', cha, start, start + 10)
    except Exception as e:
        print(str(e))

Prints the corresponding error message two times..

Service responds: Internal server error
Detailed response of server:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
[...]

Here's what's in the DB for station FUR at given time:
screenshot from 2018-02-15 13 19 29

And here's the content of that LOG mseed file (each trace basically has one line of plain text log message stored in the data array):

294 Trace(s) in Stream:

GR.FUR..LOG | 2017-01-01T00:00:00.000000Z - 2017-01-01T00:00:00.000000Z | 0.0 s, 26 samples
...
(292 other traces)
...
GR.FUR..LOG | 2017-01-01T23:00:00.000000Z - 2017-01-01T23:00:00.000000Z | 0.0 s, 55 samples

It looks like that internally jane might be producing a 0-byte mseed and errors out when trying to read it..

Manually requesting via URL returns a 0-byte file:
http://jane/fdsnws/dataselect/1/query?network=GR&station=FUR&location=--&starttime=2017-01-01T12:00:00.000000&endtime=2017-01-01T12:00:10.000000&channel=LOG

Also leaving out the channel (i.e. requesting all channels) returns a 0-byte file:
http://jane/fdsnws/dataselect/1/query?network=GR&station=FUR&location=--&starttime=2017-01-01T12:00:00.000000&endtime=2017-01-01T12:00:10.000000


Also.. obspy is behaving strangely when slicing Streams with sampling rate 0 traces in it, see obspy/obspy#2076

CC @jwassermann