stadtnavi / stadtnavi-tutorial

stadtnavi installation tutorial
Creative Commons Zero v1.0 Universal
14 stars 3 forks source link

step 2: OTP run fails because of parameter error #10

Closed dancesWithCycles closed 3 years ago

dancesWithCycles commented 3 years ago

Hi folks, How are you? Thank you very much for providing this awesome tutorial. Following step 2 discloses this error.

Step 20/26 : RUN java -Xmx$MEMORY -jar otp-shaded.jar --build build/$ROUTER_NAME | tee build/build.log
 ---> Running in 360774d1bb42
10:54:12.498 ERROR (OTPMain.java:91) Parameter error: --build must be used with --save or --serve (or both) Use --help to see 

It looks like OTP is complaining about a missing parameter. The entire instruction log follows below for the sake of completeness. I will let you know if I find a working configuration. Cheers!

docker-compose --env-file=.env.vbn up --build -d
Building graph
Sending build context to Docker daemon  13.31kB
Step 1/26 : ARG OTP_TAG=latest
Step 2/26 : ARG OTP_IMAGE=mfdz/opentripplanner
Step 3/26 : FROM $OTP_IMAGE:$OTP_TAG AS otp
latest: Pulling from mfdz/opentripplanner
5843afab3874: Pull complete 
eb9fbd82d7f0: Pull complete 
b5c12070476c: Pull complete 
fa84c1102466: Pull complete 
5f7bb23700f4: Pull complete 
3da57f1c2500: Pull complete 
860d6aa7994f: Pull complete 
b5e4c4cbafee: Pull complete 
47bb4e211ee5: Pull complete 
Digest: sha256:be4c4559c7ee6c1876539fee27151bbd4ff6595f67fd9afd16d3f26ab7431884
Status: Downloaded newer image for mfdz/opentripplanner:latest
 ---> b4987af18cee
Step 4/26 : ARG OTP_VERSION
 ---> Running in 3fe810b73f7a
Removing intermediate container 3fe810b73f7a
 ---> c03a1abce2a3
Step 5/26 : ENV ROUTER_NAME=default
 ---> Running in 83014c75c8ca
Removing intermediate container 83014c75c8ca
 ---> 40e951e63068
Step 6/26 : ARG gtfs_url=https://www.openvvs.de/dataset/e66f03e4-79f2-41d0-90f1-166ca609e491/resource/bfbb59c7-767c-4bca-bbb2-d8d32a3e0378/download/google_transit.zip
 ---> Running in 26c8c2e0e90a
Removing intermediate container 26c8c2e0e90a
 ---> 606a1fbe0575
Step 7/26 : ENV GTFS_URL=$gtfs_url
 ---> Running in 615f92fd4623
Removing intermediate container 615f92fd4623
 ---> 7cb41b529425
Step 8/26 : ARG osm_pbf_url=https://download.geofabrik.de/europe/germany/baden-wuerttemberg/stuttgart-regbez-latest.osm.pbf
 ---> Running in fe7a4b96fecb
Removing intermediate container fe7a4b96fecb
 ---> 691910741c87
Step 9/26 : ENV OSM_PBF_URL=$osm_pbf_url
 ---> Running in 9e789a808d1e
Removing intermediate container 9e789a808d1e
 ---> bc7e7bb72ffa
Step 10/26 : ARG memory=31G
 ---> Running in 49da7f519f52
Removing intermediate container 49da7f519f52
 ---> 5737cc84d2e4
Step 11/26 : ENV MEMORY=$memory
 ---> Running in 75c8383b6fe3
Removing intermediate container 75c8383b6fe3
 ---> 285f3efd7cb7
