natekspencer / hacs-vivint

Home Assistant integration for a Vivint home security system.
MIT License
66 stars 6 forks source link

Can no longer authenticate in 2024.10.1 #148

Open Tuxrug opened 1 week ago

Tuxrug commented 1 week ago

The problem

After updating from 2024.7.0 to 2024.10.1, I get an error when starting the integration.

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 6:13:59 PM (1 occurrences)
Last logged: 6:13:59 PM

Error setting up entry homeassistant@tuxrug.net for vivint
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/vivint/__init__.py", line 64, in async_setup_entry
    await hub.login(load_devices=True, subscribe_for_realtime_updates=True)
  File "/config/custom_components/vivint/hub.py", line 96, in login
    self.account = Account(
                   ^^^^^^^^
TypeError: Account.__init__() got an unexpected keyword argument 'refresh_token'

I tried removing the integration and re-adding it but still got TypeError: Account.__init__() got an unexpected keyword argument 'refresh_token' when trying to log in at the username/password stage. This occurred both with and without MFA enabled for the account it is using. Reverting to 2024.7.0 allows it to log in again with a new emailed verification code.

What version of Home Assistant Core are you running?

core-2024.10.1

What was the last working version of Home Assistant Core?

No response

Anything in the logs that might be useful?

No response

Additional information

No response

natekspencer commented 1 week ago

What version of home assistant core are you running? It looks like it maybe didn't download the latest vivintpy library appropriately based on the error and I'm wondering if there might be a conflict. And can you try again, restart home assistant and upload the logs to see if there are any issues prior to that?

Tuxrug commented 1 week ago

home-assistant_2024-10-11T01-00-51.886Z.log I'm using the core 2024.10.1 docker image in podman.

Tuxrug commented 4 days ago

This still occurs in HA core-2024.10.2. I found the vivintpy folder where init.py listed version 2024.1.1. I renamed the vivintpy and vivintpy-2024.1.1.dist-info directories, re-updated through HACS, and restarted HA which re-created the vivintpy and dist-info folders, still referencing 2024.1.1 and I still receive TypeError: Account.__init__() got an unexpected keyword argument 'refresh_token' in the logs.

I removed the vivintpy folder and downgraded this integration to 2024.10.1b0 and restarted, and saw it create download vivintpy 2024.1.0 and then updated to b1 which downloaded vivintpy 2024.1.1. The issue still continues.

natekspencer commented 2 days ago

I've been unable to reproduce this unfortunately. The error seems to indicate that refresh token is being passed in but not expected, so it seems like the custom component code is correct (trying to use a refresh token), but the vivintpy account seems to not be expecting it, which makes me think it's still somehow conflicting with something else.

Tuxrug commented 2 days ago

Is there anything I can do on my end to help narrow it down further?

On Mon, Oct 14, 2024, 10:37 PM Nathan Spencer @.***> wrote:

I've been unable to reproduce this unfortunately. The error seems to indicate that refresh token is being passed in but not expected, so it seems like the custom component code is correct (trying to use a refresh token), but the vivintpy account seems to not be expecting it, which makes me think it's still somehow conflicting with something else.

— Reply to this email directly, view it on GitHub https://github.com/natekspencer/hacs-vivint/issues/148#issuecomment-2412880102, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATWLGUHSK7E2476YO35K7K3Z3SLZLAVCNFSM6AAAAABPX3LZLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJSHA4DAMJQGI . You are receiving this because you authored the thread.Message ID: @.***>

natekspencer commented 2 days ago

Are you able to bash into your docker container and run pip list | grep vivint?

Tuxrug commented 2 days ago

That command returns nothing, which surprises me because I'm currently running 2024.7.0 without any issues. It also returns nothing after redownloading 2024.10.1. pip list is returning things, just nothing matching the string "vivint", and the vivintpy folder is recreated in deps on restart if I rename it.

I tried pip install vivintpy and now pip list returns vivintpy 2024.2.0. However restarting the container causes it to no longer be listed, so it seems like I'm maybe not persisting something in the container that I should be and/or something is keeping vivintpy from installing correctly. Same thing happens if I do pip install vivintpy --target /config/deps but I do receive additional warnings/error output mostly around version conflicts doing that.

Installing collected packages: urllib3, pyjwt, pycryptodomex, protobuf, propcache, multidict, idna, grpcio, frozenlist, charset-normalizer, certifi, cbor2, attrs, aiohappyeyeballs, yarl, requests, aiosignal, aiohttp, pubnub, vivintpy
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
homeassistant 2024.10.2 requires aiohttp==3.10.8, but you have aiohttp 3.10.10 which is incompatible.
homeassistant 2024.10.2 requires attrs==23.2.0, but you have attrs 24.2.0 which is incompatible.
homeassistant 2024.10.2 requires urllib3<2,>=1.26.5, but you have urllib3 2.2.3 which is incompatible.
homeassistant 2024.10.2 requires yarl==1.13.1, but you have yarl 1.15.2 which is incompatible.
freebox-api 1.1.0 requires urllib3<2.0.0,>=1.26.6, but you have urllib3 2.2.3 which is incompatible.
meteofrance-api 1.3.0 requires urllib3<2.0.0,>=1.26.18, but you have urllib3 2.2.3 which is incompatible.
weheat 2024.9.23 requires urllib3<2.1.0,>=1.25.3, but you have urllib3 2.2.3 which is incompatible.
zhong-hong-hvac 1.0.12 requires attrs<24.0.0,>=23.1.0, but you have attrs 24.2.0 which is incompatible.
Successfully installed aiohappyeyeballs-2.4.3 aiohttp-3.10.10 aiosignal-1.3.1 attrs-24.2.0 cbor2-5.6.5 certifi-2024.8.30 charset-normalizer-3.4.0 frozenlist-1.4.1 grpcio-1.66.2 idna-3.10 multidict-6.1.0 propcache-0.2.0 protobuf-4.25.5 pubnub-8.0.0 pycryptodomex-3.21.0 pyjwt-2.9.0 requests-2.32.3 urllib3-2.2.3 vivintpy-2024.2.0 yarl-1.15.2
WARNING: Target directory /config/deps/urllib3 already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/jwt already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/PyJWT-2.9.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/pycryptodomex-3.21.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/Cryptodome already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/google already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/propcache-0.2.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/propcache already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/multidict-6.1.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/multidict already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/idna already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/idna-3.10.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/grpc already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/grpcio.libs already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/frozenlist-1.4.1.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/frozenlist already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/charset_normalizer already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/certifi already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/certifi-2024.8.30.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/_cbor2.cpython-312-x86_64-linux-musl.so already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/cbor2-5.6.5.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/cbor2 already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/attr already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/attrs already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/aiohappyeyeballs already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/aiohappyeyeballs-2.4.3.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/yarl already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/requests already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/requests-2.32.3.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/aiosignal already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/aiosignal-1.3.1.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/aiohttp already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/pubnub already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/pubnub-8.0.0.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/vivintpy already exists. Specify --upgrade to force replacement.
WARNING: Target directory /config/deps/bin already exists. Specify --upgrade to force replacement.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

I'm running HA as privileged in podman and mapping the entire /config directory to my local filesystem (-v /srv/homeassistant:/config)

smgilliam commented 1 day ago

I am also getting this after the last update.

i have version 2024.10.1 running on a pi

2024-10-16 18:36:36.293 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('vivint', '6b2bf93645ebc1ec51a44dc2daad94ea'): 90605.152042556} 2024-10-16 18:36:47.534 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:36:50.242 ERROR (SyncWorker_15) [homeassistant] Error doing job: Unclosed client session (None) 2024-10-16 18:36:50.247 ERROR (SyncWorker_15) [homeassistant] Error doing job: Unclosed connector (None) 2024-10-16 18:37:29.737 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:38:49.347 ERROR (SyncWorker_12) [homeassistant] Error doing job: Unclosed client session (None) 2024-10-16 18:38:58.329 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:39:18.637 DEBUG (MainThread) [vivintpy.account] Connecting to VivintSky

EDIT: After rebooting my Vivint panel, it works

natekspencer commented 19 hours ago

I am also getting this after the last update.

i have version 2024.10.1 running on a pi

2024-10-16 18:36:36.293 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('vivint', '6b2bf93645ebc1ec51a44dc2daad94ea'): 90605.152042556} 2024-10-16 18:36:47.534 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:36:50.242 ERROR (SyncWorker_15) [homeassistant] Error doing job: Unclosed client session (None) 2024-10-16 18:36:50.247 ERROR (SyncWorker_15) [homeassistant] Error doing job: Unclosed connector (None) 2024-10-16 18:37:29.737 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:38:49.347 ERROR (SyncWorker_12) [homeassistant] Error doing job: Unclosed client session (None) 2024-10-16 18:38:58.329 ERROR (MainThread) [custom_components.vivint.hub] Unable to connect to the Vivint API 2024-10-16 18:39:18.637 DEBUG (MainThread) [vivintpy.account] Connecting to VivintSky

EDIT: After rebooting my Vivint panel, it works

Yours was related to Vivint service interruptions I've been seeing today.