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

[547347822528] network error:(-9999999) sign invalid #114108

Open dpgh947 opened 3 months ago

dpgh947 commented 3 months ago

The problem

I have a node red flow that runs at 00:45 every night to turn off my table lights in case any are left on. Last night it caused this error. It comes via a call service node that calls the general homeassistant turn_off service, passing a group containing lights, and one additional light entity that is not in the group. It has been running for ever, and running it manually this morning works fine. I upgraded to core-2024.3.3 yesterday, I don't know if that is coincidence, or if the error is in HA/websocket/Tuya integration. Nothing else in the logs around this, everything is working fine.

What version of Home Assistant Core has the issue?

core-2024.3.3

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 (possibly)

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.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 00:45:00 (1 occurrences)
Last logged: 00:45:00

[547347822528] network error:(-9999999) sign invalid
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 138, in async_handle_turn_service
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 930, in entity_service_call
    raise result from None
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1570, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 639, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1653, in async_turn_off
    await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs))
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tuya/light.py", line 631, in turn_off
    self._send_command([{"code": self.entity_description.key, "value": False}])
  File "/usr/src/homeassistant/homeassistant/components/tuya/base.py", line 277, in _send_command
    self.device_manager.send_commands(self.device.id, commands)
  File "/usr/local/lib/python3.12/site-packages/tuya_sharing/manager.py", line 93, in send_commands
    return self.device_repository.send_commands(device_id, commands)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tuya_sharing/device.py", line 180, in send_commands
    self.api.post(f"/v1.1/m/thing/{device_id}/commands", None, {"commands": commands})
  File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 192, in post
    return self.__request("POST", path, params, body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tuya_sharing/customerapi.py", line 121, in __request
    raise Exception(f"network error:({ret['code']}) {ret['msg']}")
Exception: network error:(-9999999) sign invalid

Additional information

No response

home-assistant[bot] commented 3 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)

kstrehan commented 2 months ago

Update: It appears that everything has been working as expected for me since the 2024.4.1 update.


I'm having a similar issue with the same error. I do have Tuya devices, but I am using Tuya Local for all but 1 of them. It could be that particular light that's causing the issue, but I haven't noticed any problems with operating it normally throughout the day with voice, app, or smart switch control.

In my specific case, I have a Leaving Home script that I created in Home Assistant. I have this script exposed to Google Home via Home Assistant Cloud's integration. I generally use my Google Home speaker to initiate the Leaving Home script.

I have recently noticed that I come home with my home security not armed and some lights still on, although not all of them. I just checked the logs of my automations in Home Assistant, and it looks like the error happens for me during the lights off stage of the script. I also noticed in the Related Logbook Entries section of the Traces page that there's an entry for "Leaving Home Script turned off triggered by state of Leaving Home Script turned on". So it looks like the script is maybe somehow disabling itself? I'm not really sure. I have attached some screenshots to show these cases.

If there's any additional information or logs I can provide, please let me know! I'd like to assist in troubleshooting this issue.


Screenshot 2024-04-06 210048 Screenshot 2024-04-06 210315 Screenshot 2024-04-06 210611 Screenshot 2024-04-06 212047

AcaN95 commented 2 months ago

I have tuya mini switch and a lot of other tuya devices

Whenever I want to control tuya devices, I get error network error:(-9999999) sign invalid

Has anyone had the same problem and what is the cause, as well as the solution to it:?

AcaN95 commented 2 months ago

Since I didn't notice this problem before. The changes that potentially led to this are..

Tuya mini is connected to the doorbell

I created a script that looks like this

`alias: ZvonoZvoni sequence:

I use Tuya integration.

The script (the automation), worked a couple of times

And after that the doorbell stopped ringing :D I get the above error and I can't control any other tuya devices either, reloading the integration solves the problem, but only for a short time or for a couple of script calls.

jonwaland commented 1 month ago

its a cloud issue I believe - https://github.com/home-assistant/core/issues/115344