Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox: database is locked #5

Closed
JanValiska opened this issue Dec 28, 2021 · 4 comments
Closed

Firefox: database is locked #5

JanValiska opened this issue Dec 28, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@JanValiska
Copy link

JanValiska commented Dec 28, 2021

Hello,

extension doesn't work with my firefox.
When I try to run Telescope bookmarks it will end up with:

E5108: Error executing lua ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sq
l statement parse, , stmt: `select name from sqlite_master where name= ?`, err: `(`database is locked`)` 

The same error is here when I try to use places.sqlite database using sqlite3 utility:

➜  hbo9xv4w.default sqlite3 places.sqlite
SQLite version 3.37.0 2021-11-27 14:13:22
Enter ".help" for usage hints.
sqlite> .tables
Error: database is locked

NOTE: The error is present only when the Firefox is running. When I close FF the database is locked error is not present anymore.

POSSIBLE SOLUTION:
I tried to open sqlite database using immutable flag and it works:

sqlite3 'file:places.sqlite?immutable=1'
@JanValiska
Copy link
Author

I just contacted developer of sqlite.lua: kkharji/sqlite.lua#131

@JanValiska
Copy link
Author

The problem can be solved after the PR feat: support sqlite open v2 #132 of sqlite.lua repo will be merged.
After that the connection to firefoxs places.sqlite file should be changed to something like(firefox.lua:L72):

local uri = "file:" .. utils.join_path(profile_dir, "places.sqlite") .. "?immutable=1"
local db = sqlite.new(uri, { open_mode = "ro" }):open()

@dhruvmanila
Copy link
Owner

Ah, right. I completely forgot about Firefox locking the database when it's opened. This is on me, sorry for the trouble.

The problem can be solved after the PR feat: support sqlite open v2 #132 of sqlite.lua repo will be merged.
After that the connection to firefoxs places.sqlite file should be changed to something like(firefox.lua:L72):

That sounds good. Thanks for taking a look at it. I will open a PR with the change and merge it as soon as the mentioned PR is merged.

@dhruvmanila
Copy link
Owner

For anyone facing this issue, you can pin this plugin to the commit: eef8e53. Sorry for the inconvenience.

@dhruvmanila dhruvmanila added the bug Something isn't working label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants