Skip to content

SQL execution error #39

Closed
Closed

Description

@Kuailun

Hi Navigraph team,
Recently I got a strange error when querying my custom sql:

SELECT s.*,
       COALESCE(ea.magnetic_variation, pc.magnetic_variation) AS magnetic_variation
FROM tbl_pd_sids AS s
LEFT JOIN tbl_ea_enroute_waypoints AS ea
  ON s.waypoint_ref_table = 'EA'
 AND ea.area_code = s.area_code
 AND ea.waypoint_identifier = s.waypoint_identifier
LEFT JOIN tbl_pc_terminal_waypoints AS pc
  ON s.waypoint_ref_table = 'PC'
 AND pc.area_code = s.area_code
 AND pc.waypoint_identifier = s.waypoint_identifier
WHERE s.airport_identifier = ?1
  AND s.procedure_identifier = ?2
  AND (
        s.transition_identifier = ?3
     OR s.transition_identifier = SUBSTR(?3, 1, 4)
     OR (SUBSTR(s.transition_identifier, 1, 4) = SUBSTR(?3, 1, 4)
         AND SUBSTR(s.transition_identifier, 5, 1) = 'B')
      )
  AND s.route_type IN ('1', '4', 'F', 'T');

This works for me locally using pycharm.
?1 = "KBOS"
?2 = "BLZZR6"
?3 = "RW04R"

Image

However when running in MSFS, I got:
{"reports":[{"url":"https://o4506773193687040.ingest.us.sentry.io/api/4508886708846592/envelope/","auth":"Sentry sentry_key=72af7d1d0da0440631787c9b0db4f240, sentry_version=7, sentry_timestamp=1769721160.7298546, sentry_client=sentry.rust/0.37.0","data":"{"event_id":"1222ce9e-3568-469b-8819-6de4a3329542"}\n{"type":"event","length":1678}\n{"event_id":"1222ce9e3568469b88196de4a3329542","platform":"native","timestamp":1769721160.7298546,"release":"msfs-navigation-data-interface@1.2.2","environment":"production","user":{"id":"3d8ca941-5e27-41f9-8f87-8644f9586973"},"contexts":{"Interface Function":{"type":"unknown","data":{"params":["KBOS","BLZZR6","RW04R"],"sql":"SELECT s.*, COALESCE(ea.magnetic_variation, pc.magnetic_variation) AS magnetic_variation FROM tbl_pd_sids AS s LEFT JOIN tbl_ea_enroute_waypoints AS ea ON s.waypoint_ref_table = 'EA' AND ea.area_code = s.area_code AND ea.waypoint_identifier = s.waypoint_identifier LEFT JOIN tbl_pc_terminal_waypoints AS pc ON s.waypoint_ref_table = 'PC' AND pc.area_code = s.area_code AND pc.waypoint_identifier = s.waypoint_identifier WHERE s.airport_identifier = ?1 AND s.procedure_identifier = ?2 AND ( s.transition_identifier = ?3 OR s.transition_identifier = SUBSTR(?3, 1, 4) OR (SUBSTR(s.transition_identifier, 1, 4) = SUBSTR(?3, 1, 4) AND SUBSTR(s.transition_identifier, 5, 1) = 'B') ) AND s.route_type IN ('1', '4', 'F', 'T'); "},"function":"ExecuteSQLQuery","id":"1017"}},"exception":{"values":[{"type":"Error","value":"Error code 6410: VFS is unable to determine a suitable directory for temporary files"},{"type":"SqliteFailure","value":"disk I/O error"}]},"tags":{"built_at":"2025-11-24T11:47:33.214976883Z","developer":"Navigraph","git_dirty":"false","git_sha":"85953c6e58769e32dfcb302306d63a83ed9143a1","product":"FYCYC C919X"},"sdk":{"name":"sentry.rust","version":"0.37.0","integrations":["attach-stacktrace","panic","process-stacktrace"],"packages":[{"name":"cargo:sentry","version":"0.37.0"}]}}\n"}]}

Can you help? Thanks!

Activity

  1. pepperoni505 commented on Jan 29, 2026

    @pepperoni505
    Contributor

    Hi @Kuailun ,

    Are you getting that response from the CommBus/TS wrapper?

  2. Kuailun commented on Jan 29, 2026

    @Kuailun
    Author

    I got this in work/ng_sentry.json.
    In MSFS, I just got: disk I/O error

  3. pepperoni505 commented on Jan 29, 2026

    @pepperoni505
    Contributor

    Ah, ok. That file is used to keep track of any errors the module comes across to report to Sentry, where we can track potential issues.

    If you run the query again do you get the same error?

  4. Kuailun commented on Jan 29, 2026

    @Kuailun
    Author

    yeap. I saw this and feel this is very useful to report the issue.
    I constantly have this issue whenever I execute the same query.

  5. pepperoni505 commented on Jan 30, 2026

    @pepperoni505
    Contributor

    I was able to reproduce and came up with a fix in #40. However, I will warn you that even though it works now, your query is quite slow (freezing my sim for a few seconds). You should consider simplifying it, or finding some way to reduce the impact on users (i.e. running it at non-critical points in the flight).

  6. Kuailun commented on Jan 30, 2026

    @Kuailun
    Author

    Cool! Thanks for letting me know! Will take this into consideration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions