question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSLEOFError - gyb quits with unhandled exception after processing 30k out of 50k emails

See original GitHub issue

Please confirm the following:

Got Your Back 1.55
https://git.io/gyb
Jay Lee - jay0lee@gmail.com
Python 3.10.2 64-bit final
google-api-client 2.36.0
Linux-5.10.60.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 x86_64
Path: /home/adam/bin/gyb
ConfigPath: /home/adam/bin/gyb
OpenSSL 3.0.1 14 Dec 2021
gmail.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384

Full steps to reproduce the issue: I don’t have a specific easy-to-reproduce and isolated bug. Hopefully a more robust exception handling / retry mechanism around the problem below would solve it.

Steps I took:

  • Create a full backup of a Google custom domain account locally (completes without problems).
  • Start restoring the backup to another @gmail address
  • After a few hours and processing ~30k emails, gyb experienced an unhandled exception and quit as below
gyb --email XXX@gmail.com --action restore --local-folder GYB-GMail-Backup-X@X.com

[...]

Select the actions you wish GYB to be able to perform for XXX@gmail.com

[ ]  0)  Gmail Backup And Restore - read/write mailbox access
[ ]  1)  Gmail Backup Only - read-only mailbox access
[ ]  2)  Gmail Restore Only - write-only mailbox access and label management
[*]  3)  Gmail Full Access - read/write mailbox access and message purge
[ ]  4)  No Gmail Access

[*]  5)  Groups Restore - write to G Suite Groups Archive
[*]  6)  Storage Quota - Drive app config scope used for --action quota

      7)  Continue
7

Go to the following link in your browser:

        https://gyb-shortn.jaylee.us/XXX

Enter verification code: XXX

Using backup folder GYB-GMail-Backup-X@X.com
restoring 1.62mb message (20221/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
restoring 15 messages (25827/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
restoring 15 messages (27460/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
restoring 15 messages (28936/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
restoring 1.37mb message (30608/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
restoring 15 messages (30620/51615)
ERROR: 400: Invalid attachment. Please check https://support.google.com/mail/answer/6590.. Skipping message restore.
Traceback (most recent call last):)
  File "gyb.py", line 2532, in <module>
  File "gyb.py", line 2072, in main
  File "gyb.py", line 733, in callGAPI
  File "googleapiclient/_helpers.py", line 131, in positional_wrapper
  File "googleapiclient/http.py", line 1565, in execute
  File "googleapiclient/http.py", line 1495, in _execute
  File "gyb.py", line 107, in wrapped_request_method
  File "google_auth_httplib2.py", line 218, in request
  File "httplib2/__init__.py", line 1725, in request
  File "httplib2/__init__.py", line 1441, in _request
  File "httplib2/__init__.py", line 1364, in _conn_request
  File "http/client.py", line 1282, in request
  File "http/client.py", line 1328, in _send_request
  File "http/client.py", line 1277, in endheaders
  File "http/client.py", line 1076, in _send_output
  File "http/client.py", line 998, in send
  File "ssl.py", line 1236, in sendall
  File "ssl.py", line 1205, in send
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2384)
[15408] Failed to execute script 'gyb' due to unhandled exception!

Expected outcome (what are you trying to do?): As above - restoring local backup to a new address

Actual outcome (what errors or bad behavior do you see instead?): As above - unhandled exception, gyb quit.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
adam-ahcommented, Feb 11, 2022

@jay0lee, uploading messages may take several hours to days and network errors can and do occur. In fact, network errors are the norm, not the exception when performing long operations.

It is not unreasonable for gyb, similarly to most apps performing long network operations, to implement automatic retry if the error did not occur on the very first attempt (i.e., when the error occurs after a successful start).

I cannot think of any apps that has the ability to resume (just like gyb resumes when manually restarted), but crash rather than implement automatic retries on long network operations - can you?

0reactions
mrshucommented, Jun 4, 2022

It looks like there is some retry mechanism in the function in question (https://github.com/GAM-team/got-your-back/blob/main/gyb.py#L754) – I guess that might help a bit and this issue might no longer be relevant?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found