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

fix: database is locked #1992

Merged

Conversation

lincolnthalles
Copy link
Contributor

The option "_journal_mode=WAL" is currently not being applied when provided in the DSN.

This issue affects only new memos installations, not older ones where the database journal was properly set to WAL mode by the previous sqlite library go-sqlite3.

modernc.org/sqlite DSN parsing is different from go-sqlite3. It requires the _pragma= prefix and even some options order matter.
https://gitlab.com/cznic/sqlite/-/issues/115

By the way, as stated at sqlite documentation, it's a good practice to keep "cache=private" and "foreign_keys=0" explicit, even though it's the current default behavior, as sqlite defaults may change at some point.

Closes #1985

The option "_journal_mode=WAL" is currently *not* being applied when
provided in the DSN.

This issue affects only new memos installations, not older ones where
the database journal was properly set to WAL mode by the previous sqlite
library go-sqlite3.

modernc.org/sqlite DSN parsing is different from go-sqlite3. It requires
the `_pragma=` prefix and even some options order matter.

https://gitlab.com/cznic/sqlite/-/issues/115

Closes usememos#1985
@lincolnthalles lincolnthalles requested a review from boojack as a code owner July 19, 2023 16:07
@github-actions
Copy link

github-actions bot commented Jul 19, 2023

Uffizzi Preview deployment-31312 was deleted.

Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

store/db/db.go Outdated Show resolved Hide resolved
@boojack boojack merged commit c8961ad into usememos:main Jul 20, 2023
@lincolnthalles lincolnthalles deleted the fix/database-is-locked-SQLITE_BUSY branch July 20, 2023 13:17
lincolnthalles added a commit to lincolnthalles/memos that referenced this pull request Oct 21, 2023
* fix: database is locked

The option "_journal_mode=WAL" is currently *not* being applied when
provided in the DSN.

This issue affects only new memos installations, not older ones where
the database journal was properly set to WAL mode by the previous sqlite
library go-sqlite3.

modernc.org/sqlite DSN parsing is different from go-sqlite3. It requires
the `_pragma=` prefix and even some options order matter.

https://gitlab.com/cznic/sqlite/-/issues/115

Closes usememos#1985

* chore: upgraded notes on sqlite DSN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot log in - db locking issue - failed to find users
2 participants