jwoglom / tconnectsync

Syncs insulin pump data from Tandem t:connect to Nightscout for the t:slim X2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker crash v0.8.5 read timed out tconnectws2.tandemdiabetes.com

bcleonard opened this issue · comments

On v0.8.5 the docker container crashes. Here is the error message:

Starting auto-update between 2022-10-04 14:54:30.425936 and 2022-10-05 14:54:30.425936
2022-10-05 14:54:30 INFO Enabled features: BASAL, BOLUS
2022-10-05 14:54:30 INFO Logged in to AndroidApi successfully (expiration: 2022-10-05T22:54:30.664Z, in 7 hours, 59 minutes)
2022-10-05 14:54:30 INFO New reported t:connect data. (event index: 737987 last: None)
2022-10-05 14:54:30 INFO Downloading t:connect ControlIQ data
2022-10-05 14:54:30 INFO Logging in to ControlIQApi...
2022-10-05 14:54:31 INFO Reported tconnect software version: t:connect 7.14.0.1
2022-10-05 14:54:32 INFO Logged in to ControlIQApi successfully (expiration: 2022-10-05T22:54:31.126Z, in 7 hours, 59 minutes)
2022-10-05 14:54:33 INFO Downloading t:connect therapy_events
2022-10-05 14:54:33 WARNING No last CGM reading is able to be determined from CIQ
2022-10-05 14:54:33 WARNING Downloading t:connect CSV data
2022-10-05 14:54:33 WARNING Falling back on WS2 CSV data source because BOLUS is an enabled feature and CIQ bolus data was empty!!
2022-10-05 14:54:33 WARNING <!!> The WS2 data source is unreliable and may prevent timely synchronization
Traceback (most recent call last):
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.9/http/client.py", line 1377, in getresponse
response.begin()
File "/usr/local/lib/python3.9/http/client.py", line 320, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.9/http/client.py", line 281, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/local/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/usr/local/lib/python3.9/ssl.py", line 1242, in recv_into
return self.read(nbytes, buffer)
File "/usr/local/lib/python3.9/ssl.py", line 1100, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/base/.venv/lib/python3.9/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/base/.venv/lib/python3.9/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/base/.venv/lib/python3.9/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 451, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/base/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='tconnectws2.tandemdiabetes.com', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/appuser/main.py", line 5, in
main()
File "/home/appuser/tconnectsync/init.py", line 88, in main
sys.exit(u.process(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features))
File "/home/appuser/tconnectsync/autoupdate.py", line 48, in process
added = process_time_range(tconnect, nightscout, time_start, time_end, pretend, features=features)
File "/home/appuser/tconnectsync/process.py", line 102, in process_time_range
csvdata = tconnect.ws2.therapy_timeline_csv(time_start, time_end)
File "/home/appuser/tconnectsync/api/ws2.py", line 83, in therapy_timeline_csv
req_text = self.get('therapytimeline2csv/%s/%s/%s?format=csv' % (self.userGuid, startDate, endDate), timeout=10)
File "/home/appuser/tconnectsync/api/ws2.py", line 25, in get
r = self.session.get(self.BASE_URL + endpoint, headers=base_headers(), **kwargs)
File "/base/.venv/lib/python3.9/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/base/.venv/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/base/.venv/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/base/.venv/lib/python3.9/site-packages/requests/adapters.py", line 578, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='tconnectws2.tandemdiabetes.com', port=443): Read timed out. (read timeout=10)

I'm going to close this issue as it falls under #39 and is out of our control.

From the log output, tconnectsync needed to fall back on the unreliable tconnect ws2 API because it couldn't find any data:

2022-10-05 14:54:33 WARNING Falling back on WS2 CSV data source because BOLUS is an enabled feature and CIQ bolus data was empty!!