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 5: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 8: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 5:04 pm

Re: HELP HELP HELP!

Postby elgaton » Mon Jan 09, 2017 7: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: 1107
Joined: Tue Mar 19, 2013 4: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 10:53 pm

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

Re: HELP HELP HELP!

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

elgaton wrote in Mon Jan 09, 2017 7: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: 219
Joined: Sat Oct 25, 2014 8: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 6: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)
Johan G
Moderator
 
Posts: 5437
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: sql: attempt to write a read only database

Postby randomperson123 » Fri Jan 13, 2017 1: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 5:04 pm

Re: sql: attempt to write a read only database

Postby zakalawe » Wed Jan 25, 2017 2: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: 1152
Joined: Sat Jul 19, 2008 4: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 2: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 2:44 pm

Re: sql: attempt to write a read only database

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

jchiasson wrote in Fri Feb 03, 2017 2: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: 1152
Joined: Sat Jul 19, 2008 4: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 12: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: 557
Joined: Sat Nov 01, 2014 1: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 12: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: 1648
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: sql: attempt to write a read only database

Postby randomperson123 » Sun Mar 05, 2017 1: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 5:04 pm


Return to Windows

Who is online

Users browsing this forum: No registered users and 0 guests