MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
284 stars 100 forks source link

Including networks, route_networks files causing false positive errors #1756

Closed evansiroky closed 1 month ago

evansiroky commented 4 months ago

Describe the bug

The GTFS Schedule validator flags a false positive foreign_key_violation error upon validating a GTFS feed that includes the networks.txt and route_networks.txt files.

Steps/Code to Reproduce

Try to validate the following minimally reproducable GTFS feed here: test GTFS.zip.

Expected Results

No errors are raised.

Actual Results

A single foreign_key_violation error is raised.

Screenshots

No response

Files used

No response

Validator version

5.0.1

Operating system

Web-based validator tool.

Java version

No response

Additional notes

No response

qcdyx commented 4 months ago

Hello @evansiroky thanks for reporting this issue. If you take a closer look at the description of the foreign_key_violation notice, you can find it's not about networks.txt and route_networks.txt. It says that fare_leg_rules.txt has a network_id "Bus", but not found in the parent file routes.txt which contains route_ids 1, 1, 3. cc @tzujenchanmbd

image
evansiroky commented 4 months ago

Correct, I believe that this is a false positive error. The spec for routes.network_id says that this column is:

Conditionally Forbidden... if the route_networks.txt file exists.

Since the provided example feed contains the route_networks.txt file, I believe that the routes.network_id should not be set. Therefore, I believe the example feed is spec-compliant and the validator is outputting a false-positive error.

qcdyx commented 4 months ago

Ok, I see what you mean. https://github.com/MobilityData/gtfs-validator/issues/1764 cc @tzujenchanmbd

qcdyx commented 3 months ago

Close this issue since it's a duplicate of #1764

emmambd commented 1 month ago

Hi @evansiroky! Thanks for flagging this issue - it's resolved in #1764 and will be a part of our next validator release.