core: Uncaught exception in Tuya integration
The problem
An uncaught exception is generating errors in the log file. Unsure if/how it affects the system.
What version of Home Assistant Core has the issue?
core-2022.2.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tuya
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tuya/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:319
First occurred: 06:30:57 (1 occurrences)
Last logged: 06:30:57
Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/site-packages/tuya_iot/openmq.py", line 158, in run
self.__run_mqtt()
File "/usr/local/lib/python3.9/site-packages/tuya_iot/openmq.py", line 172, in __run_mqtt
mqttc = self._start(mq_config)
File "/usr/local/lib/python3.9/site-packages/tuya_iot/openmq.py", line 192, in _start
mqttc.connect(url.hostname, url.port)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
File "/usr/local/lib/python3.9/socket.py", line 823, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (7 by maintainers)
Hold on now. I’m not closing this issue, I’m not saying it should not be fixed. I’m only saying that we should look into fixing this upstream.
I’ve done multiple PRs upstream to improve things. That way, not just Home Assistant benefits, but other consumers of that (officially created and maintained by Tuya)
tuya_iotPython client as well.I’m not sure why the rest of your rant there is needed or warranted; it sure sounds like you make a ton of assumptions there.
Anyways, good luck on your home automation journey 👍
…/Frenck
@jocamane Tuya is a complex beast, and yes, while there is a lot to do, there is also a lot of stuff that does work nicely. With over 14% of our user base using Tuya, I can assure you this specific issue isn’t common.
That said, this is an open source project, if you like to have a fix sooner, feel free to contribute one. This sounds harsh maybe, but not meant as such; This is how open source works.
Contributors (Volunteers) make around 1.000 fixes and changes each release (each month, based on the last year). And everybody does that out of free will, to provide a home automation platform that is open and free.
Feel free to chip in on that, or, well wait until someone steps up to help out (either me, some other contributor, or maybe even a Tuya developer).
after a good night’s sleep, I decided to bet on this project. So I’ll try to dedicate myself to it and try to help the community the best I can. Let’s see if it will be the correct bet. Thanks frenck
if you need help with something just say
It means that on this subject your answer is always the same. There are thousands of people with this problem but the problem is tuya. For my part, I have already decided to abandon HA and advise everyone I know and who has TUYA not to use HA, as long as the policy is the “ostrich putting its head in the sand” HA is not compatible with TUYA. if it doesn’t work well, it’s not compatible I already contacted tuya about this matter and what they tell me is that everything is well configured Thanks