home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.72k stars 28.87k forks source link

Tuya failed to setup #115881

Open Smartdrive78 opened 2 months ago

Smartdrive78 commented 2 months ago

The problem

Suddenly my Tuya failed to setup.

`Logger: homeassistant.config_entries Source: config_entries.py:551 First occurred: 9:23:00 PM (1 occurrences) Last logged: 9:23:00 PM

Error setting up entry redacted for tuya Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/init.py", line 66, in async_setup_entry await hass.async_add_executor_job(manager.update_device_cache) asyncio.exceptions.CancelledError: Global task timeout `

What version of Home Assistant Core has the issue?

Core-2024.4.3

What was the last working version of Home Assistant Core?

Core-2024.4.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:551
First occurred: 9:23:00 PM (1 occurrences)
Last logged: 9:23:00 PM

Error setting up entry for tuya
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 66, in async_setup_entry
    await hass.async_add_executor_job(manager.update_device_cache)
asyncio.exceptions.CancelledError: Global task timeout

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

Smartdrive78 commented 2 months ago

I have a feeling I need to reauthenticate but how do I do this without deleting the integration and having to do all my stuff again?

also it doesn’t seem the debug logs are getting generated even when it is turned on.

echtornet commented 2 months ago

Same Problem here :(

TheOneOgre commented 2 months ago

Having issues authenticating, and even using the Tuya app itself for the last 30 minutes or so. Seems to be an API issue as of right now but could've been affecting users earlier. Does anyone happen to know if they have an API status page like the one cloudflare provides? Would be nice to know if it's the API causing issues on their end

Nautix1080 commented 2 months ago

Appears to be fixed and working fine for me this morning and after full Hassio reboot

TheOneOgre commented 2 months ago

Yeah, seems to have resolved itself during the night

jonwaland commented 2 months ago

also see https://github.com/home-assistant/core/issues/115344

djborsi commented 2 months ago

At me was the same problem with the integration. I tried to "reload" it and then all my devices disappeared. Next day morning I checked the account on Developer Account (https://iot.tuya.com/). And then I could see that my trial period for Service API "IoT Core" was expired, so I renew it, see instructions: https://github.com/home-assistant/core/issues/113955#issuecomment-2016529917. (I also have active these API: "Authorization Token Management", "Smart Home Scene Linkage")

Few minutes after renewing the "IoT Core" service I reload the integration and it worked again.

Does this mean that I need to have the API always active?

andreasbuff commented 2 months ago

Same Problem here! Tuya was "integrated" into HA-Core. Hence "IoT Core" service on Tuya-Developer-Account should no longer be necessary?! Right? After configuring Tuya Integration in Home Assistant. This Error occures some days, or week later, saying, that Tyua shall be re-Authenticated?! Please advise / help what to do. (I have another HA Instance, but there I do not have this kind of problems...!) Logger: homeassistant.config_entries Quelle: config_entries.py:551 Erstmals aufgetreten: 10:20:05 (1 Vorkommnisse) Zuletzt protokolliert: 10:20:05

Error setting up entry xxx.yyyy@hotmail.de for tuya Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/init.py", line 66, in async_setup_entry await hass.async_add_executor_job(manager.update_device_cache) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/manager.py", line 62, in update_device_cache devices_by_home = self.device_repository.query_devices_by_home(home.id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/device.py", line 106, in query_devices_by_home return self._query_devices(response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/tuya_sharing/device.py", line 124, in _query_devices self.update_device_specification(device) File "/usr/local/lib/python3.12/site-packages/tuya_sharing/device.py", line 132, in update_device_specification if response.get("success"): ^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'