gis-ops / docker-valhalla

This is our flexible Docker repository for the Valhalla routing engine
MIT License
228 stars 69 forks source link

Transit building fails #157

Open Sunraj751 opened 1 month ago

Sunraj751 commented 1 month ago

Hi I am trying to build transit tiles using the docker image, but i keep getting errors. The only difference few difference I see is with the file name:

  1. The download folder contained a file called calendar_dates.txt, and valhalla is looking for calendar.txt

I am downloading the GTFS files from the links below:

  1. GRT = https://www.grt.ca/en/about-grt/open-data.aspx
  2. Guelph = http://data.open.guelph.ca/dataset/guelph-transit-gtfs-data/resource/0323da5c-1084-447e-a62e-2bda80e141b0
  3. GO = https://www.gotransit.com/en/partner-with-us/software-developers

Error Log:

566.5 ========================== 566.5 = Building transit tiles = 566.5 ========================== 566.5 566.6 2024/05/21 11:13:30.786527 [INFO] Running valhalla_ingest_transit with 12 thread(s). 566.6 2024/05/21 11:13:30.786673 [INFO] Tiling GTFS Feeds 566.6 2024/05/21 11:13:30.788095 [INFO] Loading GRT 570.4 2024/05/21 11:13:34.607172 [INFO] Done loading, now parsing GRT 598.1 2024/05/21 11:14:02.285925 [INFO] Done parsing 4 transit tiles for GTFS feed GRT 598.1 2024/05/21 11:14:02.295184 [INFO] Loading guelph_Transit 598.1 2024/05/21 11:14:02.295362 [ERROR] Couldn't find a required file for feed guelph_Transit: File agency.txt could not be opened 598.1 2024/05/21 11:14:02.295449 [INFO] Loading GO 598.1 2024/05/21 11:14:02.295463 [ERROR] Couldn't find a required file for feed GO: File agency.txt could not be opened 598.1 2024/05/21 11:14:02.299563 [INFO] Writing 4 transit pbf tiles with 12 threads... 602.6 2024/05/21 11:14:06.829888 [ERROR] Feed GRT, trip ID3497981 can't be found or has no calendar.txt entry, skipping... 602.6 2024/05/21 11:14:06.830147 [ERROR] Feed GRT, trip ID3497979 can't be found or has no calendar.txt entry, skipping... 602.6 2024/05/21 11:14:06.830278 [ERROR] Feed GRT, trip ID3497977 can't be found or has no calendar.txt entry, skipping.......... GIVES SIMILAR ISSUE FOR ALL THE TRIP IDs

606.9 2024/05/21 11:14:10.943323 [INFO] Finished 606.9 2024/05/21 11:14:10.943527 [INFO] Stitching 0 transit tiles with 12 threads... 606.9 2024/05/21 11:14:10.945707 [INFO] Finished 606.9 2024/05/21 11:14:11.108771 [INFO] Running valhalla_convert_transit with 12 thread(s). 606.9 2024/05/21 11:14:11.109382 [INFO] Building transit network. 606.9 2024/05/21 11:14:11.109490 [INFO] No transit tiles found. Transit will not be added. 606.9 2024/05/21 11:14:11.110006 [INFO] Validating transit network. 606.9 2024/05/21 11:14:11.110456 [INFO] Transit directory not found. Transit will not be added. ERROR: process "/bin/sh -c /valhalla/scripts/run.sh build_tiles" did not complete successfully: exit code: 1

[valhalla-transit builder 4/5] RUN /valhalla/scripts/run.sh build_tiles: 606.9 2024/05/21 11:14:10.916379 [ERROR] Feed GRT, trip ID3492155 can't be found or has no calendar.txt entry, skipping... 606.9 2024/05/21 11:14:10.916383 [ERROR] Feed GRT, trip ID3498723 can't be found or has no calendar.txt entry, skipping... 606.9 2024/05/21 11:14:10.943323 [INFO] Finished 606.9 2024/05/21 11:14:10.943527 [INFO] Stitching 0 transit tiles with 12 threads... 606.9 2024/05/21 11:14:10.945707 [INFO] Finished 606.9 2024/05/21 11:14:11.108771 [INFO] Running valhalla_convert_transit with 12 thread(s). 606.9 2024/05/21 11:14:11.109382 [INFO] Building transit network. 606.9 2024/05/21 11:14:11.109490 [INFO] No transit tiles found. Transit will not be added. 606.9 2024/05/21 11:14:11.110006 [INFO] Validating transit network. 606.9 2024/05/21 11:14:11.110456 [INFO] Transit directory not found. Transit will not be added. failed to solve: process "/bin/sh -c /valhalla/scripts/run.sh build_tiles" did not complete successfully: exit code: 1

chrstnbwnkl commented 1 month ago

As you can read here calendar_dates.txt and calendar.txt are not the same file. From the logs it looks like Valhalla wasn't able to find a lot of the required files, can you post your docker compose file and the directory tree of your gtfs folder?

Sunraj751 commented 1 month ago

Docker command: docker run --rm -p 8002:8002 \ -v $PWD/gtfs_feeds:/gtfs_feeds \ -e build_transit=True -e tile_urls=https://download.geofabrik.de/north-america/canada/ontario-latest.osm.pbf --name valhalla-local ghcr.io/gis-ops/docker-valhalla/valhalla

Docker compose & output:

valhalla:
    read_only: false
    image: valhalla-transit-bundle:latest
    build:
      context: .
      dockerfile: Dockerfile
      args:
        - build_transit=True
        - tile_urls=https://download.geofabrik.de/north-america/canada/ontario-latest.osm.pbf
    container_name: valhalla-transit
    deploy:
      mode: global
    volumes:
      - ./gtfs_feeds:/gtfs_feeds
    expose:
      - "8002"
    ports:
      - "8002:8002"
    restart: always
    networks:
      - local-network

And here's the file structure: Screenshot 2024-05-21 at 7 22 03 PM

Sunraj751 commented 1 month ago

@chrstnbwnkl just adding to this, I also get the following error (agency.txt not found), but as you can see in my previous screenshot agency.txt file does exist in all the folders, and does have data in it: image

chrstnbwnkl commented 1 month ago

Have you bashed in the container and verified the feed directories are mapped correctly? Sorry, this is a bit difficult to debug from just that information. If it still does not work, maybe try feeds one by one to see if multiple feeds break the ingestion.