Chouffy/home_assistant_tgtg

Connection pool is full/Captcha 403 error

Closed this issue · 4 comments

System Health details

System Information

version core-2023.5.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.11
os_name Linux
os_version 6.1.25
arch x86_64
timezone Europe/Amsterdam
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.32.1
Stage running
Available Repositories 1350
Downloaded Repositories 36
HACS Data ok
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 10.1
update_channel stable
supervisor_version supervisor-2023.04.1
agent_version 1.5.1
docker_version 23.0.3
disk_total 62.3 GB
disk_used 21.6 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Home Assistant Google Drive Backup (0.110.4), Samba share (10.0.1), File editor (5.6.0), Terminal & SSH (9.7.0), Portainer (2.0.0), Mosquitto broker (6.2.1), WireGuard (0.8.0), AdGuard Home (4.8.6), TimescaleDB (2.1.1), Duck DNS (1.15.0), NGINX Home Assistant SSL proxy (3.4.2), SQLite Web (3.7.1), Studio Code Server (5.5.7), pgAdmin4 (2.1.1), Zigbee2MQTT (1.30.4-1), ESPHome (2023.4.4), Advanced SSH & Web Terminal (14.1.0), Frigate NVR Proxy (1.3), chrony (2.5.0), DSMR Reader (1.10.1), Vaultwarden (Bitwarden) (0.19.3)
Dashboards
dashboards 4
resources 19
views 21
mode storage
Recorder
oldest_recorder_run 27 april 2023 om 16:09
current_recorder_run 5 mei 2023 om 15:58
estimated_db_size 1904.34 MiB
database_engine sqlite
database_version 3.40.1
Spotify
api_endpoint_reachable ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

From 2023.5 i have this error in my log.
Gladly I still get updates.

Working with HA in a VM in Proxmox

Reproduction steps

...

Debug logs

Deze fout is ontstaan door een aangepaste integratie.

Logger: urllib3.connectionpool
Source: custom_components/tgtg/sensor.py:189
Integration: tgtg (documentation, issues)
First occurred: 16:01:12 (80 occurrences)
Last logged: 16:22:12

Connection pool is full, discarding connection: apptoogoodtogo.com. Connection pool size: 10

Diagnostics dump

No response

Now i do get this error:

Logger: homeassistant.components.sensor
Source: custom_components/tgtg/sensor.py:189
Integration: Sensor (documentation, issues)
First occurred: 16:35:40 (1 occurrences)
Last logged: 16:35:40

Error while setting up tgtg platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tgtg/sensor.py", line 76, in setup_platform
add_entities([TGTGSensor(each_item_id)])
File "/config/custom_components/tgtg/sensor.py", line 96, in init
self.update()
File "/config/custom_components/tgtg/sensor.py", line 189, in update
self.tgtg_answer = tgtg_client.get_item(item_id=self.item_id)
File "/usr/local/lib/python3.10/site-packages/tgtg/init.py", line 284, in get_item
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (403, b'{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMA4P6606HYrbcAVPUifw==&cid=5MycTOOzA~eJNL0TB1oW1wvNe25A1oVnLsmd5QEwgISUjU_hyYmrUzsBmbKtuOiz6uBPwa4m3UOkWp3gKciavl-HwX4bp1U7oHaTslT5x4DLvPuX3Zg0NWiL33e-CARr&referer=https%3A%2F%2Fapptoogoodtogo.com%2Fapi%2Fitem%2Fv7%2F200266&hash=1D42C2CA6131C526E09F294FE96F94&t=bv&s=35558&e=f3f9e0e98bbe2a1eb62602038853df755cdf4f3ee5f5adccf1310f6d406268fa"}')

If i use the web adres in a browser, i'll get the error page "Blocked"

same here, and all entities are unavailable

Too good to go updated their API.
Release https://github.com/Chouffy/home_assistant_tgtg/releases/tag/5.2.0 should fix it.

Can confirm it’s working again. Thanks for the quick fix @tjorim 👍🏻👍🏻👍🏻👍🏻👍🏻