Skip to content
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

Gateway connection glitch causes restart of Node-Red (uncaught) #126

Open
camphamp opened this issue Jun 30, 2023 · 4 comments
Open

Gateway connection glitch causes restart of Node-Red (uncaught) #126

camphamp opened this issue Jun 30, 2023 · 4 comments
Labels
wontfix This will not be worked on

Comments

@camphamp
Copy link

camphamp commented Jun 30, 2023

Occasionally, I notice Node-Red crashing/restarting and the syslog notes the cause as the "tuya-smart-device" node (syslog):

`
Jun 30 10:55:11 raspberrypi Node-RED[4188]: 30 Jun 10:55:10 - [info] [tuya-smart-device:Gateway] startComm(): Connecting to Tuya with params {"id":"MASKED","key":"MASKED","ip":"","issueGetOnConnect":false,"nullPayloadOnJSONError":false,"version":"3.1","issueRefreshOnConnect":false} , findTimeout : 10000 , retryTimeout: 1000

Jun 30 10:55:11 raspberrypi Node-RED[4188]: 30 Jun 10:55:10 - [info] [tuya-smart-device:Gateway] findDevice(): Initiating the find command

Jun 30 10:55:15 raspberrypi Node-RED[4188]: 30 Jun 10:55:15 - [info] [tuya-smart-device:Gateway] findDevice(): Found device, going to connect

Jun 30 10:55:15 raspberrypi Node-RED[4188]: 30 Jun 10:55:15 - [info] [tuya-smart-device:Gateway] Connected to device! name : Gateway, ip :

Jun 30 10:55:52 raspberrypi Node-RED[4188]: 30 Jun 10:55:52 - [red] Uncaught Exception:

Jun 30 10:55:52 raspberrypi Node-RED[4188]: 30 Jun 10:55:52 - [error] Error: socket hang up

Jun 30 10:55:52 raspberrypi Node-RED[4188]: at connResetException (node:internal/errors:705:14)

Jun 30 10:55:52 raspberrypi Node-RED[4188]: at TLSSocket.socketOnEnd (node:_http_client:518:23)

Jun 30 10:55:52 raspberrypi Node-RED[4188]: at TLSSocket.emit (node:events:525:35)

Jun 30 10:55:52 raspberrypi Node-RED[4188]: at endReadableNT (node:internal/streams/readable:1358:12)

Jun 30 10:55:52 raspberrypi Node-RED[4188]: at processTicksAndRejections (node:internal/process/task_queues:83:21)

Jun 30 10:55:52 raspberrypi systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE

Jun 30 10:55:52 raspberrypi systemd[1]: nodered.service: Failed with result 'exit-code'.

Jun 30 10:55:52 raspberrypi systemd[1]: nodered.service: Consumed 18min 19.971s CPU time.

Jun 30 10:56:12 raspberrypi systemd[1]: nodered.service: Scheduled restart job, restart counter is at 7.

Jun 30 10:56:12 raspberrypi systemd[1]: Stopped Node-RED graphical event wiring tool.

Jun 30 10:56:12 raspberrypi systemd[1]: nodered.service: Consumed 18min 19.971s CPU time.
`

I installed an "exception catch node" for the flow but it doesn't report any error nor does it prevent the Node-Red crash.

The device that it was in the midst of connecting to is a TUYA Gateway:
Product Name GW018-DM

The last Tuya cloud ping from that device stated:
signal intensity:-35||Remaining memory:1896128||UTC:1688135839||time zone:-05:00||DST:1688139439

@kevocl
Copy link

kevocl commented Jul 4, 2023

I have the same issue. When trying to connect to the device the node brings the whole docker container down.

docker logs:

4 Jul 10:54:37 - [info] [tuya-smart-device:Bliss] startComm(): Connecting to Tuya with params {"id":"**MASKED**","key":"**MASKED**","ip":"10.0.0.98","issueGetOnConnect":false,"nullPayloadOnJSONError":false,"version":"3.3","issueRefreshOnConnect":false} , findTimeout :  99983 , retryTimeout:  50000
4 Jul 10:54:37 - [info] [tuya-smart-device:Bliss] findDevice(): Initiating the find command
4 Jul 10:54:42 - [red] Uncaught Exception:
4 Jul 10:54:42 - [error] TypeError: Cannot read properties of undefined (reading 'payload')
    at Socket.<anonymous> (/data/node_modules/tuyapi/index.js:985:30)
    at Socket.emit (node:events:513:28)
    at UDP.onMessage [as onmessage] (node:dgram:930:8)

@leodesigner
Copy link

Looks like I have related issue.
After a while smart device node hangs in "Connecting" state.
It's not possible to reconnect to a device. Only node red redeploy helps.

@bigfeetneedbigboots
Copy link

Getting similar/same issue with Node-RED repeatedly crashing after an uncaught exception from this node. Using Tuya thermostats.

Screenshot 2023-09-03 at 3 45 08 pm

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants