Can't Edit Rule: Unexpected Error

I have an existing 4.0 rule. When I try to open the actions (to edit), the page does not open but instead I get an error message: "Unexpected Error."
Here's the log:

Were you using a variable in a context that ordinarily would be a number, using %variable-name%?

Yes.

I can't be certain, but I think I have a fix for this coming soon, in a hot fix release. Please do not delete that rule, so you can see if it is fixed.

It’s a LOCAL variable, by the way. I actually have several local variables in this rule,

A hot fix release is out that should fix this. Please let me know if it does or not. If it still throws an error, please post screenshot of the log like you did before.

Still getting error message after hub update.

OK, thanks. Please keep that broken thing around. I have to try a different theory about what might be wrong.

New hot fix release should fix this. Please let me know.

You fixed it! Thanks!

1 Like

Im running platform 2.1.3.128, but I’m still getting a very similar error when trying to edit one of my rules.

Unexpected Error
An unexpected error has occurred trying to load the app. Check Logs for more information.
Error: Command 'size' is not supported by device.

app:92019-08-07 07:50:22.605 pm errororg.h2.jdbc.JdbcSQLException: Column "disabled" not found [42122-197] on line 429 (ruleList)

That's a database error. If it persists you may have a corrupted database. The fix would be to reboot your hub.

@bravenel I rebooted my Hubitat but the error still persists unfortunately. Are there any other suggestions?

Thank you!

I forgot to mention that the error pops open when I try editing the triggers but works fine when trying to edit the action.

I also tried cloning the rule and editing the trigger but still received the same error.

Hmm. So I created a rule and used local variables for my xiaomi door sensors to store the last openned time. I used them to do a comparison of which one is larger to do a certain task dpeending on which one is larger (later openning time).

Problem is the device attribute is a string so the local variables that I said shoul dbe numbers seem to make the rule problem as per below.

I can't edit the rule, so I also can't delete it and start again (as I have other thoguths on recording when a door is opened).

Any suggesions as it appears I still have problems on an up to date hubitat box.

Error when editing rule.

#### An unexpected error has occurred trying to load the app. Check [Logs](http://192.168.1.25/logs) for more information.

Error: For input string: "1570232459284"

Error in log

[app:484] (http://192.168.1.25/logs#app484)2019-10-05 09:52:05.996 am [error](http://192.168.1.25/installedapp/configure/484)java.lang.NumberFormatException: For input string: "1570232462552" on line 472 (allHandler)

You can delete the messed up rule by opening its App Status page (gear icon left of the rule on the Apps Page). At the bottom of that page is where you can remove the rule.

Yes, a full epoch time value is too great to be stored in a number variable. You can however, store them in a decimal variable, and from there you could do comparisons, etc.

You can put it in a string variable, and you can convert that to decimal by setting a decimal variable using the "string" option.

Oh good.

I'll give that a shot later today. Hadn't realised that was an option when setting variables in rule machine.

So I have created a local variable as a string in my rule. Then I have set that variable to the device attribute lastOpenned which is a string. Now I am not sure how to convert it. Can this be done in rule machine or require coding?

As I was struggling with this device attribute to get as a decimal, I created a global variable that gets set as the current time in seconds. That gets triggered from the contact sensor being opened so effectively works the same I believe. Maybe I will leave it like that.

I have noticed that numbers seem to be a signed 32 bit integer so have a limit of 2,147,483,647 but this seems enough for many years to come.... Outside the lifespan of this box anyway.

You do it where you set a Decimal variable with the string that contains the time string.

1 Like