Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid literal for int() in savemessage #455

Closed
cronfy opened this issue Apr 26, 2017 · 12 comments
Closed

invalid literal for int() in savemessage #455

cronfy opened this issue Apr 26, 2017 · 12 comments
Assignees
Labels

Comments

@cronfy
Copy link

cronfy commented Apr 26, 2017

I am using Offlineimap to copy mailbox from corporate mail (dovecot) to Yandex.

While copying messages I get this error:

 ERROR: Exceptions occurred during the run!
 ERROR: Copying message 1 [acc: Test]
  invalid literal for int() with base 10: 'none'
 
Traceback:
  File "/home/spbrsk/imapcopy/offlineimap-7.1.0/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/home/spbrsk/imapcopy/offlineimap-7.1.0/offlineimap/folder/UIDMaps.py", line 268, in savemessage
    newluid = self._mb.savemessage(-1, content, flags, rtime)
  File "/home/spbrsk/imapcopy/offlineimap-7.1.0/offlineimap/folder/IMAP.py", line 692, in savemessage
    uid = int(resp[-1].split(' ')[1])

 ERROR: while syncing INBOX.Sent [account Test]
  invalid literal for int() with base 10: 'none'

resp variable contains following data: ['1493194087 none']

As I am neither python programmer, nor IMAP expert, I have no Idea how to handle it.. How can this be solved?

General informations

  • system/distribution (with version): FreeBSD 10.3
  • offlineimap version (offlineimap -V): offlineimap v7.1.0, imaplib2 v2.57 (bundled), Python v2.7.12
@nicolas33
Copy link
Member

The target IMAP server looks to not be UIDPLUS compliant contrary to what they pretend. I'll see what we can do on our side.

@cronfy
Copy link
Author

cronfy commented Apr 26, 2017

Usually remote imap responses with something like ['1493212016 790']

['1493194087 none'] is a rare case, probably occuring after some previous error. But when it appears, it does not go away until mailbox is deleted and recreated/resynced from zero.

nicolas33 added a commit that referenced this issue Apr 26, 2017
Github-ref: #455
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
@nicolas33
Copy link
Member

You might like to try the above patch. ,-)

@cronfy
Copy link
Author

cronfy commented Apr 26, 2017

Thanks! I will try to use it when error occurs again.

@cronfy
Copy link
Author

cronfy commented Apr 27, 2017

I had same problem again with same sympthoms. It was impossible to continue sync, because offlineimap crashed with traceback.

I applied the patch, it helped, now there are no crashes, just a message:

 ERROR: Unexpected response: ['1493273889 none']

What does this mean? Message was copied or not?

These messages appear on every offlineimap run now (exactly once during the run, 2 in a row):

 ERROR: Unexpected response: ['1493273889 none']
 ERROR: Unexpected response: ['1493273889 none']

And when sync is finished, offlineimap does not exit successfully, it says:

...
Account sync Dmitry:
 *** Finished account 'Dmitry' in 2:00
ERROR: Exceptions occurred during the run!
ERROR: Unexpected response: ['1493273889 none']

Traceback:
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/UIDMaps.py", line 268, in savemessage
    newluid = self._mb.savemessage(-1, content, flags, rtime)
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/IMAP.py", line 691, in savemessage
    OfflineImapError.ERROR.MESSAGE)

ERROR: Unexpected response: ['1493273889 none']

Traceback:
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/Base.py", line 844, in copymessageto
    new_uid = dstfolder.savemessage(uid, message, flags, rtime)
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/UIDMaps.py", line 268, in savemessage
    newluid = self._mb.savemessage(-1, content, flags, rtime)
  File "/home/***/imapcopy/offlineimap-7.1.0/offlineimap/folder/IMAP.py", line 691, in savemessage
    OfflineImapError.ERROR.MESSAGE)

Exit code is 1.

@cronfy
Copy link
Author

cronfy commented Apr 27, 2017

Looks like these 2 messages are copied over and over again on each run:

Folder &BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1- [remote name INBOX.Sent] [acc: Dmitry]:
 Copy message UID 93 (1/2) DmitrySph:INBOX.Sent -> DmitryYandex
 Copy message UID 94 (2/2) DmitrySph:INBOX.Sent -> DmitryYandex
Folder INBOX [acc: Dmitry]:
 Syncing INBOX: IMAP -> MappedIMAP
Copy message from DmitrySph:INBOX.Sent:
 ERROR: Unexpected response: ['1493273889 none']
 ERROR: Unexpected response: ['1493273889 none']
Account sync Dmitry:
 *** Finished account 'Dmitry' in 0:08
ERROR: Exceptions occurred during the run!
ERROR: Unexpected response: ['1493273889 none']

... traceback follows...

But they do not seem to be duplicated on target IMAP, thought.

@nicolas33
Copy link
Member

What does this mean? Message was copied or not?

It's not copied. I agree I should improve the message.

Looks like these 2 messages are copied over and over again on each run:

Those 2 messages are the ones that offlineimap tries to copy without success again and again. I have no idea why the server does not return a new UID. I would next manually check the raw content of the faulting mail.

@cronfy
Copy link
Author

cronfy commented Apr 28, 2017

It seems to me that these 2 messages in question already exist on target IMAP.

This is not a problem for my task anymore, but If you wish, I can try to debug, what do I need to do?

@nicolas33
Copy link
Member

I think we can close this issue. This kind of unexpected response is rare enough.

@nicolas33
Copy link
Member

Thank you!

@philip-bl
Copy link

Hello, I have this problem in offlineimap 7.0.12+dfsg1-2, which is packaged on Debian Stretch. Is it fixed in later versions or do I need to apply some patch manually?

@nicolas33
Copy link
Member

@philip-bl The patch is in since v7.1.1. It won't fix the issue but it will really help understanding what's going on.

Feel free to open a new issue because the root cause might be sightly different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants