Driver errors when using Node RED

Hello - last night I started getting what looks like a "corrupt database" error on one of my devices (light/Inovelli switch). I downloaded a backup and did the soft reset and restore dance but I am getting the same error again.

Subject: Log: error - Porch Light
Message: Date/Time: 2022-12-22 06:52:07.403
Message: java.lang.RuntimeException: java.sql.SQLException: Unique index or primary key violation: "PUBLIC.DEVICE_SETTING"; SQL statement:
MERGE INTO DEVICE_SETTING (VERSION, NAME, TYPE, VALUE, DEVICE_ID) KEY (DEVICE_ID, NAME) VALUES (1, ?, ?, ?, ?) [23505-214] Query: MERGE INTO DEVICE_SETTING (VERSION, NAME, TYPE, VALUE, DEVICE_ID) KEY (DEVICE_ID, NAME) VALUES (1, ?, ?, ?, ?) Parameters: [parameter13custom, number, 237, 697] on line 1149 (method parse)

Thoughts on what to try next?

What driver are you using? (Can't claim to help, just guide you in the right direction....)

The Inovelli driver - just updated the driver via HPM a few days ago.

I'd suggest contacting the developer of the driver (Eric) to work out why the DB error has started occurring, particularly around line 1149 of the parse method.

1 Like

Tagging @ericm ...

Eric: It looks like this is happening when I change the LED color. I am using Node-RED to manage my automations. When the light turns on, the LED turns green, when it turns off, it goes back to blue.

Line 1149 in my version of the driver code is:

Any help would be appreciated... Thanks!

1 Like

Given you are using NR, if I can add another request, and I may be misreading your last post.... But what are you calling from NR when the error occurs? Is that what you are screenshotting?

Is your Diagnostic Tool on the latest version? If not, please update and run another Soft Reset...

2 Likes

The screenshot if from the driver code.

My Node-RED flow is below:

I set the msg.arguments in the change node as below:

1 Like

Or take advice from the experts :wink:

Bobby - I may be dot version behind, but platform is 2.3.4, so I think I have the latest Diagnostic Tool?

Wow, two experts, you are lucky / important :slight_smile:

1 Like

The platform is independent of the Diagnostic Tool, so having the latest platform version doesn't mean you have the latest Diagnostic Tool. Although, this may not be an effect of a database corruption as I initially thought.

2 Likes

This looks more like a reproducible logic flaw to me. I doubt that a soft reset will fix it.
Granted, the driver may be doing something weird here (and I don't really want to review the entirety of driver code), but platform should be able to manage it. I'll take a look.

4 Likes

Thanks

Diagnostic Tool is 1.0.97 - is that the latest?

1 Like

Yes.

1 Like

I can disable the logic for that flow for now and see if the error goes away. I have similar logic on 2 other Inovelli switches (they turn "red", not "green") and I haven't seen errors there.

2 Likes

Yeah, let's try that. I got enough information in the thread to dig into it on my end.

3 Likes

Looks like I am behind the latest driver. I don't have the May 4th bug fix :slight_smile: I have too many LZW31-SN to count and never had a problem (just a data point reference)....

2 Likes

I have a few (4 or so) too and only this one seems to have an error. It looks like disabling the automation to change colors fixes the error (meaning I don't get the error any more) but then I don't get the visual notification that the light is on/off, door is locked/unlocked!

1 Like

Not familiar with NR, so the obvious question is what's different between this flow and the others that work? If you use the param from one that works, does this switch also work without throwing errors?

1 Like