Custom GTFS causes null pointer exception [SOLVED]

I made a custom GTFS file with synthesized routes, stop times, etc. Tested it with https://github.com/google/transitfeed and it only showed non-critical warnings, no errors.

Still, graphhopper crashes with this exception.

Here’s the relevant config piece:

 # OpenStreetMap input file
 # datareader.file: /data/brandenburg-latest.osm.pbf
 # gtfs.file: /data/gtfs-vbb.zip
 datareader.file: /data/RU-NVS.osm.pbf
 gtfs.file: /data/nsk.zip

command:

./graphhopper.sh web --config config.yml  /data/data.osm.pbf

And the crash stack trace:

INFO  [2018-06-26 19:14:28,862] com.graphhopper.reader.osm.OSMReader: time pass1:5s, pass2:6s, total:12s
INFO  [2018-06-26 19:14:28,863] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: start finding subnetworks (min:200, min one way:0) totalMB:8192, usedMB:1788
INFO  [2018-06-26 19:14:29,045] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: 1028 subnetworks found for pt, totalMB:8192, usedMB:1795
INFO  [2018-06-26 19:14:29,090] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: optimize to remove subnetworks (1028), unvisited-dead-end-nodes (0), maxEdges/node (8)
java.lang.RuntimeException: java.lang.NullPointerException
	at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(GtfsStorage.java:203)
	at com.graphhopper.reader.gtfs.GraphHopperGtfs.createOrLoad(GraphHopperGtfs.java:332)
	at com.graphhopper.http.GraphHopperBundle.runPtGraphHopper(GraphHopperBundle.java:199)
	at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:188)
	at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:61)
	at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:200)
	at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
	at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
	at io.dropwizard.cli.Cli.run(Cli.java:78)
	at io.dropwizard.Application.run(Application.java:93)
	at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:46)
Caused by: java.lang.NullPointerException
	at com.conveyal.gtfs.GTFSFeed.<init>(GTFSFeed.java:928)
	at com.conveyal.gtfs.GTFSFeed.<init>(GTFSFeed.java:904)
	at com.graphhopper.reader.gtfs.GtfsStorage.loadGtfsFromFile(GtfsStorage.java:198)
	... 10 more

I guess, it’s unhandled exception, so stack trace is useless.

Here’s the feed file and the osm file.

This was a problem with Docker, the host machine swap file was full.

1 Like