-
-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Tesla integration goes unavailable (with traceback) #49354
Comments
tesla documentation |
|
Manually reloading the config entry did result in recovery |
Reload didnt work for me. I get Unexpected error fetching tesla data: tuple index out of range |
Same here, reinstall the integration result in being unable to sign-in withe error mentioned above and the error message on the login screen: "Unknown error occurred". Not using MFA. |
Yeah same here, also not using MFA. |
Same. Occurred following upgrade from 2021.4.4 to 2021.4.5. Reloaded, restarted HA and host. Not using MFA. |
Mine was fine after upgrading to 2021.4.5 for a while, it just started today for some reason. |
Maybe it was the sign-in after the restart that got me. |
I temporarily flipped back to the Homebridge Tesla plugin and re-enabled it. It's working fine, so it seems the issue is not on the Tesla side. |
Same getting the ```IndexError: tuple index out of range |
Having the same issue with and without MFA enabled. Reported upstream at zabuldon/teslajsonpy#190. |
Reload and reconfig as a new integration is not working 2021-04-18 21:29:10 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 107, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
result: dict = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/tesla/config_flow.py", line 57, in async_step_user
info = await validate_input(self.hass, user_input)
File "/usr/src/homeassistant/homeassistant/components/tesla/config_flow.py", line 159, in validate_input
(config[CONF_TOKEN], config[CONF_ACCESS_TOKEN]) = await controller.connect(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 268, in connect
cars = await self.get_vehicles()
File "/usr/local/lib/python3.8/site-packages/backoff/_async.py", line 133, in retry
ret = await target(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/controller.py", line 357, in get_vehicles
return (await self.__connection.get("vehicles"))["response"]
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 78, in get
return await self.post(command, "get", None)
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 96, in post
self.code = await self.get_authorization_code(
File "/usr/local/lib/python3.8/site-packages/teslajsonpy/connection.py", line 372, in get_authorization_code
code_url = URL(resp.history[-1].url)
IndexError: tuple index out of range |
Also have 2021.4.4 and am getting this tuple issue after restarting HA. After the initial Integration setup on my instance. |
Same same |
Everything worked until 2 days ago... 2021.4.5 didn´t change anything back to good. MFA is disabled |
Same ;) - stopped working with 2021.4.4 and doesn't work with 2021.4.5 |
Same here |
Same issue here with 2014.4.4 and .5, I see the issue is fixed and waits for merge teslajsonpy, hope this gets merged into a HA bugfix release |
Same error here. Let's hope the solution is merged soon. |
Looks like the suggested PR has been denied / closed: #46558 ?? |
Hello, same problem here ! |
All was working fine last Friday until I installed 2021.4.5. When HA rebooted, the Tesla integration had the |
Tesla is likely blocking the login attempt now on some unknown factor (e.g. user agent). I suggested a new architecture for logins in the closed PR as I believe that mechanism will be easier to maintain but that was denied. I will be continuing the new architecture as a custom component but will not be working on the login here. I will continue to review any PRs in the official integration so if you can code python you may have to step up. |
Not working with both latest updates |
I also use Teslamate. I have no issue there. |
Same here, stopped working even before updating to 2021.4.6. Which is logical since as alandtse said it's Tesla blocking the login attempt. |
Sorry stoped working after a while |
Just an observation, but if I reload the integration, around 50% of the time my Tesla data updates once, then fails again. |
Stopped working here too, following this thread for a solution |
RIP aiohttp Lets hope httpx helps us here. |
Custom component is out. I may have to change the name since it conflicts with core. Use HACS to install. If you're replacing core, you will need to remove your existing core integration and add the custom component. This will force a new login using the new method. If you're using my Alexa Media Player component, make sure you've signed in recently to AMP as the login will be broken in AMP until the next release. |
Works fine, very nice. 👍 Did need to "authenticate" 2 times, for it to login. |
works here too, well done!! |
Works great! i didn't have to authenticate twice like @tobbensoft did. Smooth transition. So is the "official" Tesla integration DOA then? Or can these httpx / aiohttp changes be made separate from the rejected PR? |
I don't intend to fix the login issues with config flow but the teslajsonpy library has the necessary functions so someone else could fix the login. Assuming it gets fixed, then I'll continue to review other commits that add functionality. Assuming they get merged, I'll also port them to the custom component. |
Little help please! Used HACS to install. Log file:
My configuration.yaml (snippet): |
That's the wrong component. From memory: Remove the "Homeassistant Teslacustomcomponent" component, and restart Home Assistant. In HACS search for and add the Tesla custom integration. Restart HA. In HA go to configuration, intgrations and click add integration. Search for Tesla and add "Tesla Custom Integration". Log in on the page that follows |
Worked! Thanks. |
Hi, gets the values with custom but gets this error in logs: Logger: homeassistant.helpers.integration_platform Unexpected error importing tesla_custom/group.py |
|
Really nice thanks, the plugin works. Would still be nice to have this in ha core though... |
Thanks works fine now |
Just to confirm, this is working fine for me. Thanks for all your work sorting it out. |
Teslajsonpy has switched from aiohttp to httpx which should resolve random connection issues. MFA will not work in this version. closes home-assistant#49354 closes home-assistant#46937 closes home-assistant#46156 closes home-assistant#30443
I just realized that I might be able to fix logins for anyone without MFA by updating the dependency. I am unable to test it as I use MFA, but it may work. If someone confirms it works for non-MFA, we can merge it in. Please check #49939 The custom component includes this fix plus MFA support and other quality improvements. EDIT: @bdraco has confirmed it has some additional work to get it to work. |
The problem
Unexpected error fetching tesla data: tuple index out of range
What is version of Home Assistant Core has the issue?
dev
What was the last working version of Home Assistant Core?
dev
What type of installation are you running?
Home Assistant Core
Integration causing the issue
tesla
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tesla/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: