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

403 error when trying to add integration #222

Open
peter-bosch opened this issue Nov 7, 2023 · 7 comments
Open

403 error when trying to add integration #222

peter-bosch opened this issue Nov 7, 2023 · 7 comments

Comments

@peter-bosch
Copy link

Version of the custom_component

v0.1.8

Installation method (hacs / manual)

HACS

Installation method of hass (venv, docker, hassio,...)

docker

Configuration

N/A, added via integration

Describe the bug

When trying to add the integration, it takes a couple of minutes and the logs subsequently show a 403 error. All added entities are "unavailable" and lots of them are missing (SoC etc).

I do also have the Cupra WeConnect integration installed for my other half's car, not sure if that's conflicting?

I have tried removing the integration, reinstalling it, restarting HA (also between removing and reinstalling) but to no avail. Anyone else have any idea how to fix this?

Debug log


Logger: homeassistant.components.number
Source: helpers/update_coordinator.py:258
Integration: Number (documentation, issues)
First occurred: 21:13:20 (1 occurrences)
Last logged: 21:13:20

Error while setting up volkswagen_we_connect_id platform for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 242, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/__init__.py", line 53, in async_update_data
    await hass.async_add_executor_job(_we_connect.update)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 193, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 202, in updateVehicles
    data = self.fetchData(url, force)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 388, in fetchData
    raise RetrievalError(f'Could not fetch data. Status Code was: {statusResponse.status_code}')
weconnect.errors.RetrievalError: Could not fetch data. Status Code was: 403

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 353, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/volkswagen_we_connect_id/number.py", line 28, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: Could not fetch data. Status Code was: 403


@sebking1971
Copy link

Having the same here - very occasionally will see a sensor display - same errors as above

@legantois
Copy link

same for me

@bagges
Copy link

bagges commented Nov 19, 2023

Same here. Even increasing the interval to 90s does not help. I have registered two accounts.

@akunia
Copy link

akunia commented Nov 19, 2023

Hi same problem for me.
Isn't related to ? :

"We'd like to inform you that the ‘We Connect’ smartphone app will be deactivated and operations will cease on 08/11/2023.

From then on, you will be able to use the Volkswagen app to access We Connect functions previously run by the We Connect app. You can download the Volkswagen app here in the Google Play store or here in the Apple Store."

@ColinRobbins
Copy link
Contributor

I’ve had the integration working for a long time, but am now seeing 403 error too.

@aogriffiths
Copy link

Me too. Here are the logs I’ve got.

This error originated from a custom integration.

Logger: custom_components.volkswagen_we_connect_id
Source: helpers/update_coordinator.py:290
Integration: Volkswagen We Connect ID
First occurred: 06:22:04 (2 occurrences)
Last logged: 06:22:04

Unexpected error fetching volkswagen_we_connect_id data: Could not fetch data. Status Code was: 403
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/__init__.py", line 53, in async_update_data
    await hass.async_add_executor_job(_we_connect.update)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 193, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 202, in updateVehicles
    data = self.fetchData(url, force)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect/weconnect.py", line 388, in fetchData
    raise RetrievalError(f'Could not fetch data. Status Code was: {statusResponse.status_code}')
weconnect.errors.RetrievalError: Could not fetch data. Status Code was: 403

pdcastro added a commit to pdcastro/volkswagen_we_connect_id that referenced this issue Feb 9, 2024
Related to issues mitch-dc#211, mitch-dc#215 and mitch-dc#222 insofar as reducing the polling frequency
reportedly avoids WeConnect API errors (e.g. 403, 429) when the servers are busy
(API call rate limiting / throttling).
@nyordanov
Copy link

Same here. Lots of 403 errors since yesterday, and trying to set up the integration from scratch didn't help either:

Logger: custom_components.volkswagen_we_connect_id.config_flow
Source: custom_components/volkswagen_we_connect_id/config_flow.py:65
integration: Volkswagen We Connect ID
First occurred: 18:14:11 (1 occurrences)
Last logged: 18:14:11
Unexpected exception

Traceback (most recent call last):
  File "/config/custom_components/volkswagen_we_connect_id/config_flow.py", line 65, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/config_flow.py", line 40, in validate_input
    await hass.async_add_executor_job(update, we_connect)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/__init__.py", line 223, in update
    api.update(updatePictures=False)
  File "/usr/local/lib/python3.12/site-packages/weconnect/weconnect.py", line 194, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect/weconnect.py", line 232, in updateVehicles
    raise catchedRetrievalError
  File "/usr/local/lib/python3.12/site-packages/weconnect/weconnect.py", line 216, in updateVehicles
    vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict, fixAPI=self.fixAPI,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 133, in __init__
    self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 227, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect/elements/vehicle.py", line 338, in updateStatus
    data: Optional[Dict[str, Any]] = self.weConnect.fetchData(url, force)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect/weconnect.py", line 399, in fetchData
    raise RetrievalError(f'Could not fetch data. Status Code was: {statusResponse.status_code}')
weconnect.errors.RetrievalError: Could not fetch data. Status Code was: 403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants