hafas-client
hafas-client copied to clipboard
OEBB: Parser error: root.svcResL.svcResL.res.common.rtSrcL.rtSrcL.type
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
Currently can't reproduce this error. I will set up a script that runs this periodically.
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
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.
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.
Hi @derhuerst
any news concerning this case ? Did the error occur in your script ?
Thanks and regards, Ralf
Yes, this error has appeared in the logs 14k times.
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.
Hi @derhuerst ,
any news concerning this error ? It happens only with OEBB, but here multiple times a day.
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!
Closing this, please re-open if you encounter this problem again.
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.
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()"}
I did not create this issue, could someone please re-open it? @derhuerst @gaudes
@jstsmthrgk With the response only, I can't do much unforunately. Please provide the corresponding request that caused the error response.