Opened 20 years ago
Closed 19 years ago
#1769 closed defect (duplicate)
Happening on new repository after initial subversion activity
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | version control/browser | Version: | 0.8.4 |
| Severity: | major | Keywords: | database locked |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I have just installed a new trac and configured it. But I keep getting the following error:
Oops...
Trac detected an internal error:
database is locked
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/core.py", line 531, in cgi_start
real_cgi_start()
File "/usr/lib/python2.3/site-packages/trac/core.py", line 526, in real_cgi_start
dispatch_request(path_info, args, req, env)
File "/usr/lib/python2.3/site-packages/trac/core.py", line 433, in dispatch_request
req.session = Session.Session(env, req, newsession)
File "/usr/lib/python2.3/site-packages/trac/Session.py", line 51, in __init__
self.get_session(sid)
File "/usr/lib/python2.3/site-packages/trac/Session.py", line 107, in get_session
" WHERE sid=%s", self.sid)
File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 237, in execute
self.con._begin()
File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 508, in _begin
self.db.execute("BEGIN")
OperationalError: database is locked
I know that my fsfs subversion repository is verified, good and not locked. While the page is loading, the trac.db-journal file appears. I cannot work out why it would compain about being locked.
Attachments (0)
Change History (16)
comment:1 by , 20 years ago
| Priority: | normal → highest |
|---|---|
| Severity: | major → critical |
comment:2 by , 20 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
If the problem occurs as one user, but not as root it's certainly a problem with your directory permissions. Please ask on the MailingList or IrcChannel for help resolving this.
comment:3 by , 20 years ago
| Severity: | critical → blocker |
|---|
comment:4 by , 20 years ago
| Keywords: | new install removed |
|---|---|
| Resolution: | invalid |
| Severity: | blocker → critical |
| Status: | closed → reopened |
I've the same problem as described above. Since Friday (Oct 14, 2005)I've been running TRAC as www-data.staff and it worked fine and correctly. We continued to checkin/checkout our data into subversion and made NO changes to TRAC whatsoever. We got the database is locked error totally out of the blues. It was working one minute and the next minute the entire system just froze up. We can use the Wiki and the ticket system but as soon as we try to access the Browse Source the trac.cgi script (seen from top) gets hold of 99.9% CPU time and keeps on processing infinitely. We've determined that trac is opening the svn repository, reading it, closing it, opening the svn repository, reading it, closing it… infinitely. Thank you.
Numaan
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/trac/core.py", line 531, in cgi_start
real_cgi_start()
File "/usr/lib/python2.3/site-packages/trac/core.py", line 513, in real_cgi_start
env = open_environment()
File "/usr/lib/python2.3/site-packages/trac/core.py", line 190, in open_environment
version = env.get_version()
File "/usr/lib/python2.3/site-packages/trac/Environment.py", line 162, in get_version
cursor.execute("SELECT value FROM system WHERE name='database_version'")
File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 244, in execute
self.rs = self.con.db.execute(SQL)
OperationalError: database is locked
comment:5 by , 20 years ago
| Component: | general → browser |
|---|---|
| Severity: | critical → blocker |
Further information to help in figuring out this process. I took snippet of the strace dump for the trac.cgi process:
open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202638419, SEEK_SET) = 202638419 read(9, "id: 6xa.0.r1/202638419\ntype: fil"…, 4096) = 4096 close(9) = 0 _llseek(3, 371162112, [371162112], SEEK_SET) = 0 write(3, "\363\207\5\0\10\0\264\3\337\207\5\0\4\0\240\0\0\0\205\0"…, 1024) = 1024 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202638745, SEEK_SET) = 202638745 read(9, "id: 6xb.0.r1/202638745\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202638703, SEEK_SET) = 202638703 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202638745, SEEK_SET) = 202638745 read(9, "id: 6xb.0.r1/202638745\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639067, SEEK_SET) = 202639067 read(9, "id: 6xc.0.r1/202639067\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639025, SEEK_SET) = 202639025 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639067, SEEK_SET) = 202639067 read(9, "id: 6xc.0.r1/202639067\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639390, SEEK_SET) = 202639390 read(9, "id: 6xd.0.r1/202639390\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639348, SEEK_SET) = 202639348 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639390, SEEK_SET) = 202639390 read(9, "id: 6xd.0.r1/202639390\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639709, SEEK_SET) = 202639709 read(9, "id: 6xe.0.r1/202639709\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639667, SEEK_SET) = 202639667 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639709, SEEK_SET) = 202639709 read(9, "id: 6xe.0.r1/202639709\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640031, SEEK_SET) = 202640031 read(9, "id: 6xf.0.r1/202640031\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202639989, SEEK_SET) = 202639989 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640031, SEEK_SET) = 202640031 read(9, "id: 6xf.0.r1/202640031\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640353, SEEK_SET) = 202640353 read(9, "id: 6xg.0.r1/202640353\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640311, SEEK_SET) = 202640311 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640353, SEEK_SET) = 202640353 read(9, "id: 6xg.0.r1/202640353\ntype: fil"…, 4096) = 4096 close(9) = 0 _llseek(3, 371184640, [371184640], SEEK_SET) = 0 write(3, "\t\210\5\0\10\0\304\3\365\207\5\0\4\0\214\0\0\0r\0\200"…, 1024) = 1024 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640674, SEEK_SET) = 202640674 read(9, "id: 6xh.0.r1/202640674\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640632, SEEK_SET) = 202640632 read(9, "PLAIN\nK 14\nsvn:executable\nV 0\n\nE"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/1", O_RDONLY) = 9 lseek(9, 202640674, SEEK_SET) = 202640674 read(9, "id: 6xh.0.r1/202640674\ntype: fil"…, 4096) = 4096 close(9) = 0 open("/home/numaanh/repo/db/revs/75", O_RDONLY) = 9 lseek(9, 160327295, SEEK_SET) = 160327295 read(9, "id: 6tx.u.r75/160327295\ntype: di"…, 4096) = 4096Process 5418 detached
comment:6 by , 20 years ago
| Severity: | blocker → critical |
|---|
comment:7 by , 20 years ago
| Summary: | "Oops... database is locked" error in standard, fresh installation → "Oops... database is locked" error |
|---|
comment:8 by , 20 years ago
Hard to say what's going on here… It's maybe a bug while doing the resync. The repository doesn't seem to be big, any chance you could provide us the repository dump?
Also, you could try to upgrade to 0.9 to see if the problem persist (see TracDownload), as anyway there's little chance there will be another 0.8 release (except for security fixes, I guess).
comment:9 by , 20 years ago
The current repository is about a 1GB+. I'm sorry but unfortunately I can't give you a repository dump because the code is proprietary. We will upgrade to 0.9 and try and replicate the problem.
comment:10 by , 20 years ago
| Priority: | highest → high |
|---|---|
| Severity: | critical → normal |
We've upgraded to the latest TRAC release 0.9beta2 and the problem has disappeared. We suspected that the database might have been corrupted in some way but that doesn't seem to be the problem. Hop e you guys succeed in killing this bug. I'll lower the priority on this bug.
comment:11 by , 20 years ago
| Severity: | normal → major |
|---|
comment:12 by , 20 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | reopened → closed |
So it seems like this is either fixed or was a user error.
comment:13 by , 20 years ago
… and in general, the situation with database locks with SQLite should be much improved since the 0.9 release.
comment:14 by , 20 years ago
| Summary: | "Oops... database is locked" error → Happening on new repository after initial subversion activity |
|---|
We just finished setting up subversion+trac under Windows XP Pro+Apache. First day we could browse source, no reports of this error. After an intensive week of populating the subversion repository, now trac is reporting this error on "login", "source browser", and now even when trying to access the home page. On install, I made two users admin users, everybody else was default. Is this still a problem or is this error also symptomatic of something else?
comment:15 by , 20 years ago
| Resolution: | worksforme |
|---|---|
| Status: | closed → reopened |
peter, what's the status about this, do you still have the problem? If yes, when this happens, is the database lock persistent (i.e. all subsequent requests also fail with this error), or does the problem only happen occasionally?
Plus, what PySqlite version are you using?
comment:16 by , 19 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | reopened → closed |



I have the same problem when running under a custom user. The error doesn't appear when trac.cgi is running as root.
(The trac repository is properly owned.)
I am increasing the severity and the priority of this ticket because it prevents usage on production environments.