hafas-client icon indicating copy to clipboard operation
hafas-client copied to clipboard

OEBB: Parser error: root.svcResL.svcResL.res.common.rtSrcL.rtSrcL.type

Open gaudes opened this issue 3 years ago • 16 comments

Hi Janis,

first errors coming in to Sentry with new version on npm:

Problem occurs with OEBB, message is always Parser error: root.svcResL.svcResL.res.common.rtSrcL.rtSrcL.type

Error occured on following journeys: from 1240815 to 8100013 from 1230611 to 1291201

Also with following departures: 1240815

Thanks and regards,

Ralf

gaudes avatar Jun 24 '21 19:06 gaudes

Currently can't reproduce this error. I will set up a script that runs this periodically.

derhuerst avatar Jun 28 '21 21:06 derhuerst

Hi @derhuerst

any news concerning this issue ?

I have 315 errors the last 30 days from different users.

Problem only occurs with ÖBB profile.

Thanks and regards,

Ralf

gaudes avatar Aug 22 '21 11:08 gaudes

Hello,

I am also struggling with this bug. Interestingly, it seems that this error is not thrown at every request. Sometimes it works, sometimes it doesn’t.

asuender avatar Aug 22 '21 12:08 asuender

Huh, I just noticed that the script I wrote to find this bug wasn't working properly, sorry. I have fixed it now, let's see if it finds the error.

Again, if you could give me a request that reproduces this error (by running with the DEBUG=hafas-client environment variable), I could probably start fixing it right away.

derhuerst avatar Aug 23 '21 11:08 derhuerst

Hi @derhuerst

any news concerning this case ? Did the error occur in your script ?

Thanks and regards, Ralf

gaudes avatar Sep 19 '21 12:09 gaudes

Yes, this error has appeared in the logs 14k times.

derhuerst avatar Sep 21 '21 15:09 derhuerst

I don't know how to solve this though. Maybe we can adapt hafas-client's ÖBB profile to re-try the request when this error appears.

derhuerst avatar Sep 21 '21 15:09 derhuerst

Hi @derhuerst ,

any news concerning this error ? It happens only with OEBB, but here multiple times a day.

gaudes avatar Feb 19 '22 21:02 gaudes

I don't have any news, unfortunately.

From the top of my head, I haven't tried this, the profile would have to look like this:

const {request: defaultRequest} = require('../../lib/default-request')

const rtSrcLTypeParserErrorMessage = 'Parser error: root.svcResL.svcResL.res.common.rtSrcL.rtSrcL.type'

const requestRetryingOnRtSrcLTypeParserError = async (...args) => {
	for (let attempt = 0; true; attempt++) {
		try {
			return await defaultRequest(...args)
		} catch (err) {
			// retry 3 times on rtSrcL.type parser error, throw otherwise
			// todo: clarify if this actually matches the error
			if (err.message !== rtSrcLTypeParserErrorMessage || attempt >= 2) throw err
		}
	}
}

const oebbProfile = {
	// other stuff…

	request: requestRetryingOnRtSrcLTypeParserError,
}

A PR would be very welcome!

derhuerst avatar Feb 19 '22 23:02 derhuerst

Closing this, please re-open if you encounter this problem again.

derhuerst avatar Apr 24 '23 21:04 derhuerst

I have also had this error with a very specific train, if that train was included it failed, if it wasnt, it didn't fail.

Station: 8100013 Linz/Donau Hbf

Train: (I don't know any id): IC 460 to Freilassing 23:30 (18.05.2023)

I adjusted opts.results to include/don't include that train, if it was in it failed, if it wasn't it didn't.

jstsmthrgk avatar May 18 '23 21:05 jstsmthrgk

Ok, it is a server side error, this is the exact response:

{"ver":"1.41","lang":"deu","id":"","err":"PARSE","errTxt":"Parser error: root.svcResL.svcResL.res.common.rtSrcL.rtSrcL.type()"}

jstsmthrgk avatar Jun 28 '23 10:06 jstsmthrgk

I did not create this issue, could someone please re-open it? @derhuerst @gaudes

jstsmthrgk avatar Jun 28 '23 10:06 jstsmthrgk

@jstsmthrgk With the response only, I can't do much unforunately. Please provide the corresponding request that caused the error response.

derhuerst avatar Jul 10 '23 18:07 derhuerst