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%?


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, 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]( for more information.

Error: For input string: "1570232459284"

Error in log

[app:484] ( 09:52:05.996 am [error]( 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

Argh, @bcopeland I just had this happen to me after RM crashed while editing a rule:

[app:277]( 01:25:32.234 pm [error]( Cannot invoke method tokenize() on null object on line 2699 (selectActions)

and now I cant edit it, aside from the trigger.

Ordinarily, I wouldn't care and I'd delete it and start over, but this is my huge GV data gathering rule that I've been working on for hours. :sob: I prolly should have left the IF, THEN, ELSE section out and put that in a separate rule triggered by the data changing.