Skip to content

Airport Lookup returns Non-ICAO codes #1996

@FatihKoz

Description

@FatihKoz

During flight plan import via csv file, airport lookup returns some internal data (from the source directly) as "ICAO" code of the airport and a new airport gets created with that "ID", and when another lookup is done while processing next/another row with the same airport, import fails with server error.

SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'TR-0017' for key 'PRIMARY' (Connection: mysql, SQL: insert into `airports` (`id`, `icao`, `iata`, `name`, `country`, `timezone`, `lat`, `lon`, `region`, `elevation`, `location`) values (TR-0017, TR-0017, BGG, Bingöl Airport, TR, , 38.860131, 40.594489, TR-12, 3506, Bingöl)) {"userId":2,"exception":"[object] (Illuminate\\Database\\UniqueConstraintViolationException(code: 23000): SQLSTATE: Integrity constraint violation: 1062 Duplicate entry 'TR-0017' for key 'PRIMARY' (Connection: mysql, SQL: insert into `airports` (`id`, `icao`, `iata`, `name`, `country`, `timezone`, `lat`, `lon`, `region`, `elevation`, `location`) values (TR-0017, TR-0017, BGG, Bingöl Airport, TR, , 38.860131, 40.594489, TR-12, 3506, Bingöl))

Here in this example, lookup is done for LTCU , which is BGG / Bingol Airport, but the lookup returns TR-0017 instead. As we look for LTCU in our records to trigger a lookup it is done again.

So either the source should be fixed or we need to have something specific to fix this kind of "external source" errors.

Version
7.0.3

To Reproduce
Steps to reproduce the behavior:

  1. Create a csv file with LTCU airport either as dep or arr
  2. Import that file
  3. See the error

Expected behavior
Fake ID's of external sources or non-proper ICAO codes should not be used

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions