albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.28k stars 164 forks source link

'Caught exception in file' on Take Off #1068

Closed trampyjoe closed 8 months ago

trampyjoe commented 9 months ago

Have had a search through and not found the exact same problem from other bug reports (a few similar).

Randomly on take off I get the following pop-up error Caught exception in file "..\atools\src\gui\application.cpp" line 83. database is locked Unable to commit transaction. SqlDatabase::transaction() on invalid database. If the problem persists or occurs during startup delete all settings and database files of Little Navmap and try again. If you wish to report this error attach the log and configuration files to your report, add all other available information and send it to the contact address below.

Can only duplicate on certain flights (this evenings one was duplicateable so am report it now).

No scenery addons Aircraft livery addon (https://flightsim.to/file/29684/xcub-bush-divers-series-liveries) Windows 10 64 MSFS 1.35.21.0 LNM 2.8.12 64-bit

abarthel-little_navmap.log little_navmap.txt

albar965 commented 9 months ago

Thank you for the log and the details. It seems to be flooded with errors from the LNM web server. What happens if you run LNM without the web server? Do you use a MSFS tool which accesses the LNM web-server?

I'll try here with web enabled.

trampyjoe commented 9 months ago

Yes, I use the webserver occasionally. Will test without the webserver running tomorrow. Cheers :)

u-an-i commented 9 months ago

@albar965 the log entry i guess which is the flooding is a warning about distance not delivered by the web ui.
It is triggered by this code:
https://github.com/albar965/littlenavmap/blob/6e1e71cf45b376407041bd39cab5056ffe38af8d/src/web/requesthandler.cpp#L212

The web ui by default does not deliver a distance. The distance is inferred from the starting distance and the number of zoom in / out commands on the mapPaintWidget.

The web ui CAN deliver a distance to force overriding mapPaintWidget's "internal zoom state(s) (corrected zoom and requested zoom)" (which are saved to the session), this is made use of in the web plugin autozoom.

Log entries timestamp indicates auto refresh has been enabled (at the default refresh interval of 1s).

I would be intrigued whether a compile of LNM / atools with Debugging (output) disabled results in a faster / smoother globe rendering. (I am too wary of setting up LNM for compilation again to test this myself now.) (How about releasing a non-debug build as well as a debug-build for those who like to pinpoint an issue? (You could offer to download the debug build from the non-debug build when the log file is requested from the toolbar menu)).

u-an-i commented 9 months ago

@albar965 I omitted the contains check in asFloat in favor of catching this case by QByteArrays toFloat.
If the !ok case tests for the wrong value in question being the QMultiMap<QByteArray, QByteArray> params default constructed value returned when the key requested with is not contained (the dcv appears to be the empty string), the case of !contains can be distinguished from a "real" invalid float and debug text output only in the latter case. This approach can be applied to the other asXXX methods as well.

albar965 commented 9 months ago

Yes, I use the webserver occasionally. Will test without the webserver running tomorrow. Cheers :)

@trampyjoe : Not sure why this happens. I remember to have a similar bug fixed some time ago. I'll do more testing. The only reason to write to a database (the error is caused by this) is either modification of an userpoint or a logbook entry. The latter one can happen on landing or takeoff. Did it happen while landing or taking off? I suppose you run only one LNM instance, right?

@u-an-i : Thank you for the hint. I'll reduce logging and have a look at the distance conversion. There should be no debug log for each request. Debug is on per default as configured in logging.cfg. I know debugging needs some cleanup. Especially regarding info/debug levels.

trampyjoe commented 9 months ago

Just loaded up exactly as yesterday and tried to replicate the error before trying without webserver running. Could not replicate the error.

Error happened taking off, and every time before has been during take off. I've only just noticed, now that I'm paying attention, that the flights have not been logged (obviously!). I only run one instance of LNM

Will monitor during future flights and will report back with logs next time I get the error.

albar965 commented 9 months ago

@trampyjoe One thing you can try: Go to the LNM logbook, right click and select Add logbook entry. Leave all as it is in the dialog and click Ok. You have a permission problem on the database if this causes the exception. Means, that the file is probably not writable by LNM.

trampyjoe commented 9 months ago

Go to the LNM logbook, right click and select Add logbook entry. Leave all as it is in the dialog and click Ok. You have a permission problem on the database if this causes the exception. Means, that the file is probably not writable by LNM.

No exception when creating a new logbook entry.

albar965 commented 9 months ago

No exception when creating a new logbook entry.

Good. This means the file is writeable. I'll do more testing here but could not reproduce it yet.

albar965 commented 8 months ago

Closing for now. Feel free to reopen if it appears again.