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

403 Forbidden Login Error (Prior to tconnectsync v0.7)

policetonyR opened this issue · comments

commented

When logging in to the API, it returns 403 error. This is latest version

image

I'm seeing the same error as well:

docker[141582]: Starting auto-update between 2022-03-16 16:00:36.017648 and 2022-03-17 16:00:36.017648
docker[141582]: 2022-03-17 16:00:36 DEBUG Set logging level to DEBUG
docker[141582]: 2022-03-17 16:00:36 INFO Enabled features: BASAL, BOLUS, IOB, PUMP_EVENTS
docker[141582]: 2022-03-17 16:00:36 DEBUG autoupdate loop
docker[141582]: 2022-03-17 16:00:36 DEBUG Instantiating new AndroidApi
docker[141582]: 2022-03-17 16:00:36 DEBUG Starting new HTTPS connection (1): tdcservices.tandemdiabetes.com:443
docker[141582]: 2022-03-17 16:00:36 DEBUG https://tdcservices.tandemdiabetes.com:443 "POST /cloud/oauth2/token HTTP/1.1" 403 179
docker[141582]: Traceback (most recent call last):
docker[141582]: File "/home/appuser/main.py", line 5, in
docker[141582]: main()
docker[141582]: File "/home/appuser/tconnectsync/init.py", line 87, in main
docker[141582]: sys.exit(u.process(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features))
docker[141582]: File "/home/appuser/tconnectsync/autoupdate.py", line 40, in process
docker[141582]: last_event = tconnect.android.last_event_uploaded(self.secret.PUMP_SERIAL_NUMBER)
docker[141582]: File "/home/appuser/tconnectsync/api/init.py", line 55, in android
docker[141582]: self._android = AndroidApi(self.email, self.password)
docker[141582]: File "/home/appuser/tconnectsync/api/android.py", line 41, in init
docker[141582]: self.login(email, password)
docker[141582]: File "/home/appuser/tconnectsync/api/android.py", line 59, in login
docker[141582]: raise ApiLoginException(r.status_code, 'Received HTTP %s during login: %s' % (r.status_code, r.text))
docker[141582]: tconnectsync.api.common.ApiLoginException: Received HTTP 403 during login:
docker[141582]: <title>403 Forbidden</title>
docker[141582]:
docker[141582]:

403 Forbidden


docker[141582]:
Microsoft-Azure-Application-Gateway/v2
docker[141582]:
docker[141582]:
docker[141582]: (HTTP 403)
systemd[1]: tconnectsync.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: tconnectsync.service: Failed with result 'exit-code'.

This is also happening for me, started 2022-03-16 23:57:42 UTC. Looking for a resolution now.

Just pushed a fix -- Tandem added a web access firewall that was blocking our requests. I have tuned the API calls such that they no longer are blocked by the azure application gateway, at least for now.

Will tag release v0.7 now with the fixes.

Thank you for fixing this so quickly! I see the 0.7.0 tag with the fix and I see version 0.6.6 in the source but, when I try to upgrade using pip, it says I'm up to date at 0.6.5. I've been using the pip install in a vm since before the heroku option was added so I've been toying with the idea of switching. Should I go ahead and make that switch now?

My bad, I generated the new docker images but forgot to trigger the workflow to publish the new python package to PyPI. The new version should appear in a few minutes.

(I also didn't update the constant in the source, I'll publish a v0.7.1 with that tomorrow for consistency. I jumped to fix this quickly and forgot my normal process!)

My bad, I generated the new docker images but forgot to trigger the workflow to publish the new python package to PyPI. The new version should appear in a few minutes.

@jwoglom, thank you! It worked like a charm! And I didn't mean to come across as critical about the version numbers. I assumed I was doing something wrong and was just trying to determine if I had the latest version. Thanks again!