samschott / maestral

Open-source Dropbox client for macOS and Linux
https://maestral.app
MIT License
3.09k stars 65 forks source link

Unexpected Error: SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC #471

Open laydros opened 2 years ago

laydros commented 2 years ago

Describe the bug Unexpected Error dialog pops up when syncing with GUI running

To Reproduce Seems to happen while syncing

Expected behaviour Sync to completion without errors

System:

Additional context

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/urllib3/response.py", line 441, in _error_catcher
    yield
  File "/usr/lib/python3.9/site-packages/urllib3/response.py", line 522, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "/usr/lib/python3.9/http/client.py", line 462, in read
    n = self.readinto(b)
  File "/usr/lib/python3.9/http/client.py", line 506, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.9/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.9/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2633)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/manager.py", line 791, in _handle_sync_thread_errors
    yield
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/manager.py", line 769, in startup_worker
    self.sync.download_sync_cycle(client)
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/sync.py", line 2836, in download_sync_cycle
    downloaded = self.apply_remote_changes(changes)
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/sync.py", line 3004, in apply_remote_changes
    for n, r in enumerate(res):
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 608, in result_iterator
    yield fs.pop().result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 438, in result
    return self.__get_result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/sync.py", line 3328, in _create_local_entry
    res = self._on_remote_file(event, client)
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/sync.py", line 3387, in _on_remote_file
    md = client.download(f"rev:{event.rev}", tmp_fname, sync_event=event)
  File "/home/laydros/.local/lib/python3.9/site-packages/maestral/client.py", line 623, in download
    for c in http_resp.iter_content(chunksize):
  File "/usr/lib/python3.9/site-packages/requests/models.py", line 758, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/usr/lib/python3.9/site-packages/urllib3/response.py", line 579, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/lib/python3.9/site-packages/urllib3/response.py", line 544, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3.9/site-packages/urllib3/response.py", line 452, in _error_catcher
    raise SSLError(e)
urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2633)
samschott commented 2 years ago

Thanks for the report! This is a strange one. How reproducible is the error? I.e., does it reoccur after restarting Maestral? And do any other programs report similar issues when downloading larger files (wget, web browser, etc)?

laydros commented 2 years ago

I stopped and restarted Maestral and it happened again after a few minutes. Since it looked like a few more files completed in the meantime, I stopped and started again. Then everything finished. So that's good news for me, but bad news for tracing the bug.

This was on a Manjaro system, I'm also planning to set up maestral on a Debian computer soon, I'll report back if I get anything similar.

No other programs reported similar errors.