-
Notifications
You must be signed in to change notification settings - Fork 162
Description
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:
- Create a csv file with LTCU airport either as dep or arr
- Import that file
- See the error
Expected behavior
Fake ID's of external sources or non-proper ICAO codes should not be used