Modify

Opened 10 years ago

Closed 7 years ago

#277 closed defect (fixed)

"database locked" issue

Reported by: thomas.moschny@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.4.0
Keywords: Cc:

Description (last modified by bas)

Hi,

I thought I'd ask per mail first, before creating a ticket; maybe this
is a (configuration) error on our side, or something like that.

Here's the issue: Occasionally we lose mails in our email2trac -> Trac
setup, and get trackbacks like this in the syslog:

Oct 26 11:35:00 <hostname> email2trac <prjname>: subject: u'#4951: XXX'
Oct 26 11:35:11 <hostname> email2trac <prjname>: Traceback (most recent call
last):
Oct 26 11:35:11 <hostname> email2trac <prjname>:   File
"/opt/trac/bin/email2trac", line 2553, in ?     tktparser.parse(sys.stdin)
Oct 26 11:35:11 <hostname> email2trac <prjname>:   File
"/opt/trac/bin/email2trac", line 1689, in parse     if not
self.ticket_update(m, result.group('reply')[:-1], spam_msg):
Oct 26 11:35:11 <hostname> email2trac <prjname>:   File
"/opt/trac/bin/email2trac", line 985, in ticket_update
tkt.save_changes(self.author, body_text, when, None, str(cnum))
Oct 26 11:35:11 <hostname> email2trac <prjname>:   File
"/trac/opt/lib/python2.4/site-
packages/Trac-0.11.8dev_r10236-py2.4.egg/trac/ticket/model.py", line 293, in
save_changes     db.commit()
Oct 26 11:35:11 <hostname> email2trac <prjname>:   File
"/usr/lib64/python2.4/site-packages/sqlite/main.py", line 540, in commit
self.db.execute("COMMIT")
Oct 26 11:35:11 <hostname> email2trac <prjname>: OperationalError: database
is locked

As you can see, we are using Python 2.4 (well, we are on Centos5),
Trac 0.11.8dev and email2trac 2.4.0 (I know there's a later version,
will try it, but couldn't find anything relevant in the changelog).

It seems clear that email2trac might not be causing the issue, but is
suffering from it: something else might be blocking the DB while
email2trac tries to insert or update a ticket.

So the question is: Can email2trac repeat and try again for a while, or
else save the message somewhere so it doesn't get lost?

Best regards,
Thomas

Attachments (0)

Change History (4)

comment:1 Changed 10 years ago by bas

  • Status changed from new to assigned
  • Version changed from 2.4.5 to 2.4.0

This is an error. So email2trac dumps the original message in /tmp. Dan you can rerun email2trac with the message:

  • email2trac -v /tmp/<flle>

You must be the apache user else attachments will be created as "root" user

The error is that another process is also locking the database. It is a sqlite problem or your database maybe corrupt and you have to backup/restore it .

comment:2 Changed 10 years ago by thomas.moschny@…


That works (using </tmp/file). Good to know the message is not lost :)


Yes, I think another process locks the database.

The question was whether email2trac can be teached to try a little bit
harder.

(I think that'd work, because the locking had eventually been given up;
otherwise the command above would not have succeeded.)

comment:3 Changed 10 years ago by bas

Sometimes there is an error in the database. I seen this error in the past and had to restore the database. It was triggered by email2trac, only by mail and not on the command line. think i will make an option for it how many time it may retry it. In trac 0.12 version there are many fixes. Maybe upgrade to a newer trac version?

comment:4 Changed 7 years ago by bas

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from assigned to closed

will close this ticket as reporter is stil using email2trac and submitted patches

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.