MaxWinterstein / toogoodtogo-ha-mqtt-bridge

36 stars 8 forks source link

tgtg.exceptions.TgtgAPIError: (404, b'{"type":"about:blank","title":"Not Found","status":404,"detail":"No static resource auth/v3/token/refresh.","instance":"/api/auth/v3/token/refresh"}') #175

Open huizebruin opened 2 days ago

huizebruin commented 2 days ago

today i got this error.

 Publish TooGoodToGo stock as MQTT messages
-----------------------------------------------------------
 Add-on version: 2.5.1.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.2  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.11.3
 Home Assistant Supervisor: 2024.11.4
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/toogoodtogo-ha-mqtt-bridge.sh
[19:51:24] INFO: Copy settings file
Saved tokens found.
If you have any problems reinstalling the add-on might help.
cont-init: info: /etc/cont-init.d/toogoodtogo-ha-mqtt-bridge.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun toogoodtogo-ha-mqtt-bridge (no readiness notification)
s6-rc: info: service legacy-services successfully started
[19:51:24] INFO: Strating Bridge...
2024-11-22 19:51:28 [INFO] Connecting mqtt
2024-11-22 19:51:28 [INFO] Starting loop
2024-11-22 19:51:28 [INFO] Checking latest tgtg appstore version
2024-11-22 19:51:29 [INFO] Loaded tokens form tokenfile. Logging in with tokens.
Exception in thread Thread-3 (fetch_loop):
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/app/toogoodtogo_ha_mqtt_bridge/main.py", line 324, in fetch_loop
    tgtg_client.login()
  File "/usr/local/lib/python3.11/site-packages/tgtg/__init__.py", line 139, in login
    self._refresh_token()
  File "/usr/local/lib/python3.11/site-packages/toogoodtogo_ha_mqtt_bridge-2.2.3-py3.11.egg/toogoodtogo_ha_mqtt_bridge/mytgtgclient.py", line 61, in _refresh_token
    raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (404, b'{"type":"about:blank","title":"Not Found","status":404,"detail":"No static resource auth/v3/token/refresh.","instance":"/api/auth/v3/token/refresh"}')

How can i fix this , must i reinstall the addon?

MaxWinterstein commented 2 days ago

I guess this is related to some update of TGTG itself. Will update this soon.

Rel https://github.com/ahivert/tgtg-python/releases/tag/0.18.0

Rel https://github.com/ahivert/tgtg-python/pull/324