Edgewall Software
Modify

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#10077 closed defect (duplicate)

OperationalError: database is locked

Reported by: webmaster@… Owned by:
Priority: normal Milestone:
Component: general Version: 0.12
Severity: normal Keywords: database, SQLite
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /browser/svn, Trac issued an internal error.

was checking/debugging svn hooks

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0

System Information

  • using SQLite

Enabled Plugins

Plugin information not available

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 511, in _dispatch_request
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 193, in dispatch
  File "build/bdist.linux-x86_64/egg/tractags/web_ui.py", line 66, in match_request
  File "build/bdist.linux-x86_64/egg/trac/web/api.py", line 216, in __getattr__
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 293, in _get_perm
  File "build/bdist.linux-x86_64/egg/trac/web/api.py", line 216, in __getattr__
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 300, in _get_session
  File "build/bdist.linux-x86_64/egg/trac/web/session.py", line 192, in __init__
  File "build/bdist.linux-x86_64/egg/trac/web/api.py", line 216, in __getattr__
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 159, in authenticate
  File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 465, in wrap
  File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 509, in authenticate
  File "build/bdist.linux-x86_64/egg/trac/web/auth.py", line 83, in authenticate
  File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 598, in _get_name_for_cookie
  File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 65, in execute
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 78, in execute
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 56, in execute
  File "build/bdist.linux-x86_64/egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
OperationalError: database is locked

Attachments (0)

Change History (7)

comment:1 by Remy Blank, 13 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #3446, one of our MostFrequentDuplicates.

comment:2 by Christian Boos, 13 years ago

Resolution: duplicate
Status: closedreopened

Well, except it's not supposed to occur anymore with 0.12.2 ;-)

So I'd like to get a few more details from the OP:

  • which SQLite version? which PySqlite version?
  • what web front end (mod_wsgi? version?)
  • how often does the problem happen? any usage patterns?
  • does the problem also happen without plugins? (we see account_mgr in the stack trace but maybe this is unrelated)
  • what is the size of the session and session_attribute tables?

in reply to:  2 comment:3 by webmaster@…, 13 years ago

Replying to cboos:

  • which SQLite version? which PySqlite version?

SQLite 3.3.6 pysqlite 2.3.3

  • what web front end (mod_wsgi? version?)

FastCGI

  • how often does the problem happen? any usage patterns?

Almost always when I'm using trac a bit faster. It's easily reproducible by clicking in the journal on two ticket links before the page is loaded (is it clear what I mean? ;-) ). Or when commenting on tickets relatively quickly. Reloading the page and sending POST data again makes this problem slightly less annoying.

  • does the problem also happen without plugins? (we see account_mgr in the stack trace but maybe this is unrelated)

Yes

  • what is the size of the session and session_attribute tables?

Well, I didn't actually took a look into the DB file, but there are just four accounts and I am pretty sure that (when those errors occurred) I was to only one using trac.

comment:4 by anonymous, 13 years ago

Ok, not many clues yet: maybe it's just the SQLite version which is too old? Or PySqlite built without multithread support?

Please build a recent version of PySqlite (as explained in that wiki page - recent versions will automatically fetch the current version of SQLite for you), and retry with that.

Optional follow-up questions (if the above rebuild is not enough):

  • on which filesystem is the sqlite db file? (usually in <tracenv>/db/trac.db). Is that any kind of remote fs?
  • do you have enough space in the /tmp folder? I seem to recall that some versions of sqlite write their tmp journal file there (but I can be wrong on this)
Last edited 13 years ago by Christian Boos (previous) (diff)

comment:5 by Stefan, 12 years ago

Version: 0.12.20.12

according to #10499 this also (still) occurs on 0.12 (referenced fix in #3446 was applied in 0.11.6)

comment:6 by Christian Boos, 12 years ago

Resolution: duplicate
Status: reopenedclosed

No feedback given to comment:4, closing.

comment:7 by Christian Boos, 11 years ago

Note that since then I've found a reproducible way to trigger this error: trying to access Trac while doing a backup of the database (trac-admin ENV hotcopy).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.