how to debug an exception during a sync?

Cameron Simpson cs at zip.com.au
Thu May 10 00:13:40 UTC 2012


I've got my offlineimap wrapper working now, but I fear I have a
problematic message file that is causing trouble. How do I figure out
which message may be involved?

Setup:
  offlineimap-6.5.2.1
  dovecot remote server (via ssh tunnel)
  maildirs on the remote server; I have direct access to the message files
      involved if I can figure out which one is at issue

A transcript from the run ends like this:

    Syncing MD/out: IMAP -> Maildir
    Syncing MD/spool: IMAP -> Maildir
    Copy message 1387 (1 of 12107) cameron at cskk.local:143:MD/out -> mail
    Copy message 1388 (2 of 12107) cameron at cskk.local:143:MD/out -> mail
    ERROR: string index out of range
    Thread 'Copy message from cameron at cskk.local:143:MD/out' terminated with exception:
    Traceback (most recent call last):
      File "/opt/offlineimap/lib/offlineimap/threadutil.py", line 155, in
    run
        Thread.run(self)
      File
    "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
    line 505, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/opt/offlineimap/lib/offlineimap/folder/Base.py", line 295, in
    copymessageto
        message = self.getmessage(uid)
      File "/opt/offlineimap/lib/offlineimap/folder/IMAP.py", line 244, in
    getmessage
        data = data[0][1].replace("\r\n", "\n")
    IndexError: string index out of range

    Last 1 debug messages logged for Copy message from cameron at cskk.local:143:MD/out prior to exception:
    thread: Register new thread 'Copy message from cameron at cskk.local:143:MD/out' (account 'mail::cameron at cskk.local:143')
    ERROR: Exceptions occurred during the run!
    ERROR: string index out of range

How might I proceed?
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

If all else fails, immortality can always be assured by spectacular error.



More information about the OfflineIMAP-project mailing list