Skip to content

[Bug] 119 duplicate IATA codes in the freshly seeded airport catalogue #240

Description

@Abrechen2

Found during a fresh-install walkthrough of 2.5.0-rc.5, measured straight after the first-boot seed completed.

What happens

SELECT count(*) FROM (
  SELECT iata FROM airports
  WHERE iata IS NOT NULL AND iata <> ''
  GROUP BY iata HAVING count(*) > 1
) x;
--> 119

Out of 18,609 seeded airports (all of which do carry a timezone — that part is healthy), 119 IATA codes are held by more than one row. A concrete example: MUC exists both as Munich Airport and as Flughafen München-Riem, the latter closed since 1992.

Why it matters

IATA is what users type and what imports match on. Where a code is ambiguous, whichever row wins the lookup decides the airport's coordinates, country and timezone — so a flight can silently land at a closed airfield, with the wrong country feeding the country statistics and the wrong timezone feeding the displayed times.

This is the same family as the already-fixed #169 (a cruise stop resolving to the wrong country), and 2.5.0 added the guard that a closed airfield is never picked as the nearest airport — but direct IATA lookup still has 119 ambiguous codes to choose from.

Steps to reproduce

  1. Fresh install; wait for seed_airports_complete in the log.
  2. Run the query above.
  3. SELECT iata, name, is_closed FROM airports WHERE iata = 'MUC'; shows the pair.

Worth deciding

Whether the seed should keep placeholder/closed entries that collide with a live code at all, or whether lookup should deterministically prefer the open airport. Either way the ambiguity should not be left to row order.

Version

2.5.0-rc.5 (fresh install, seed completed: 18,609 airports)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions