Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API errors received when testing heroku URL #89

Open
fellchieftan opened this issue Feb 9, 2024 · 1 comment
Open

API errors received when testing heroku URL #89

fellchieftan opened this issue Feb 9, 2024 · 1 comment
Labels
heroku setup help For help related to setting up tconnectsync

Comments

@fellchieftan
Copy link

Hello, first off thank you for putting the work in to build this!

I am attempting to set up tconnectsync on Heroku, and I'm receiving API errors when testing the URL. I followed the instructions to the letter as far as I can tell, including setting up UptimeRobot.

To Reproduce
Steps to reproduce the behavior:

  1. I pasted the above link into Google Chrome
  2. The log that appeared mentions that API errors occurred and I'm not seeing any data in Nightscout

Expected behavior
I believe I have completed all other steps and should be seeing bolus info in Nightscout

Have you followed the Troubleshooting steps in the README?
Yes

Setup details

  • On what platform are you using the t:connect mobile app? (Android or iOS)
  • What version are you using of the t:connect mobile app?

Android 13
TConnect app version 2.6.1

Heroku log output
If applicable, add the full output from the heroku logs in More > View Logs. (See the instructions in the README.)

2024-02-09T03:25:09.904607+00:00 app[web.1]: -----
2024-02-09T03:25:09.904607+00:00 app[web.1]: API errors occurred. Please check the errors above.
2024-02-09T03:25:09.904607+00:00 app[web.1]: Created file tconnectsync-check-output.log containing additional debugging information.
2024-02-09T03:25:09.904607+00:00 app[web.1]: For support, you can upload this file to https://github.com/jwoglom/tconnectsync/issues/new
2024-02-09T03:25:09.904608+00:00 app[web.1]: The file -- but NOT the output printed above -- has been sanitized to remove sensitive data.
2024-02-09T03:25:09.904608+00:00 app[web.1]: Please verify and remove any sensitive data, such as your Nightscout URL/secret and pump serial number,
2024-02-09T03:25:09.904608+00:00 app[web.1]: as necessary.
2024-02-09T03:25:09.904608+00:00 app[web.1]:
2024-02-09T03:25:09.907051+00:00 heroku[router]: at=info method=HEAD path="/check_login?secret=e61aa41c6e64f0ba27c6829d90586cc4b974a2820a09b3afec25a43e25f5a9c7" host=insulink-pump-af16344da717.herokuapp.com request_id=2df4de6f-bc85-4ee9-9860-5c94fe8ceafb fwd="69.162.124.235" dyno=web.1 connect=0ms service=5560ms status=200 bytes=157 protocol=https
2024-02-09T03:25:09.907344+00:00 app[web.1]: 10.1.10.187 - - [09/Feb/2024:03:25:09 +0000] "HEAD /check_login?secret=e61aa41c6e64f0ba27c6829d90586cc4b974a2820a09b3afec25a43e25f5a9c7 HTTP/1.1" 200 0 "https://insulink-pump-af16344da717.herokuapp.com/check_login?secret=e61aa41c6e64f0ba27c6829d90586cc4b974a2820a09b3afec25a43e25f5a9c7" "Mozilla/5.0+(compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)"

Check Login output
If applicable, please follow the instructions to visit the check_login page, and copy and paste the output here.

This file may contain sensitive details like your Nightscout URL and pump serial number. Copy the output into a text editor like Textedit or Notepad first and find-and-replace sensitive strings, like your Nightscout URL and pump serial number, if they appear.

The output will also contain pump and CGM related information such as delivery events and blood sugars. If you would prefer to keep the contents private, send an email to tconnectsyncwogloms.net with the log output so @jwoglom can investigate.

tconnectsync version 0.9.4
Python version 3.9.13 (main, May 24 2022, 21:31:40)
[GCC 11.2.0]
System platform linux
Running checks with time range 2024-02-07 06:22:09.867684 to 2024-02-08 06:22:09.867684
Current time: 2024-02-08 06:22:09.867769
time.tzname: ('UTC', 'UTC')
Loading secrets...
TIMEZONE_NAME: America/Los_Angeles

