GeezerVison is showing github.com — [Bug]: get database table is locked error when opening some dbs · Issue #3714 · sqlitebrowser/sqlitebrowser
[Bug]: get database table is locked error when opening some dbs #3714DescriptionWhat did you do?
When opening through UI or double clicking the db file to open it, I got this error message:
executeSQL: "database table is locked (SELECT type,name,sql,tbl_name FROM \"main\".sqlite_master;)" "could not get list of db objects: database table is locked"
What did you expect to see?
The exact same files will open with version 3.12.2 with no problem at all.
A very simple db to reproduce the issue is zipped here
What did you see instead?
An error message pops up: executeSQL: "database table is locked (SELECT type,name,sql,tbl_name FROM \"main\".sqlite_master;)" "could not get list of db objects: database table is locked"
DB4S Version
3.13.0
What OS are you seeing the problem on?
Windows
OS version
Windows 11
Relevant log output
No response
Prevention against duplicate issues
- I have searched for similar issues
Reacted by Jing Xia, Dmitry Vornychev and Ulysses Zhan ActivityTafaza commented on Sep 10, 2024 After reloading db structure with Refresh button the db is read correctly.
Writing some changes, closing and reopening it, I still get the error. deitry commented on Oct 8, 2024 Seems to be the duplicate of #3636 LaurentGrenet commented on Oct 13, 2024 I have exactly the same issue.
I specify following points :
- Error does not occur with all existing databases, but if it occurs with a given database, it occurs repetitively with this database, even if it has been updated in the meanwhile
- Error NEVER occurs with previous version of DbBrowserForSql (3.12.2) and database that do not open in 3.13 do open in 3.12.2
- As mentioned by @tazafa above, after reloading db structure with Refresh button the db is read correctly.
- I specify that (contrary to what seems to be said about [Bug]: Unable to open databases with encoding UTF-16le #3636, supposed to be duplicate of this one ), this error do not occur when creating a database, but rather when opening an existing database
- Due to the fact that "refreshing" the database allow to use it, this bug is not fully blocking, but nevertheless really annoying....
justinclift commented on Oct 13, 2024 @mgrojo @lucydodo This one sounds tricky to investigate? What do you guys reckon? lucydodo commented on Oct 14, 2024 If I recall correctly, this issue was resolved some time ago.
I'll try to reproduce the issue later tonight and get back to you with a definitive answer. LaurentGrenet commented on Oct 14, 2024 Please find here attached another example of such a database that opens correctly in 3.12.2 and fails in 3.13
stickies.zip LaurentGrenet commented on Oct 21, 2024
If I recall correctly, this issue was resolved some time ago. I'll try to reproduce the issue later tonight and get back to you with a definitive answer.
Hello, @lucydodo , any news ? mgrojo commented on Oct 21, 2024
Please find here attached another example of such a database that opens correctly in 3.12.2 and fails in 3.13 stickies.zip
I wasn't able to reproduce the problem on Linux. Strange issue. Does it happen to you if you unzip that file on a different folder and open from there? LaurentGrenet commented on Oct 22, 2024 Yes, the issue is there whatever the folder where the database is stored.
This remains true with recent 3.13.1 version, on both W10 Pro 22H2 (latest updates done) and also on W11 24H2.
But on your own, are you sure you are using 3.13 version in your Linux environment ? I'm asking the question, because I wanted to do a test on LinuxMint.... and in such an environment, it is still the 3.12.2 version that is installed.... The 3.13 is not (yet) available.... LaurentGrenet commented on Oct 22, 2024 I have created a new VirtualBox VM with the latest rev of LinuxMint.
With this version, I'm able to install a more recent version of sqlitebrowser. I'm even a little bit surprised, since this version describes itself as 3.13.99, dated 2024 July 23 ! Strange....
I did install as described in https://sqlitebrowser.org/dl/ for "Ubuntu and derivatives"
But indeed, with this version, on a LinuxMint 22 xfce 64 bits, opening of the two database supposed to be problematic (and actually problematic under Windows 10 or 11) is also problematic !
There is not the error message that we get in Windows environment, but nevertheless there is no access to tables and so forth, until we use the "Refresh" button ! So not "exactly" the same behavior than under windows, but nevertheless very very similar !
It would be great that someone in dev team has a look on this issue, and finds a fix !
PS : The same issue comes with the database of Ditto application justinclift commented on Oct 23, 2024
this version describes itself as 3.13.99
The .99 thing is what we have in our development source code (not the official releases), specifically so we can get an idea if someone's running an official release or not. 😄
With the version of our application that you installed, there are a few possibilities. It's a possibility that you've (somehow?) enabled a repository that contains pre-release builds. It's also possible that there's something not quite right with the builds created for Linux Mint.
Either of those could result in you having a build with the .99 string in it's name. Of course, it could be something else happening of a more unexpected nature as well. 😉
With the above in mind, your best bet is to probably use the .AppImage build here instead: https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/v3.13.1
ie: remove your current version of our application, then install the .AppImage from the 3.13.1 release. That (in theory) should just need downloading and enabling the "execute bit" afterwards so you can double click on it to run. LaurentGrenet commented on Oct 23, 2024 I wanted to do so (downlaod the .AppImage build), but systematically, download fails after downloading ~25 to 30 MB...
It's the reason why I used the way (described in sqlitebrowser.com website) of the PPA provided by @deepsidhu1313.
This was downloading from the https://sqlitebrowser.com/dl page. On the other hand, from the https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/v3.13.1, it works. I just downloaded it after removing the 3.13.99 rev.
And with this .AppImage version (3.13.1), we have exactly the same issue than with the 3.13.99 rev....
Actually, what is important (and the only thing that has to be fixed !) is not the fact that SqliteBrowser describes itself as 3.13.99 (even less important after your explanations),
but rather the fact that since 13.3.x versions, SqliteBrowser fails opening a lot of databases it used to open succesfully until 3.12.2 rev ! And this either under Win10, Win11 or LinuxMint !
I do not know the "common factor" of these databases, but it's (at least) the case of database generated by Stickies application (windows application of ZhornSoftware.co.uk), and/or Ditto application (https://ditto-cp.sourceforge.io/).
And also the MyDb.db provided by @Tafaza at the beginning of this thread. Maybe @Tafaza could explain how he generated this database....
Yes, these two applications (Stickies and Ditto) are windows application, and at the beginning, I raised the problem for the Winwows version of SqliteBrowser. But I ran also tests with LinuxMint, because @mgrojo told above he was not able to reproduce the problem on Linux. My assumption is that he actually DID reproduce the problem, but didn't see it because under Linux, there is not the error message at dabase opening.... but even without error message, opening fails until we explicitely click on "Refresh" button. At least under LinuxMint, but I would bet a lot that it's the same whatever linux environment... Tafaza commented on Oct 23, 2024
Maybe @Tafaza could explain how he generated this database....
I have another db that has the issue. Those are 2 dbs created many (like 15/12) years ago and probably converted from access db.
This is the second one that has been cleared of all sensitive data.
EDIT: I tried to generate another db with this issue given this information on how it was generated, but I did not come up with anything relevant. mgrojo commented on Oct 23, 2024
But I ran also tests with LinuxMint, because @mgrojo told above he was not able to reproduce the problem on Linux. My assumption is that he actually DID reproduce the problem, but didn't see it because under Linux, there is not the error message at dabase opening....
No, I did not reproduce it with my development build of the master branch on Ubuntu Linux 22.04. It is based on 51c37de
I tried to use the AppImage for that commit, but it fails to start (that's a different problem that we should check; we are building on a too new system for AppImage).
/tmp/.mount_DB.BroDqcyJ0/AppRun.wrapped: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /tmp/.mount_DB.BroDqcyJ0/AppRun.wrapped)
/tmp/.mount_DB.BroDqcyJ0/AppRun.wrapped: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /tmp/.mount_DB.BroDqcyJ0/AppRun.wrapped)
Regarding the released versions, I was able to reproduce it with AppImage for v3.11.1 but not for v3.11.0.
I would say it is always there, but seems to be a race condition and depends on particular hardware/platform to be manifested.
I think it might be related to our solution for #3706, but it's not easy to confirm when your development build is not affected... justinclift commented on Oct 24, 2024
I was able to reproduce it with AppImage for v3.11.1 but not for v3.11.0.
Note the typo in the version numbers of the text there. Those should be 3.13.1 and 3.13.0, not 3.11.x. The links are correct though. 😄 LaurentGrenet commented on Nov 6, 2024 In the meantime (before getting a bug free version of SQLite), wouldn't it be possible to recompile the latest version of DB Browser with the version of SQLite that was used with DB Browser rev 3.12.2 (ie. SQLite 3.35.5), since the issue were not there with this version of SQLite.
This would allow us to get immediately benefit of new features of DB Browser, without needing to wait for fix from SQLite.... lucydodo commented on Nov 7, 2024 Yes, I can do that, but I might need to look further into building for each platform in the SQLite master branch.
I'll use this weekend to prepare. justinclift commented on Nov 8, 2024
SQLite 3.35.5
Hopefully that's not the latest version of SQLite without this bug, as that version is so old that it doesn't support STRICT Tables which a lot of people use.
Support for STRICT Tables arrived in SQLite 3.37.0, if that helps. 😄 lucydodo commented on Nov 11, 2024 Unfortunately, I tried it this weekend but failed to build it. I will try again during this week. :( lucydodo commented on Nov 14, 2024 Thank you for waiting. A temporary build using the latest SQLite is now ready: https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/issue/3714
Please note that the SQLite version is displayed as 3.48.0, but it differs from the actual 3.48.0 version that will be released in the future. If you have any other comments or quetions, feel free to le me know at any time. Thank you. Reacted by Tafaza Reacted by Justin Clift LaurentGrenet commented on Nov 14, 2024 I confirm it works fine (at least this bug is fixed...), at least in W10 environment.
Thank you so much for this build.
Nevertheless, one important question : Is it safe to use this build, based on a non official version of SQLite, or is it better to wait for future official release ? lucydodo commented on Nov 15, 2024 @LaurentGrenet Thanks for confirmation. To be honest, I'm not entirely sure about that. Of course, the SQLite team is made up highly capable inviduals, so there likely won't be any major issue. However, just in case, I would recommend backing up the file beforehand when working on an important database. justinclift commented on Nov 26, 2024 UlyssesZh commented on Apr 28, 2025 I met with the problem. The easiest way to work around this is to just hit F5. I can also fix the db by dumping it:
echo ".dump" | sqlite3 old.db | sqlite3 new.db XedinUnknown commented on Sep 24, 2025 Encountered this problem.
echo ".dump" | sqlite3 old.db | sqlite3 new.db
The above copies the DB, but when I try to open it with the DB browser I get the same error:
Could not open database file.
Reason: database is locked
In fact, even if I try to import the dump into the DB via this very tool, it gives the same "locked" error.
DB Browser for SQLite Version 3.13.1
Last commit hash when built: 5d84f53
Built for x86_64-little_endian-llp64, running on x86_64
Qt Version 5.15.2
SQLite Version 3.46.1.
chrisjlocke commented on Sep 24, 2025
Encountered this problem
On what OS are you using?
Where is the database - on a local folder, or network? In a standard place, or in program files?
What version of DB4S are you using? XedinUnknown commented on Sep 30, 2025
- I'm on Win 11.
- Using DB4S 3.13.1, like it says above.
- The DB is in a local folder - in my user's Downloads dir, for example, or in the project dir.
lucydodo commented on Oct 23, 2026 This issue can be resolved right now with a temporary build, and going forward with the new version to be released,
so I am closing this issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|