Board index FlightGear Support Installation Windows

sql: attempt to write a read only database

Installing FlightGear, scenery, aircraft etc. on Windows.

sql: attempt to write a read only database

Postby randomperson123 » Mon Jan 09, 2017 6:56 pm

I just installed flightgear 2016.4.4 from 4.3 and copied all my aircraft and stuff but I get a sql: attempt to write a read only database whenever I try to fly ANY aircraft! help!
Last edited by Johan G on Mon Jan 09, 2017 9:57 pm, edited 1 time in total.
Reason: Changing the the title to something more meaningful than "HELP HELP HELP!" ;-)
Villagers.
randomperson123
 
Posts: 29
Joined: Sat Dec 10, 2016 6:04 pm

Re: HELP HELP HELP!

Postby elgaton » Mon Jan 09, 2017 8:52 pm

It's a known bug, just:
  • press Win+R to open the Run window, type %APPDATA%, click OK;
  • delete the flightgear.org folder, make sure not to delete/move other ones.
This will reset all your FlightGear preferences, but will fix the issue.
NIATCA 2nd admin, regular ATC at LIPX and creator of the LIPX custom scenery
elgaton
 
Posts: 1106
Joined: Tue Mar 19, 2013 5:58 pm
Callsign: I-ELGA/LIPX_TW
Version: Git
OS: Windows + Arch Linux

Re: sql: attempt to write a read only database

Postby randomperson123 » Mon Jan 09, 2017 11:53 pm

yea... I just renamed it and it worked!
Villagers.
randomperson123
 
Posts: 29
Joined: Sat Dec 10, 2016 6:04 pm

Re: HELP HELP HELP!

Postby jsb » Tue Jan 10, 2017 8:20 am

elgaton wrote in Mon Jan 09, 2017 8:52 pm:It's a known bug, just:
  • press Win+R to open the Run window, type %APPDATA%, click OK;
  • delete the flightgear.org folder, make sure not to delete/move other ones.
This will reset all your FlightGear preferences, but will fix the issue.


WARNING: Deleting the whole folder is a bad idea! It contains your configurations for e.g. joystick/yoke etc, any aircraft you have used with flightgear and the fgfs.log where flightgear logs the debug and error messages of the last run.

You are probably fine just deleting navdata*.cache
jsb
 
Posts: 285
Joined: Sat Oct 25, 2014 9:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: sql: attempt to write a read only database

Postby Johan G » Tue Jan 10, 2017 7:15 pm

@randomperson123: Some background info that might help understand the problem:

The now infamous SQLite database is a cache with navigation data, the navdata cache. Prior to that this cache was added, FlightGear would scan all installed scenery and some data files every time it was started. On some machines this could take several minutes. After this cache was added this scan only happens when there have been changes made to the installed scenery.

For some reason this cache database often get corrupted on Windows machines, and I would guess the exact reason still is not known. As Jsb mentioned, when it get corrupted and FlightGear refuses to start, you only need to delete the cache file itself.

For more details on the cache see the FlightGear wiki article: Navdata cache (perm)
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: sql: attempt to write a read only database

Postby randomperson123 » Fri Jan 13, 2017 2:16 am

Yea... I looked it up and made a backup (renamed the folder) and since i didn't have many settings i just reconfigured. I tried deleting the navdata cache before, but that didn't work, so yea. Everything works fine now!
Villagers.
randomperson123
 
Posts: 29
Joined: Sat Dec 10, 2016 6:04 pm

Re: sql: attempt to write a read only database

Postby zakalawe » Wed Jan 25, 2017 3:24 pm

Do you still have the original copy you renamed? I would like to fix the issue with the DB appearing read-only but so far no one has been able to provide me with a copy of their files (the problematic ones)
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: sql: attempt to write a read only database

Postby jchiasson » Fri Feb 03, 2017 3:48 pm

I've been fighting this bug for a couple days now. I agree it seems related to crashes corrupting the database. I suggest adding to the wiki page the %APPDATA% workaround, since I was unable to locate navdata*.cache with a windows file search. Apparently windows hides the %APPDATA% folder from searches. Until I ran across this post, I was unable to start the sim. If a list of the needed files is posted, I will try to upload mine.
jchiasson
 
Posts: 1
Joined: Fri Feb 03, 2017 3:44 pm

Re: sql: attempt to write a read only database

Postby zakalawe » Fri Feb 03, 2017 5:20 pm

jchiasson wrote in Fri Feb 03, 2017 3:48 pm: If a list of the needed files is posted, I will try to upload mine.
A copy of your navdata.cache would be appreciated (the broken one), since of the two copies I was sent so far, neither were corrupted - they both passed the SQLite integrity check.

This has led me to think the issue is permissions, not corruption of the DB. Of course, there could be multiple issues. If you can find the suspect navcache, please upload it to: https://swanson.kdab.com/owncloud/index.php/s/P0DMwvV6TdQR5CW
and let me know.
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: sql: attempt to write a read only database

Postby rominet » Sat Mar 04, 2017 1:17 pm

To the original poster: FlightGear 2017.1.2 contains a fix which is likely to correct this problem. Feel free to try it and report here.

Regards
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: sql: attempt to write a read only database

Postby bugman » Sat Mar 04, 2017 1:46 pm

That is correct. For the record: This issue is due to a stale fgfs.pid file in $FG_HOME on certain MS Windows systems which makes $FG_HOME partly read-only, blocking TerraSync from downloading and disallowing the saving of the new, version specific navigation cache SQL database after an upgrade (hence FG cannot start). This long standing bug has been permanently fixed in the latest 2017.1.2 release.

Regards,
Edward
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next

Re: sql: attempt to write a read only database

Postby randomperson123 » Sun Mar 05, 2017 2:25 pm

that's great! thanks! As for my broken folders, they got destroyed on my old and fried HDD. sorry 'bout that!
Villagers.
randomperson123
 
Posts: 29
Joined: Sat Dec 10, 2016 6:04 pm


Return to Windows

Who is online

Users browsing this forum: No registered users and 2 guests