nabeelio / phpvms

virtual airline management
http://www.phpvms.net
Other
170 stars 140 forks source link

Flight Import Causes Exception (Failed Airport Lookup) #1414

Closed FatihKoz closed 1 year ago

FatihKoz commented 2 years ago

When importing flights via csv, if the airport code used in the file is wrong or it is not found by lookup below exception is returned

[ Side Issue: VA Central database needs to be updated, it misses some latest changes and new airports ]

[2022-02-23 19:48:16] prod.ERROR: VaCentral\Exceptions\HttpException: Client error: `GET https://api.vacentral.net/api/airports/UAIT` resulted in a `404 Not Found` response:
{"error":{"message":"Airport not found"}}
 in /vendor/nabeel/vacentral/src/VaCentral.php:180
[2022-02-23 19:48:16] prod.ERROR: App\Services\ImportExport\FlightImporter::processAirport(): Return value must be of type App\Models\Airport, null returned {"userId":3,"exception":"[object] (TypeError(code: 0): App\\Services\\ImportExport\\FlightImporter::processAirport(): Return value must be of type App\\Models\\Airport, null returned at /app/Services/ImportExport/FlightImporter.php:203)

Version Version 7.0.0-dev+220222.219a7c

To Reproduce

  1. Export your current flights
  2. Edit the csv, make a mistake in one of the airports
  3. Or use a newly opened airport code (like UAIT or ZMCK)
  4. Start the import with that file
  5. Check your error logs to see error details

Expected behavior If the airport is not found or the code is really wrong, import should continue without errors and inform the admin about skipped lines with something like Imported 127 flights, skipped 3 due to errors

cristianocasella commented 2 years ago

Hello everyone, just to let you know that we are experiencing this problem really often in our VA.

From some tests that I performed, comparing the same version of Flight Simulator, without any 3rd parties addition, the number of airports reported is quite different, and sometimes really "unreal".

The only workaround that is always working that I found is to use MakeRwys from FSUIPC to generate the files containing all the airport data and let the ACARS reading that file.

Being this setup not supported for MSFS2020 I have to select MSFSX first, when the ACARS return the error at that time I select MSFS2020, the airport list is not refreshed and it works.

A short fix could be also to allow the usage of MakeRwys for any simulator so that in case of failure we can use this path.

Let me know if I can help with additional information

FatihKoz commented 2 years ago

Hi,

This is not the place for your problem, techically this topic is for a problem within phpvms (completely different)

What you describe is a vmsAcars scanning problem and it is already known. For two weeks or so regular alpha versions going out to test it before release.

Safe flights

Sent from mobile device / Mobil cihaz ile gönderildi

13 Haz 2022 Pzt 18:49 tarihinde Cristiano Casella @.***> şunu yazdı:

Hello everyone, just to let you know that we are experiencing this problem really often in our VA.

From some tests that I performed, comparing the same version of Flight Simulator, without any 3rd parties addition, the number of airports reported is quite different, and sometimes really "unreal".

The only workaround that is always working that I found is to use MakeRwys from FSUIPC to generate the files containing all the airport data and let the ACARS reading that file.

Being this setup not supported for MSFS2020 I have to select MSFSX first, when the ACARS return the error at that time I select MSFS2020, the airport list is not refreshed and it works.

A short fix could be also to allow the usage of MakeRwys for any simulator so that in case of failure we can use this path.

Let me know if I can help with additional information

— Reply to this email directly, view it on GitHub https://github.com/nabeelio/phpvms/issues/1414#issuecomment-1154089761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARXKVMKMTAORY6KQSOPGX7TVO5KANANCNFSM5PFNE6VA . You are receiving this because you authored the thread.Message ID: @.***>

cristianocasella commented 2 years ago

my apologies for the noise, thanks for the feedback