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

Investigate NullPointerException in vehicleposition processor #298

Open
LofhJann opened this issue Jun 8, 2023 · 2 comments
Open

Investigate NullPointerException in vehicleposition processor #298

LofhJann opened this issue Jun 8, 2023 · 2 comments

Comments

@LofhJann
Copy link

LofhJann commented Jun 8, 2023

https://github.com/HSLdevcom/transitdata-vehicleposition-processor is logging loads of NullPointerExceptions coming from fi.hsl.transitdata.vehicleposition.application.VehiclePositionHandler

Investigate the cause and fix problem and/or improve error handling

@LofhJann
Copy link
Author

LofhJann commented Jun 8, 2023

Could be related to fi.hsl.transitdata.omm.OmmCancellationHandler. From first glance it seems these logs are usually seen together with Produced entire departure cancellation for trip: xxxx/<TIMESTAMP> so it could be that trips that have been cancelled lack some information that vehicleposition-processor is trying to use.

Following this line of theory, if proven wrong this is mostly a non-problem but error handling should be improved to avoid logs filling with unnecessary NPEs either way.

@LofhJann
Copy link
Author

LofhJann commented Jul 5, 2023

Optional<PassengerCount.Payload> maybePayload = passengerCountParser.parsePayload(apcJson);

This line is likely culprit. parsePayload() isn't returning Optional.Empty in case of exceptions as it likely should. Requires more investigation but likely this.

Root cause is deeper
Caused by: com.dslplatform.json.ParsingException: Leading zero is not allowed. Error parsing number at position: 257, following: oc": "GPS", "stop": , before: 00000, "route": "457
Could be wrong data type somewhere? (Integers can't have leading zeroes so if such is case it should be String instead)

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

No branches or pull requests

1 participant