mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-16 13:20:06 -05:00
random database lock when sqlite database #837
Closed
opened 2025-11-02 03:38:18 -06:00 by GiteaMirror
·
25 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.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.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#837
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lunny on GitHub (Jun 23, 2017).
This is a summary issue since there are so many issues to report the database lock when using sqlite. I will close all other issues and please continue in this issue.
@lunny commented on GitHub (Jun 23, 2017):
And maybe we should pause
make test-sqliteutil this issue is resolved.@typeless commented on GitHub (Jun 27, 2017):
Reference: https://sqlite.org/unlock_notify.html
@bkcsoft commented on GitHub (Jun 28, 2017):
@typeless Unless that is available in https://github.com/mattn/go-sqlite3 and https://github.com/go-xorm/xorm/ we can't use it 😞
@typeless commented on GitHub (Jun 29, 2017):
@bkcsoft Agreed. This would probably need to be fixed upstream.
@andreynering commented on GitHub (Jul 5, 2017):
I hope #2116 fixes the issue
@andreynering commented on GitHub (Jul 6, 2017):
Reopening, since it seems it not really fixed.
@PaulBINK commented on GitHub (Jun 18, 2018):
We are getting this problem frequently when working with issues: add label, comment, close issue, reopen. Sooner or later it will 500 on us. According to the logs it happens when calling GetNotificationCount.
@jonasfranz commented on GitHub (Jun 18, 2018):
Enabling WAL mode worked for me. https://www.sqlite.org/wal.html
@hoxnox commented on GitHub (Aug 30, 2018):
Same for me.
@typeless commented on GitHub (Aug 31, 2018):
Potential alternatives that could fix this:
https://github.com/bvinc/go-sqlite-lite
https://github.com/crawshaw/sqlite
@bvinc commented on GitHub (Sep 1, 2018):
Author of
go-sqlite-litehere. My driver, and also crawshaw's driver, don't provide adatabase/sqlinterface, so they would be extremely inconvenient to use. But for a few reasons, it would probably help with locking errors. My driver gives complete control over connections, which means you'll only get locking errors if you're doing something directly to cause them. The crawshaw driver defaults to using shared cache mode and WAL mode, and uses the unlock_notify API to prevent locking issues with shared cache mode.I think the current mattn driver is the best one to use if you require a
database/sqldriver. Their FAQ mentions setting the the maximum number of open connections to 1. Have you tried that?https://github.com/mattn/go-sqlite3#faq
@lunny commented on GitHub (Sep 2, 2018):
@bvinc thanks for your reply, It's a good idea to send a PR to set open connections to 1 when using mattn/go-sqlite3
@hoxnox commented on GitHub (Sep 4, 2018):
What is the best way to migrate from sqlite to postgresql?
@typeless commented on GitHub (Oct 21, 2018):
Now that https://github.com/mattn/go-sqlite3/pull/439 is merged, we can either use the tip right away or wait for the new release of
go-sqlite3to fix the issue. Note that to enable this functionality, we have to add a new build tagsqlite_unlock_notify.Edit: I hope the users don't have to specify
-tags sqlite sqlite_unlock_notifybesides just-tags sqlitein that it would be better to not expose the nuances of a dependent package. I don't know how it should be done though.Edit2: I changed my mind. If one wants to build Gitea from source, he should be capable of handling the additional flag. We should update the documentation accordingly though.
@lunny commented on GitHub (Oct 21, 2018):
at first, we need a PR to update go-sqlite3 library.
@lunny commented on GitHub (Oct 23, 2018):
Even #5144 resolved single process issue. There is some issues when pushing via SSH. This should be closed by #4886.
@sapk commented on GitHub (Oct 23, 2018):
@typeless go-sqlite3 library with sqlite_unlock_notify tag seems to not build on win 32bit https://drone.gitea.io/go-gitea/gitea/3536/18
@typeless commented on GitHub (Oct 23, 2018):
@sapk Similar to https://github.com/mattn/go-sqlite3/issues/238. Will submit a fix soon.
@sapk commented on GitHub (Oct 23, 2018):
@typeless exactly what I was searching but I use the terms
uint too largeand I found nothing ...@typeless commented on GitHub (Oct 23, 2018):
I have submitted https://github.com/mattn/go-sqlite3/pull/654.
However, I cannot find a computer with Windows/386 to test. 😨
@sapk commented on GitHub (Oct 23, 2018):
@typeless use gox to cross-compile ?
@typeless commented on GitHub (Oct 24, 2018):
@sapk I just installed it. But after typing
gox -osarch="windows/linux" -tags sqlite_unlock_notify, it only prints
Number of parallel builds: 31. I've not figured out how to use it to rungo testeither.Edit: fixed at https://github.com/mattn/go-sqlite3/pull/655
@lunny commented on GitHub (Oct 24, 2018):
Just type
make release-windowson gitea?@typeless commented on GitHub (Oct 24, 2018):
https://github.com/go-gitea/gitea/pull/5162 fixes the CI failure and
TAGS='bindata sqlite sqlite_unlock_notify' make release-windowspasses.@lunny commented on GitHub (Feb 26, 2019):
Closed this since it's not a system problem any more. If there is any issue please fire another issue.