uwsgi-nginx-flask-docker icon indicating copy to clipboard operation
uwsgi-nginx-flask-docker copied to clipboard

SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC

Open bignellrp opened this issue 2 years ago • 1 comments

Im getting the following error when using gspread on docker. This error does not happen when using all the same python extension versions locally on my mac in vscode but happens almost daily when using this docker. I tried to find another docker with uwsgi, python3.8 and flask but this seems to be the only one so would be really handy to find out whats causing this or at least have a work around. I have contacted the gspread team who suggest its some kind of SSL error so maybe is related to the other issue open (https://github.com/tiangolo/uwsgi-nginx-flask-docker/issues/181)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "./routes/result.py", line 44, in result result = results() File "./services/get_spread.py", line 128, in init results_table = wsr.get_all_values() File "/usr/local/lib/python3.8/site-packages/gspread/utils.py", line 593, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/gspread/models.py", line 884, in get_all_values return self.get_values(**kwargs) File "/usr/local/lib/python3.8/site-packages/gspread/utils.py", line 593, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/gspread/models.py", line 857, in get_values return fill_gaps(self.get(range_name, **kwargs)) File "/usr/local/lib/python3.8/site-packages/gspread/utils.py", line 593, in wrapper return f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/gspread/models.py", line 1136, in get response = self.spreadsheet.values_get(range_name, params=params) File "/usr/local/lib/python3.8/site-packages/gspread/models.py", line 221, in values_get r = self.client.request('get', url, params=params) File "/usr/local/lib/python3.8/site-packages/gspread/client.py", line 64, in request response = getattr(self.session, method)( File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get return self.request('GET', url, **kwargs) File "/usr/local/lib/python3.8/site-packages/google/auth/transport/requests.py", line 480, in request response = super(AuthorizedSession, self).request( File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='sheets.googleapis.com', port=443): Max retries exceeded with url: /v4/spreadsheets/1tyy_8sKM-N-JA6j1pASCO6_HRxvlhTuA3R0KysbVG9U/values/%27Dev%20Results%27 (Caused by SSLError(SSLError(1, '[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2624)')))

bignellrp avatar Sep 01 '21 15:09 bignellrp

I'd like to add that ive switched to tiangologs meinheld docker and im no longer getting this error. docker run -t -i -e WEB_CONCURRENCY="1" -p 80:80 tiangolo/meinheld-gunicorn-flask

bignellrp avatar Sep 03 '21 07:09 bignellrp