Step 12/26 : RUN apk add --update zip &&     rm -rf /var/cache/apk/*
 ---> Running in 48174988b099
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/2) Installing unzip (6.0-r9)
(2/2) Installing zip (3.0-r9)
Executing busybox-1.33.1-r2.trigger
OK: 43 MiB in 38 packages
Removing intermediate container 48174988b099
 ---> 1fee106575be
Step 13/26 : RUN mkdir -p /opt/opentripplanner/build/$ROUTER_NAME/
 ---> Running in 52fce35ce753
Removing intermediate container 52fce35ce753
 ---> a0f53ab68144
Step 14/26 : ADD router-config.json /opt/opentripplanner/build/$ROUTER_NAME/
 ---> 72e1865e1334
Step 15/26 : ADD build-config.json /opt/opentripplanner/build/$ROUTER_NAME/
 ---> a6a2c29f54f8
Step 16/26 : ADD $OSM_PBF_URL /opt/opentripplanner/build/$ROUTER_NAME/
Downloading [==================================================>]  118.7MB/118.7MB

 ---> 760b859348b8
Step 17/26 : ADD $GTFS_URL /opt/opentripplanner/build/$ROUTER_NAME/
Downloading [==================================================>]  70.94MB/70.94MB

 ---> 9190e33c5fce
Step 18/26 : RUN java -jar otp-shaded.jar --version | tee build/version.txt
 ---> Running in 8dd8ecc8906b
OpenTripPlanner version: 2.1.0-SNAPSHOT, ser.ver.id: 8, commit: f4d04d59568708cf9778b48f8cb8bbcb9d16b269, branch: dev-2.x
Removing intermediate container 8dd8ecc8906b
 ---> 79989936cad6
Step 19/26 : RUN echo "image: mfdz/opentripplanner:$OTP_VERSION" >> build/version.txt
 ---> Running in 1277d5873224
Removing intermediate container 1277d5873224
 ---> 9c1bc08518d0
Step 20/26 : RUN java -Xmx$MEMORY -jar otp-shaded.jar --build build/$ROUTER_NAME | tee build/build.log
 ---> Running in 360774d1bb42
10:54:12.498 ERROR (OTPMain.java:91) Parameter error: --build must be used with --save or --serve (or both) Use --help to see available options.
Removing intermediate container 360774d1bb42
 ---> a607008a8a51
Step 21/26 : RUN sh -c 'cd /opt/opentripplanner/build/; export VERSION=$(grep "version:" version.txt | cut -d" " -f2); zip graph-$ROUTER_NAME-$VERSION.zip $ROUTER_NAME/Graph.obj $ROUTER_NAME/router-*.json'
 ---> Running in b7738f288b86
    zip warning: name not matched: default/Graph.obj
  adding: default/router-config.json (deflated 46%)
Removing intermediate container b7738f288b86
 ---> 7a54806f47d8
Step 22/26 : RUN rm -rf /opt/opentripplanner/build/$ROUTER_NAME
 ---> Running in 7488dabfac79
Removing intermediate container 7488dabfac79
 ---> a40907a8f788
Step 23/26 : FROM nginx:alpine
alpine: Pulling from library/nginx
29291e31a76a: Pull complete 
e82f830de071: Pull complete 
d7c9fa7589ae: Pull complete 
3c1eaf69ff49: Pull complete 
bf2b3ee132db: Pull complete 
9a6ac07b84eb: Pull complete 
Digest: sha256:f01a7a92c6b7ab134b3a924a0c9b0b487bfb890d1563773fefc2229ce55e4ca3
Status: Downloaded newer image for nginx:alpine
 ---> 7ce0143dee37
Step 24/26 : RUN sed -i 'N; s/index  index.html index.htm;/autoindex on;/' /etc/nginx/conf.d/default.conf;     sed -i '/error_page/d' /etc/nginx/conf.d/default.conf
 ---> Running in 1853ccafac0c
Removing intermediate container 1853ccafac0c
 ---> 12d44b6e54d6
Step 25/26 : RUN rm /usr/share/nginx/html/*.html
 ---> Running in 60967fe9cf51
Removing intermediate container 60967fe9cf51
 ---> da6e0cbdff11
Step 26/26 : COPY --from=otp /opt/opentripplanner/build/ /usr/share/nginx/html/
 ---> bdf5ea46250a
Successfully built bdf5ea46250a
Successfully tagged 02-otp-and-graph-building_graph:latest
Creating 02-otp-and-graph-building_graph_1 ... done
Creating 02-otp-and-graph-building_opentripplanner_1 ... done
leonardehrenfried commented 3 years ago

We recently migrated to OTP2 but the tutorial isn't using it as of now. However, I did migrate it in a PR, that has not been merged yet: https://github.com/stadtnavi/stadtnavi-tutorial/pull/9

If you'd like to be the beta tester for that, go ahead!

dancesWithCycles commented 3 years ago

Hi @leonardehrenfried , I would love to be a beta tester. However, I have not used docker compose before. I am a bit confused about the memory config in the Dockerfile, the .env and the docker-compose.yml file. Is the memory usage/requirement at the end of the day 5 or 31? I think I need to figure that out as my dev environment does not has a big memory pool and already ran into a Exception in thread "main" java.lang.OutOfMemoryError: Java heap space exception. Do you know anything about that? Cheers!

leonardehrenfried commented 3 years ago

To build a graph of Baden-Württemberg you need a lot of memory, probably 16Gb but perhaps 8GB is enough.

We should probably change the default config.

You need a lot of memory when working with OTP graphs in general.

dancesWithCycles commented 3 years ago

Hi @leonardehrenfried, Thank you so much for the background. Cheers!