opentripplanner / otp-datastore

Play-based backend for logging OTP queries.
2 stars 8 forks source link

save plan: null pointer exception #9

Closed fpurcell closed 1 year ago

fpurcell commented 1 year ago

running the play app in test, against a postgres database, I'm getting an error when I save attempt to save a trip:

Screenshot 2023-06-12 at 3 11 05 PM

I've dropped the database, reloaded the db with a snapshot from production, etc...

This is the exception:

Internal Server Error (500) for request POST /fieldtrip/newTrip

Execution exception (In /app/controllers/FieldTrip.java around line 208)
JPAQueryException occured : Error while executing query from models.fieldtrip.GTFSTrip where tripHash = ?: ERROR: operator does not exist: character varying = bytea   Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.   Position: 565

play.exceptions.JavaExecutionException: Error while executing query <strong>from models.fieldtrip.GTFSTrip where tripHash = ?</strong>: ERROR: operator does not exist: character varying = bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 565
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
    at Invocation.HTTP Request(Play!)
Caused by: play.db.jpa.JPABase$JPAQueryException: Error while executing query <strong>from models.fieldtrip.GTFSTrip where tripHash = ?</strong>: ERROR: operator does not exist: character varying = bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 565
    at play.db.jpa.GenericModel$JPAQuery.fetch(GenericModel.java:380)
    at controllers.FieldTrip.newTrip(FieldTrip.java:208)
    at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:557)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:508)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:484)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:479)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
    ... 1 more
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = bytea
  Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  Position: 565
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
    at org.hibernate.loader.Loader.doQuery(Loader.java:802)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.doList(Loader.java:2542)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
    at org.hibernate.loader.Loader.list(Loader.java:2271)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
    at play.db.jpa.GenericModel$JPAQuery.fetch(GenericModel.java:378)
    ... 7 more

FWIW, I'm using OpenJDK 8:

Screenshot 2023-06-12 at 6 03 42 PM

version of play is 1.2.5:

Screenshot 2023-06-12 at 6 17 16 PM
fpurcell commented 1 year ago

p.s., the old call app is not having the same issue ... Barb who uses the fieldtrip app daily is saving trips off all the time with the old Leaflet version of the app. The play code is the same in production I'm trying to run here in call-test afaik -- that said, the play app in production has been running continuously w/out a restart since 2022 (so maybe we're not running the same exact code, although that said there are few changes since 2019 -- with this error popping up, I'm reluctant to restart production to find out); and the production call database has not been refreshed or reloaded for a long time either...

miles-grant-ibigroup commented 1 year ago

Hi there -- sorry about the confusion. The patch that most recently went through is not a backwards-compatible patch. This new version of the datastore is only compatible with the most recent OTP2 version of the OTP-RR front end, which uses different types

fpurcell commented 1 year ago

closing ... the fix will be in OTP-UI for making sure trip id is not a null field, and thus causing the NPE error described above.