Logging in to t:connect ControlIQ API...
Newer API version than last confirmed working. Saw t:connect 7.16.0.1 and expected t:connect 7.15.0.1
If you experience any issues, please report them to https://github.com/jwoglom/tconnectsync
Received ApiException in ControlIQApi with endpoint 'tconnect/controliq/api/summary/users/1cbba117-80c1-49ff-a0f5-2a66193cc228?startDate=02-07-2024&endDate=02-08-2024' (tries 0): ControlIQ API HTTP 404 response: {"type":"https://tools.ietf.org/html/rfc7231#section-6.5.4","title":"Not Found","status":404,"traceId":"00-d676a6c281ff6a43b4af4241904a8665-5723086aeebde245-00"} (HTTP 404)
Error occurred querying ControlIQ API for dashboard_summary:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-packages/tconnectsync/check.py", line 85, in check_login
summary = tconnect.controliq.dashboard_summary(time_start, time_end)
File "/app/.heroku/python/lib/python3.9/site-packages/tconnectsync/api/controliq.py", line 164, in dashboard_summary
return self.get('tconnect/controliq/api/summary/users/%s?startDate=%s&endDate=%s' % (self.userGuid, startDate, endDate), {})
File "/app/.heroku/python/lib/python3.9/site-packages/tconnectsync/api/controliq.py", line 139, in get
raise e
File "/app/.heroku/python/lib/python3.9/site-packages/tconnectsync/api/controliq.py", line 122, in get
return self._get(endpoint, query)
File "/app/.heroku/python/lib/python3.9/site-packages/tconnectsync/api/controliq.py", line 116, in _get
raise ApiException(r.status_code, "ControlIQ API HTTP %s response: %s" % (str(r.status_code), r.text))
tconnectsync.api.common.ApiException: ControlIQ API HTTP 404 response: {"type":"https://tools.ietf.org/html/rfc7231#section-6.5.4","title":"Not Found","status":404,"traceId":"00-d676a6c281ff6a43b4af4241904a8665-5723086aeebde245-00"} (HTTP 404)

<!> The API returns a 404 error if there is no data for the provided dates (currently 2024-02-07 06:22:09.867684 - 2024-02-08 06:22:09.867684). Try re-running with an earlier start date using --start-date and --end-date arguments.
Querying ControlIQ therapy_timeline...
ControlIQ therapy_timeline:
{'basal': {'algorithmDeliveryEvents': [], 'profileDeliveryEvents': [], 'profileRates': [], 'tempDeliveryEvents': []},
'events': [],
'pumpFeatures': [{'features': {'controlIQ': {'dateTimeFirstDetected': '2022-04-28T01:31:20', 'feature': 1, 'unixTimestamp': 1651134680}},
'serialNumber': '868407'},
{'features': {'controlIQ': {'dateTimeFirstDetected': '2022-08-27T13:47:30', 'feature': 1, 'unixTimestamp': 1661633250}},
'serialNumber': '99999999'}],
'softwareUpdates': [],
'suspensionDeliveryEvents': []}
ControlIQ processed therapy_timeline:
[]
Querying ControlIQ therapy_events...
controliq therapy_events:
{'dataOutOfRange': 0, 'devices': 'T-Slim 4.3 (sn:000172), One-Touch BG Meter', 'dst': 0, 'event': [], 'gapInData': 0, 'noData': 1}

Initializing t:connect WS2 API...
WS2 basaliq status:
{'BasalIQTech': {'AverageGlucoseOnResume': 0,
'AverageSuspensionDuration': 0,
'AverageSuspensionsPerDay': 0,
'AvgGlucoseOnSuspend': 0,
'AvgInactiveDays': 0,
'AvgInactiveHours': 0,
'AvgInactiveMinutes': 0,
'BiqDaysSetOff': 0,
'BiqHoursSetOff': 0,
'BiqMinutesSetOff': 0,
'BiqPercentSetOff': 0,
'CgmInactiveDays': 0,
'CgmInactiveHours': 0,
'CgmInactiveMinutes': 0,
'CgmInactivePercent': 0,
'DaysOn': 0,
'DaysSuspendedDay': 0,
'DaysSuspendedNight': 0,
'HoursOn': 0,
'HoursSuspendedDay': 0,
'HoursSuspendedNight': 0,
'MinutesSuspendedDay': 0,
'MinutesSuspendedNight': 0,
'PercentSuspendedDay': 0,
'PercentSuspendedNight': 0,
'PercentTimeOn': 0,
'PumpInactiveDays': 2,
'PumpInactiveHours': 0,
'PumpInactiveMinutes': 0,
'PumpInactivePercent': 100}}
Querying WS2 therapy_timeline_csv...
therapy_timeline_csv:
{'basalData': [], 'bolusData': [], 'iobData': [], 'readingData': []}

Logging in to t:connect Android API...
Android user profile:
{'age': 37,
'caregiverDateOfBirth': '0001-01-01T00:00:00',
'dateOfBirth': '1986-05-24T00:00:00',
'hasBASALIQ': False,
'hasCGM': True,
'hasControlIQ': True,
'hyperThreshold': 181,
'hypoThreshold': 69,
'patientFullName': 'Kyle Jackman',
'targetBgHigh': 180,
'targetBgLow': 70,
'userID': '1cbba117-80c1-49ff-a0f5-2a66193cc228'}
Android last uploaded event:
{'maxPumpEventIndex': 1203364, 'processingStatus': 1}

