Repeated ERROR: PRIMARY KEY must be unique in cursor = self.connection.execute(sql, vars)

Marc MERLIN marc at merlins.org
Wed May 2 22:20:40 BST 2012


I'm setting this pretty regularly now, and it goes away when I restart offlineimap
and happens some other time down the road.

gandalfthegreat:~$ offlineimap --version
6.4.1

It looks like an sqllite problem, but I'm not if I have a corrupted DB or if I'm hitting
a random bug. 
How do I debug/fix this?

Thanks,
Marc

Account sync google.com:
 *** Processing account google.com
Thread-36:
 Copy message 89986 (1 of 1) Google:INBOX -> LocalGoogle
Folder INBOX [acc: google.com]:
 Syncing INBOX: IMAP -> Maildir
 Copy message 89986 (1 of 1) Google:INBOX -> LocalGoogle
Copy message from Google:INBOX:
 ERROR: PRIMARY KEY must be unique
Account sync google.com:
 *** Finished account 'google.com' in 0:06
 Next refresh in 30.0 minutes
 Thread 'Copy message from Google:INBOX' terminated with exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/threadutil.py", line 137, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/folder/Base.py", line 266, in copymessageto
    statusfolder.savemessage(uid, None, flags, rtime)
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/folder/LocalStatusSQLite.py", line 226, in savemessage
    (uid,flags))
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/folder/LocalStatusSQLite.py", line 90, in sql_write
    cursor = self.connection.execute(sql, vars)
IntegrityError: PRIMARY KEY must be unique


Last 1 debug messages logged for Copy message from Google:INBOX prior to exception:
thread: Register new thread 'Copy message from Google:INBOX' (account 'google.com')
 
ERROR: Exceptions occurred during the run!
 ERROR: PRIMARY KEY must be unique
Exception in thread Keep alive Google (most likely raised during interpreter shutdown):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
  File "/usr/local/lib/python2.7/dist-packages/offlineimap/threadutil.py", line 158, in run
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  




More information about the OfflineIMAP-project mailing list