Closed WarrenEvans closed 3 years ago
Good Morning,
Thanks for reporting the issue. The backend driver, that this module uses, employs file locking.
And given the nature of pulling the power, means a file lock may still be... well ..... locked. There should be a 10s stale time however - so not sure why the locking mechanism seems to think, it all happened within 10 seconds (Though not impossible)
In any case, I don't recommend just pulling the power like this, but if you really need to, allow 5 seconds before restoring power - for the file lock to expire fully.
Or the better option, reboot correctly, which the file locking mechanism knows how to handle.
Also, You don't need to restart, just make a change on the controller node (renaming it is good enough), then redeploy, this will restart the driver.
In the mean time, I could look to work around this behaviour - But I am not overly excited, for building work arounds like this.
@WarrenEvans,
I have now implemented recovery logic. If, for whatever reason, there is a file lock upon startup, it will retry up to a maximum of 3 times (5 second wait in-between).
This also covers any other critical error, say if the USB stick suddenly has an episode of power loss.
I will try and push out an update later today.
V4.3.0 Released.
Contact Details (optional)
warrenevans@xtra.co.nz
What happened?
If you power cycle a pi4 with this pallet install, when the node red starts up the zwave device is stuck off line. Below is a cut from the log. Restarting Node red will fix the problem. It looks like the node red pallet is running before the Aeotec Z-Stick Gen5 is ready. The pallet does not retry the connection. 2021-07-22T23:33:00.586Z DRIVER « [RES] [GetSUCNodeId]
2021-07-22T23:33:00.594Z CNTRLR This is the SUC
2021-07-22T23:33:00.607Z DRIVER Failed to initialize the driver: Failed to lock DB file "/root/.node-red/zwave
2021-07-22T23:33:00.609Z NDERED [ERROR] [DRIVER] Failed to initialize the driver: Failed to lock DB file "/roo
2021-07-22T23:33:00.612Z DRIVER destroying driver instance...
2021-07-22T23:40:54.884Z NDERED « [EVENT] Payload received.
2021-07-22T23:40:54.887Z NDERED [ERROR] [INPUT] Node 20 does not exist.
How to reproduce?
to fix this problem, restart node red or do a soft reboot (with out removing power) on the pi4
Version
v4.1.0
Node-RED Version
1.3.x
What hardware are you seeing the problem on?
Raspberry Pi
Relevant Z-Wave-JS log output