GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #3714

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bug]: get database table is locked error when opening some dbs#3714
Copy link
Assignees
lucydodo
Labels
sqlite

Description

@Tafaza
Tafaza
opened on Aug 28, 2024
Issue body actions

What 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

Activity

Next
  1. Tafaza commented on Sep 10, 2024

    @Tafaza
    Tafaza
    on Sep 10, 2024
    Author
    More actions

    After reloading db structure with Refresh button the db is read correctly.
    Writing some changes, closing and reopening it, I still get the error.

  2. deitry commented on Oct 8, 2024

    @deitry
    deitry
    on Oct 8, 2024
    More actions

    Seems to be the duplicate of #3636

  3. LaurentGrenet commented on Oct 13, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 13, 2024
    More actions

    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....
  4. justinclift commented on Oct 13, 2024

    @justinclift
    justinclift
    on Oct 13, 2024
    Member
    More actions

    @mgrojo @lucydodo This one sounds tricky to investigate? What do you guys reckon?

  5. lucydodo commented on Oct 14, 2024

    @lucydodo
    lucydodo
    on Oct 14, 2024
    Member
    More actions

    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.

    Reacted by Justin Clift
  6. LaurentGrenet commented on Oct 14, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 14, 2024
    More actions

    Please find here attached another example of such a database that opens correctly in 3.12.2 and fails in 3.13
    stickies.zip

  7. LaurentGrenet commented on Oct 21, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 21, 2024
    More actions

    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 ?

  8. mgrojo commented on Oct 21, 2024

    @mgrojo
    mgrojo
    on Oct 21, 2024
    Member
    More actions

    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?

  9. LaurentGrenet commented on Oct 22, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 22, 2024
    More actions

    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....

  10. LaurentGrenet commented on Oct 22, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 22, 2024
    More actions

    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

  11. justinclift commented on Oct 23, 2024

    @justinclift
    justinclift
    on Oct 23, 2024
    Member
    More actions

    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.

  12. LaurentGrenet commented on Oct 23, 2024

    @LaurentGrenet
    LaurentGrenet
    on Oct 23, 2024
    More actions

    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...

    Reacted by NRR
  13. Tafaza commented on Oct 23, 2024

    @Tafaza
    Tafaza
    on Oct 23, 2024
    Author
    More actions

    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.

  14. mgrojo commented on Oct 23, 2024

    @mgrojo
    mgrojo
    on Oct 23, 2024
    Member
    More actions

    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...

  15. justinclift commented on Oct 24, 2024

    @justinclift
    justinclift
    on Oct 24, 2024
    Member
    More actions

    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. 😄

    Reacted by Manuel
  16. 14 remaining items

  17. LaurentGrenet commented on Nov 6, 2024

    @LaurentGrenet
    LaurentGrenet
    on Nov 6, 2024
    More actions

    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....

  18. lucydodo commented on Nov 7, 2024

    @lucydodo
    lucydodo
    on Nov 7, 2024
    Member
    More actions

    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.

    Reacted by Justin Clift
  19. justinclift commented on Nov 8, 2024

    @justinclift
    justinclift
    on Nov 8, 2024
    Member
    More actions

    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. 😄

  20. lucydodo commented on Nov 11, 2024

    @lucydodo
    lucydodo
    on Nov 11, 2024
    Member
    More actions

    Unfortunately, I tried it this weekend but failed to build it. I will try again during this week. :(

    Reacted by Justin Clift
  21. lucydodo
    added a commit that references this issue on Nov 14, 2024

    Build SQLite from the latest their master branch

    656651a
  22. lucydodo commented on Nov 14, 2024

    @lucydodo
    lucydodo
    on Nov 14, 2024
    Member
    More actions

    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
  23. LaurentGrenet commented on Nov 14, 2024

    @LaurentGrenet
    LaurentGrenet
    on Nov 14, 2024
    More actions

    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 ?

  24. lucydodo commented on Nov 15, 2024

    @lucydodo
    lucydodo
    on Nov 15, 2024
    Member
    More actions

    @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.

  25. justinclift commented on Nov 26, 2024

    @justinclift
    justinclift
    on Nov 26, 2024
    Member
    More actions

    As a data point, SQLite 3.47.1 has been released today. In theory it should have that SQLite fix included: https://sqlite.org/releaselog/3_47_1.html

  26. UlyssesZh commented on Apr 28, 2025

    @UlyssesZh
    UlyssesZh
    on Apr 28, 2025
    More actions

    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
  27. XedinUnknown commented on Sep 24, 2025

    @XedinUnknown
    XedinUnknown
    on Sep 24, 2025
    More actions

    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.
    
  28. chrisjlocke commented on Sep 24, 2025

    @chrisjlocke
    chrisjlocke
    on Sep 24, 2025
    Member
    More actions

    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?

  29. XedinUnknown commented on Sep 30, 2025

    @XedinUnknown
    XedinUnknown
    on Sep 30, 2025
    More actions
    • 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.
  30. lucydodo commented on Oct 23, 2026

    @lucydodo
    lucydodo
    on Oct 23, 2026
    Member
    More actions

    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.

  31. lucydodo
    closed this as completedon Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lucydodo
    lucydodo

Labels

sqlite

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.