imap-backup icon indicating copy to clipboard operation
imap-backup copied to clipboard

`error SSL_read: unexpected eof while reading` while running backup

Open eliluong opened this issue 11 months ago • 1 comments

Hello, thank you for helping me with the previous issue. I let the process run to completion. Towards the end, however, I receive this error that I have not seen mentioned in issues yet. I can't tell if it's a particular email that is an issue, or if it's due to downloading such a large number of emails. Since I have delay_metadata enabled, nothing was saved so I would have to restart the entire process again. I have had this happen once before, but that was without verbose mode and I thought it was a one-time issue. Do you have any suggestions what I can try? Thank you.

D, [2024-12-06T04:26:36.128174 #1] DEBUG -- : [% ] uid: 9512 (7688/8732) - 32713 bytes
D, [2024-12-06T04:26:36.499710 #1] DEBUG -- : [% ] Pre-fetch unseen messages: 
D, [2024-12-06T04:26:37.186179 #1] DEBUG -- : [% ] Post-fetch unseen messages: 
D, [2024-12-06T04:26:37.186248 #1] DEBUG -- : [% ] uid: 9513 (7689/8732) - 31484 bytes
D, [2024-12-06T04:26:37.776337 #1] DEBUG -- : [% ] Pre-fetch unseen messages: 9514
D, [2024-12-06T04:26:38.761211 #1] DEBUG -- : [% ] Post-fetch unseen messages: 9514
D, [2024-12-06T04:26:38.761288 #1] DEBUG -- : [% ] uid: 9514 (7690/8732) - 92152 bytes
E, [2024-12-06T04:26:39.445933 #1] ERROR -- : Backup for account '[email protected]' failed with error SSL_read: unexpected eof while reading
/usr/local/lib/ruby/3.2.0/openssl/buffering.rb:80:in `sysread'
/usr/local/lib/ruby/3.2.0/openssl/buffering.rb:80:in `fill_rbuff'
/usr/local/lib/ruby/3.2.0/openssl/buffering.rb:239:in `gets'
/usr/local/bundle/gems/net-imap-0.4.12/lib/net/imap.rb:2720:in `get_response'
/usr/local/bundle/gems/net-imap-0.4.12/lib/net/imap.rb:2629:in `receive_responses'
/usr/local/bundle/gems/net-imap-0.4.12/lib/net/imap.rb:2606:in `block in start_receiver_thread'
{
  "version": "2.2",
  "accounts": [
    {
      "username": "[email protected]",
      "password": "zzzzzz",
      "local_path": "/data/email_folder",
      "folders": [
        "% ",
        "% 2",
        "% 2/Junk"
      ],
      "server": "imap.gmail.com",
      "multi_fetch_size": 1,
      "reset_seen_flags_after_fetch": true
    }
  ],
  "download_strategy": "delay_metadata"
}
docker run --volume ./config:/config --volume ./data:/data --dns 8.8.8.8 ghcr.io/joeyates/imap-backup:v15.0.2 imap-backup backup --verbose --config /config/imap-backup-v2.json

contents of .imap file

{"version":3,"uid_validity":104,"messages":[]}

eliluong avatar Dec 07 '24 19:12 eliluong

I also had this issue with my Gmail account... Following :)

nebriv avatar Dec 19 '24 13:12 nebriv

Hi @eliluong

As this doesn't happen on previous messages, it's clear that the SSL-encrypted communication does (normally) work.

I suspect this may relate to rate limitation.

As you are fetching one message at a time ("multi_fetch_size": 1) you may be exceeding some rate limit after a while.

You may be able to avoid this error by increasing multi_fetch_size.

Also, are you sure that the reset_seen_flags_after_fetch flag is needed? Normally, it's only a requirement with Apple servers.

joeyates avatar Jun 26 '25 10:06 joeyates

Closing due to inactivity. Feel free to reopen if any further information emerges.

joeyates avatar Aug 11 '25 13:08 joeyates