Logging in to Nightscout...
Nightscout status:
{'apiEnabled': True,
'authorized': None,
'boluscalcEnabled': True,
'careportalEnabled': True,
'extendedSettings': {'bolus': {'renderOver': 1}, 'devicestatus': {'advanced': True, 'days': 1}},
'name': 'nightscout',
'runtimeState': 'loaded',
'serverTime': '2024-02-08T06:22:15.216Z',
'serverTimeEpoch': 1707373335216,
'settings': {'DEFAULT_FEATURES': ['bgnow',
'delta',
'direction',
'timeago',
'devicestatus',
'upbat',
'errorcodes',
'profile',
'bolus',
'dbsize',
'runtimestate',
'basal',
'careportal'],
'adminNotifiesEnabled': True,
'alarmHigh': True,
'alarmHighMins': [30, 60, 90, 120],
'alarmLow': True,
'alarmLowMins': [15, 30, 45, 60],
'alarmPumpBatteryLow': False,
'alarmTimeagoUrgent': True,
'alarmTimeagoUrgentMins': '30',
'alarmTimeagoWarn': True,
'alarmTimeagoWarnMins': '15',
'alarmTypes': ['simple'],
'alarmUrgentHigh': True,
'alarmUrgentHighMins': [30, 60, 90, 120],
'alarmUrgentLow': True,
'alarmUrgentLowMins': [15, 30, 45],
'alarmUrgentMins': [30, 60, 90, 120],
'alarmWarnMins': [30, 60, 90, 120],
'authDefaultRoles': 'denied',
'authFailDelay': 5000,
'baseURL': '',
'customTitle': 'Nightscout',
'dayEnd': 21,
'dayStart': 7,
'deNormalizeDates': False,
'editMode': True,
'enable': ['careportal',
'basal',
'dbsize',
'rawbg',
'iob',
'maker',
'bridge',
'cob',
'bwp',
'cage',
'iage',
'sage',
'boluscalc',
'pushover',
'treatmentnotify',
'mmconnect',
'loop',
'pump',
'profile',
'food',
'openaps',
'bage',
'alexa',
'override',
'speech',
'cors',
'treatmentnotify',
'bgnow',
'delta',
'direction',
'timeago',
'devicestatus',
'upbat',
'errorcodes',
'bolus',
'runtimestate',
'simplealarms'],
'focusHours': 3,
'frameName1': '',
'frameName2': '',
'frameName3': '',
'frameName4': '',
'frameName5': '',
'frameName6': '',
'frameName7': '',
'frameName8': '',
'frameUrl1': '',
'frameUrl2': '',
'frameUrl3': '',
'frameUrl4': '',
'frameUrl5': '',
'frameUrl6': '',
'frameUrl7': '',
'frameUrl8': '',
'heartbeat': 60,
'insecureUseHttp': False,
'language': 'en',
'nightMode': False,
'scaleY': 'log',
'secureCsp': False,
'secureHstsHeader': True,
'secureHstsHeaderIncludeSubdomains': False,
'secureHstsHeaderPreload': False,
'showClockDelta': False,
'showClockLastTime': False,
'showForecast': 'ar2',
'showPlugins': 'careportal dbsize delta direction upbat',
'showRawbg': 'never',
'theme': 'colors',
'thresholds': {'bgHigh': 260, 'bgLow': 55, 'bgTargetBottom': 80, 'bgTargetTop': 180},
'timeFormat': 12,
'units': 'mg/dl'},
'status': 'ok',
'version': '14.2.2'}
Nightscout last uploaded basal:
None
Nightscout last uploaded bolus:
None

Last basal start time: None (n/a)
Last basal duration: None
Last reading time: None (n/a)

API errors occurred. Please check the errors above.
Created file tconnectsync-check-output.log containing additional debugging information.
For support, you can upload this file to https://github.com/jwoglom/tconnectsync/issues/new
The file -- but NOT the output printed above -- has been sanitized to remove sensitive data.
Please verify and remove any sensitive data, such as your Nightscout URL/secret and pump serial number,
as necessary.

Additional context
Add any other context about the problem here.

The instructions mentioned that the expected url would be whatever I put in the App Name field when creating the app. From what I can tell Heroku appended a string of extra characters to the end of this. That is the only thing that was unexpected during the install

I was expecting https:\mysite-tconnect.herokuapp.com
I ended up with https:\mysite-tconnect-af16344da717.herokuapp.com

Thank you!

@fellchieftan fellchieftan added heroku setup help For help related to setting up tconnectsync labels Feb 9, 2024
@fellchieftan
Copy link
Author

Just to add, I made sure that the TConnect password I used in the config variable is accurate, I can log in to the site and app without issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heroku setup help For help related to setting up tconnectsync
Projects
None yet
Development

No branches or pull requests

1 participant