richard-better / pushbullet.py

A python client for http://pushbullet.com
MIT License
575 stars 110 forks source link

requests.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac #119

Closed shopro closed 5 years ago

shopro commented 7 years ago

I keep getting this error randomly. I think it happens when there is two pb.push_note's being sent at the same time and they try to share the same connection.

Traceback (most recent call last):
  File "/home/ai/venv/lib/python3.6/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/home/ai/venv/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2178)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ai/venv/lib/python3.6/site-packages/celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/ai/venv/lib/python3.6/site-packages/celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/ai/Python/celery.py", line 52, in _caller
    ret_value = run_func(*args, **kwargs)
  File "/home/ai/Python/test.run()
  File "/home/ai/Python/test.py", line 208, in run
    pb.push_note("Test 1", f"{time.strftime('%H:%M:%S')}\n\n{os.path.basename(__file__)}")
  File "/home/ai/venv/lib/python3.6/site-packages/pushbullet/pushbullet.py", line 238, in push_note
    return self._push(data)
  File "/home/ai/venv/lib/python3.6/site-packages/pushbullet/pushbullet.py", line 262, in _push
    r = self._session.post(self.PUSH_URL, data=json.dumps(data))
  File "/home/ai/venv/lib/python3.6/site-packages/requests/sessions.py", line 535, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/ai/venv/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ai/venv/lib/python3.6/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/home/ai/venv/lib/python3.6/site-packages/requests/adapters.py", line 497, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2178)
kovacsbalu commented 6 years ago

@shopro did you see this https://stackoverflow.com/questions/21497591/urllib2-reading-https-url-failure