-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Random restarts of Node-RED caused by Shelly plugin #157
Comments
Thanks for reporting. I wonder why you have two nodes with the same IP? |
One just to get status every 1s and one for switching ON / OFF every 15 minutes - water heaters while feed in energy (solar) |
@MrMysakovich I can only see a portion of your flow.... you are using the same IP address in different nodes All of your nodes poll the shelly every 5 seconds which means that it can happen that you poll the same shelly at almost the same time from two nodes.
|
Yes, because I use the first node for inject every 1s (status) and the second one every 15 minutes for switching ON / OFF.
|
@MrMysakovich I am running your flow here and it seems to work fine... after what time did you get the restarts? |
@MrMysakovich I see that you trigger your node with an inject node. And at the same time you poll the device every 5000ms. This does not really make sense to do it twice. Either you use mode none and the inject node or you remove the inject node and let the shelly node poll for you. In addition to that: if you only want to be noticed when the some switch is triggered then you better use callback mode. Until now your flow works here without problems. Do you use additional flows that may cause additional CPU load or do you run the flow on a low performance hardware like a raspberry? |
@windkh I already have it set to "none" and it still restarts Node-RED with the same log output (even Shelly node sometimes says 5000 ms time exceeded even when I have set polling to "none") I have in the same flow also modbus-getter to Solax Hybrid G4 and I read live data from it. Running Node-RED on Raspberry Pi 4B 8GB ram - Homebridge image. |
Ok then it means that sending the command request to the shelly timed out. I assume that you are running the raspi via wifi? |
No, wired and I never had problem with Shelly through Homebridge. Really don’t know why it happens :/ |
@MrMysakovich |
@windkh please install V10.25.1 |
@windkh I updated it. Thank you. Lets see it in few days. Maybe it could be caused that Homebridge image doesn't work well together with Node-RED? |
@MrMysakovich well the call stack is the same as mine here but my node-red does not restart. I wrap all requests to the shelly with a try catch to avoid that node-red will crash. In you callstack it seems that there was no catch somewhere. In my code I could not find the problem as there are many requests that could cause that. So I added unique timeouts to every request |
@windkh So it crashed again, but unfortunately I do not have logs, because somehow logging stopped working. Could you help me please to setup settings.js to log everything? |
@MrMysakovich can you not just copy the output of the console? |
The main problem is that I get the NR log as a service from the Homebridge terminal, and the logging is active until I exit the window.
This time there was no restart of NR. |
UPDATE: So far, Node-RED hasn't rebooted yet. Let’s see in few more days. |
I had a look at my node-red logs for another reason but found the same crashes as @MrMysakovich. My setup: In the logs I have about one to two exceptions with a restart of node-red. Here are the latest four:
It's always 5022 ms timeout. I hope this helps you find the problem. |
New update: Although writing logs doesn't work in my setup now, Node-RED keeps restarting. |
@MrMysakovich I released 10.25.2 a few minutes ago. I refactored some internal things, please give it a try... maybe it works now. Please let me know .... |
@windkh Thank you really much, we will see in a few days... |
So NR has rebooted randomly again today. Somehow I didn't catch the log (logging in NR still doesn’t work) |
With version 10.25.2 I had a reboot today as well:
|
thanks for the log... I need to think about how to solve it... |
@MrMysakovich Interestingly the line numbers are different. E.g. http.js:647:16 in my callstack, in your one axios.cjs:3123 see below. Mine is "1.6.8" (the latest one available is 1.7.2= 26 Jun 21:53:24 - [warn] [shelly-gen2:e8443a89795c5ba5] AxiosError: timeout of 5022ms exceeded |
I have axios version 1.6.8 as well. |
I'd really like to help fix this error, I'm curious about the cause. I'm a software developer myself, but I mainly work with .NET and C, only little JavaScript. I don't know about JavaScript's promises and how a try-catch around an async call behaves, but your code looks like it should catch the timeout exception. The differences in the stack traces probably result from the type of Node-RED installation. I guess that the code in
I am relatively new to Node-RED. I installed it just 3 months ago. Therefore I still have the whole log :) So here's a little timeline I reconstructed from the log: Right from the start I installed node-red-contrib-shelly 10.18.0 and node-red-dashboard 3.6.5 on April 2nd. The first uncaught exception occured on June 5th in the morning. I didn't notice it, only just a few days ago when I commented here. I upgraded node-red-contrib-shelly to 10.25.0 on the same day of the exception (June 5th) in the evening (after the exception). Upgraded node-red-contrib-shelly to 10.25.1 on June 17th. Upgraded node-red-contrib-shelly to 10.25.2 on June 24th. The last package I installed was node-red-node-email 2.2.1 on May 29th. Since then my Node-RED ran without manual restarts/reboots until the first exception on June 5th. Overall I have 46 uncaught exceptions in my log which restarted Node-RED. Interestingly, there are 2 axios timeouts just as warnings without stack traces and no restart of Node-RED:
I hope this helps. If you want, I can send you the whole logfile by mail. |
My Node-RED is installed through this script: on Homebridge Image |
@floppes |
Ok, we can try a Teams meeting. From your name I guess you are German like me? You can e-mail me your preferred time for a meeting: floppes [at] gmx [dot] de Another thing that came to my mind: I enabled authentication in my Shelly devices a few weeks ago. It must have been June 4th because that's when I have the first entry of this kind:
That was the night before the first uncaught exception! I am still getting this error from time to time (58 times in total) even though the credentials are stored in the nodes. I will disable authentication now. Maybe this is the cause for the exceptions... |
The latest one so 10.26.0 |
@MrMysakovich please retry with 10.27.0 |
@windkh you mean 10.26.2? I updated it. Let’s see, thanks |
No 10.27.0 |
I just released it a few minutes ago... maybe the nr server needs some time to outroll it |
Updated. |
Now this, one random restart of NR happened.
|
|
It has been running fine for me for the last days, but this morning I got two undhandled exceptions again:
I was still on 10.26.0 und will update to 10.27.3 now. |
Hi, Regards |
same for me: `=================
|
Sorry for delay: I am back from vacation... any news here? I will fix this if I am able to reproduce it. Any ideas? |
@windkh Hi, I hope you enjoyed your vacation! |
@MrMysakovich please send me your flow. And the output of the console with node-red nodejs version. Shelly nodes version. |
@windkh Look up, it's still the same flow. I am creator of this thread. |
@MrMysakovich what version of the nodes do you use? |
@windkh 10.28.2 so the latest one. NR rebooted 127 times in the last 5 hours |
@MrMysakovich can you please upgrade to 11.0.1. Let me know if something changed. Thanks in advance. |
@windkh I updated it. I will let you know in one week. Thank you |
@windkh I updated to 11.0.1 a week ago and had one restart since then:
Did you try to reproduce the error with authentication enabled in the Shelly device? |
@floppes |
I have authentication ON as well. As you see, after update of plugin, NR had to reboot 139 times.
|
@windkh yes For most Gen2 devices, I have disabled the polling option and use mqtt instead. |
I need someone who can show me this in a teams meeting. Anyone here who is willing to show me what is going on? |
Hallo Karl-Heinz
Ich hatte die Probleme habe jetzt komplett auf MQTT umgestellt, habe die alten Flows aber noch. Können gerne mal telefonieren.
Gruss Stefan
Stefan Müller
0172-2315449 oder +45 24890661
… Am 20.10.2024 um 16:34 schrieb Karl-Heinz Wind ***@***.***>:
I need someone who can show me this in a teams meeting. Anyone here who is willing to show me what is going on?
—
Reply to this email directly, view it on GitHub <#157 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJVAXATNXHPDSRFLHZMBDT3Z4O5NTAVCNFSM6AAAAABJA7X3PCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRVGAYTKOJSG4>.
You are receiving this because you commented.
|
@windkh Wenn noch Bedarf besteht, können wir gerne ein Meeting machen. Bei mir passt es unter der Woche am besten zwischen 16:00 und 18:00. Schreib mir gerne an floppes [at] gmx [dot] de. |
@floppes ok danke mach ich... dann bekommen wir das vielleicht mal gebacken |
Hi,
I need some help with an issue I'm encountering.
I'm getting these error messages whenever there's a random restart of NR:
My setup:
Can anyone help me figure out what I'm doing wrong?
The text was updated successfully, but these errors were encountered: