ibi-group / datatools-server

Server for IBI's GTFS data management platform.
MIT License
49 stars 51 forks source link

return value of "java.util.List.get(int)" is nullNetwork error (500)! #593

Open afconlab opened 4 months ago

afconlab commented 4 months ago

I can't add a stop to a shape on trip pattern. I have the error below

**INFO  2024-05-02T18:17:08.164 [qtp290910207-22] c.c.gtfs.loader.JdbcTableWriter(JdbcTableWriter.java:741) Deleted 0 pattern_stops
ERROR 2024-05-02T18:17:08.167 [qtp290910207-22] c.c.gtfs.loader.JdbcTableWriter(JdbcTableWriter.java:248) Error updating patterns entity
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.isNull()" because the return value of "java.util.List.get(int)" is null
    at com.conveyal.gtfs.loader.JdbcTableWriter.updateLinkedFields(JdbcTableWriter.java:344)
    at com.conveyal.gtfs.loader.JdbcTableWriter.updateChildTable(JdbcTableWriter.java:635)
    at com.conveyal.gtfs.loader.JdbcTableWriter.update(JdbcTableWriter.java:194)
    at com.conveyal.datatools.editor.controllers.api.EditorController.update(EditorController.java:499)
    at com.conveyal.datatools.editor.controllers.api.EditorController.createOrUpdate(EditorController.java:479)
    at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47)
    at spark.http.matching.Routes.execute(Routes.java:61)
    at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
    at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1598)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.Server.handle(Server.java:516)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
    at java.base/java.lang.Thread.run(Thread.java:840)
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.isNull()" because the return value of "java.util.List.get(int)" is null
    at com.conveyal.gtfs.loader.JdbcTableWriter.updateLinkedFields(JdbcTableWriter.java:344)
    at com.conveyal.gtfs.loader.JdbcTableWriter.updateChildTable(JdbcTableWriter.java:635)
    at com.conveyal.gtfs.loader.JdbcTableWriter.update(JdbcTableWriter.java:194)
    at com.conveyal.datatools.editor.controllers.api.EditorController.update(EditorController.java:499)
    at com.conveyal.datatools.editor.controllers.api.EditorController.createOrUpdate(EditorController.java:479)
    at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47)
    at spark.http.matching.Routes.execute(Routes.java:61)
    at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
    at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1598)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.Server.handle(Server.java:516)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
    at java.base/java.lang.Thread.run(Thread.java:840)
INFO  2024-05-02T18:17:08.174 [qtp290910207-22] c.c.d.common.utils.SparkUtils(SparkUtils.java:136) Halting with status code 500.  Error message: An error was encountered while trying to save to the database
ERROR 2024-05-02T18:17:08.174 [qtp290910207-22] c.c.d.common.utils.SparkUtils(SparkUtils.java:139) An error was encountered while trying to save to the database
WARN  2024-05-02T18:17:08.175 [qtp290910207-22] c.c.d.manager.utils.ErrorUtils(ErrorUtils.java:64) Bugsnag not configured to report errors!
INFO  2024-05-02T18:17:08.175 [qtp290910207-22] c.c.d.common.utils.SparkUtils(SparkUtils.java:243) res (500) xyz@xyz.com PUT: http://localhost:9966/api/editor/secure/pattern/1?feedId=08eb4bf1-524b-4776-99ef-ffa8ff5e1dc8&sessionId=node08kkegaxs89321q9513kv1w83e1 
{
  "result" : "ERR",
  "message" : "An error was encountered while trying to save to the database",
  "code" : 500,
  "detail" : "Cannot invoke \"com.fasterxml.jackson.databind.JsonNode.isNull()\" because the return value of \"java.util.List.get(int)\" is null"
}
INFO  2024-05-02T18:17:08.175 [qtp290910207-22] c.c.d.e.c.api.EditorController(EditorController.java:489) Update operation took 49 msec**

**

miles-grant-ibigroup commented 4 months ago

Does this only happen when you try to delete a stop from a pattern?

afconlab commented 4 months ago

No, even if I add a stop, I don't have errors on mongodb or psql logs , I added a local instance of graphopper , but I still have the issue. I will start a new install from scratch today

afconlab commented 4 months ago

Does anyone else has this issue?I don't know where I'm wrong

miles-grant-ibigroup commented 4 months ago

Something might be wrong with your database. Check that you are attempting to write to an empty Postgres database

afconlab commented 4 months ago

official documentation says that :

Once PostgreSQL is installed and the service has been started, create the database for instance by using the CLI createdb: $ createdb gtfs_storage_db So I created database image image

but I have the same error with all of them

I just notice some warning when I create a feed image where I'am wrong ?

afconlab commented 4 months ago

i became crazy event with

postgres user with password defined
bindip -> listen_addresses = '*'
IPv4 local connections: -> host    all             all             0.0.0.0/0            md5
port allowed -> sudo ufw allow 5432/tcp
postgres  -> sudo systemctl restart postgresql

only stop integration on trip patterns does'nt work the issue still the same {"result":"ERR","message":"Authorization header is missing.","code":401,"detail":null} I can delete stop from a uploaded feed