jwoglom / tconnectsync

Syncs data from Tandem Source (formerly t:connect) to Nightscout for the t:slim X2 and Mobi insulin pumps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Spazholio opened this issue · comments

Describe the problem

✔ Container tconnectsync   Started                                                                                                                                                                                                                            0.5s
tconnectsync  | Processing data between 2023-03-26 22:22:33.693298 and 2023-03-27 22:22:33.693298
tconnectsync  | 2023-03-27 22:22:33 INFO     Enabled features: BASAL, BOLUS, PUMP_EVENTS
tconnectsync  | 2023-03-27 22:22:33 INFO     Downloading t:connect ControlIQ data
tconnectsync  | 2023-03-27 22:22:33 INFO     Logging in to ControlIQApi...
tconnectsync  | 2023-03-27 22:22:36 INFO     Logged in to ControlIQApi successfully (expiration: 2023-03-28T06:22:34.203Z, in 7 hours, 59 minutes)
tconnectsync  | 2023-03-27 22:22:37 INFO     Downloading t:connect CSV data
tconnectsync  | 2023-03-27 22:22:39 INFO     Last CGM reading from t:connect: 2023-03-27T17:50:36-04:00 (32 minutes ago)
tconnectsync  | Traceback (most recent call last):
tconnectsync  |   File "/base/.venv/lib/python3.9/site-packages/requests/models.py", line 910, in json
tconnectsync  |     return complexjson.loads(self.text, **kwargs)
tconnectsync  |   File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
tconnectsync  |     return _default_decoder.decode(s)
tconnectsync  |   File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
tconnectsync  |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
tconnectsync  |   File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
tconnectsync  |     raise JSONDecodeError("Expecting value", s, err.value) from None
tconnectsync  | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
tconnectsync  |
tconnectsync  | During handling of the above exception, another exception occurred:
tconnectsync  |
tconnectsync  | Traceback (most recent call last):
tconnectsync  |   File "/home/appuser/main.py", line 5, in <module>
tconnectsync  |     main()
tconnectsync  |   File "/home/appuser/tconnectsync/__init__.py", line 90, in main
tconnectsync  |     added = process_time_range(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features)
tconnectsync  |   File "/home/appuser/tconnectsync/process.py", line 89, in process_time_range
tconnectsync  |     added += ns_write_basal_events(nightscout, basalEvents, pretend=pretend)
tconnectsync  |   File "/home/appuser/tconnectsync/sync/basal.py", line 109, in ns_write_basal_events
tconnectsync  |     last_upload = nightscout.last_uploaded_entry(BASAL_EVENTTYPE)
tconnectsync  |   File "/home/appuser/tconnectsync/nightscout.py", line 58, in last_uploaded_entry
tconnectsync  |     j = latest.json()
tconnectsync  |   File "/base/.venv/lib/python3.9/site-packages/requests/models.py", line 917, in json
tconnectsync  |     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
tconnectsync  | requests.exceptions.JSONDecodeError: [Errno Expecting value] : 0
tconnectsync exited with code 1

To Reproduce
Steps to reproduce the behavior:

  1. Run it

Expected behavior

Setup details

  • Operating system: Arch linux
  • tconnectsync version (from --version): latest
  • On what platform are you using the t:connect mobile app? (Android or iOS) iOS
  • What version are you using of the t:connect mobile app? latest

Terminal output
See above

Check Login output
Can't, running via docker-compose.yml.

Hi @Spazholio, I would double check to make sure your Nightscout instance is working properly. If nightscout's url and api secret are configured in tconnectsync and you can confirm they are correct, then can you share what version of nightscout you are running? Thanks

Sure thing. The NS version is v14.2.6, running in Docker as well. I just verified that it is indeed working fine and used the NS_SECRET in the tconnectsync.env file to log into NS via a brand new browser (to eliminate any caching concerns) and it worked as well.

Incidentally, the "setup help" label is inaccurate - I've had this running just fine in the past. This is new behavior on an existing install.