Rule Machine - error?

I have a rule that has been running without issue for a while. I just went in to it today to tweak some of the settings. Now when I click on the "Actions" to edit something I get an error message:

errorgroovy.lang.MissingMethodException: No signature of method: java.lang.Integer.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), div(java.lang.Number), use([Ljava.lang.Object;), times(groovy.lang.Closure), div(java.lang.Character) on line 2494 (selectActions)

Anyone know how I can fix this? Do I need to delete and start over?

Can you restore the last backup before you went in to the rule? That might be the fastest way to fix it...

then I lose other changes I just made today. Would probably be easier to delete and re-write the rule. :frowning:

Correct... If that’s the case, re-creating it might be the best alternative. You could also try exporting it and re-importing it. I would be surprised if it worked, but worth a try! (Be sure to backup the hub first - it is still beta and, well, they recommend a backup...)

Today I "found" the same(?) error...

While saving a new action ("Wait for ...") I got this:

And this happens any time again I want to edit this rule actions... :cry:

The Log contains this messages:

You can see the first Exception from saving, and the other two while trying to get in edit mode again.

BTW: The rule is still working.

Any help or news?

It’s probably damaged.

You’ve got two choices:

(1) restore a backup from when it was working, or

(2) take a screenshot of the rule, delete (remove) the rule, recreate the rule.

Actually, there’s a possible variant if the only good backup of the rule is from the distant past and you have made many other changes to your DB since then: backup your current database, do a soft reset, restore that ancient working backup, export the rule, do a soft reset, restore the current database backup, import the exported rule.

Thank you very much for your answer! :+1:

Of course there is no backup because it's a new (but already complex) rule - so my daywork is lost... :roll_eyes:

BTW: I just want a working system - and no more workarounds...

--8<------ RANT ----------
I'm dealing with Hubitat since 13 days - and have already found too many bugs and unnecessary obstacles, where the answer was just "you can't undo this", or "the rule is messed up", or "restore your backup", or "the code is not open", or "no code editor for rule machine"(which would solve such problems easily), or "just write an app" (but there is no full documentation), ... :cry:
---------- RANT ------>8--

Sorry @672southmain, of course it's not your fault.

1 Like

Admittedly, Hubitat is a fragile system, or seems that way to me. I’ve been using it for about a year. It’s gotten better over time, but a whole new set of instabilities was introduced with the C-7/Z-Wave 700 chip.

I’ve made the journey from Wink to SmartThings to Hubitat C-5 to Hubitat C-7. Hubitat seems the best of these, but it’s not perfect. It’s better now, I just wish that it was more robust. I just want it to work.

1 Like

This is a bug that came about as a side affect of fixing another problem. I think this can be fixed fairly easily. Would you be so kind as to post the App Status - Application State portion, of this rule?

And, please show the rule itself so I can reproduce the problem.

1 Like

Actually, there is a (3) third choice: tag @bravenel so I can look into the error. RM should not throw any errors (ideal world, not reality). So when it does throw one, I'd like to know about it so it can be fixed. One exception is "Can't pop null list" error.

As a general rule, this should be the case for all built-in apps: they should not throw errors, and if they do we want to know about them. Tagging me is a good way to go to get attention to it.

AND: always use screenshots to show logs, not copy paste. PLEASE. It's hard to read copy/paste logs.

1 Like

With pleasure, but how can I do this? :thinking:
The Application State alone would be 6 screenshots...
Or is there a possibility to export that part of this rule?
Maybe Cut'n'Paste to you via PM?

The rule does not contain the new action I wanted to add and which introduced the error while saving. Before that action there was no problem...

What was the action? No point in App state if it's not in there.

If I remember right, I added an Wait for Event (or Condition?) action and clicked on "done" (to save the new action).
=> First time that the error message appears. After clicking "done" again (to confirm that message) the optical unchanged rule code appeared.

But something strange must still have survived in this rule - because it's error'ing everytime I hit the big "actions edit" button.

BTW, I've noted that this rule seems to run - but not to end correctly: When I call this rule from another, the other rule doesn't do anything after the calling Run Rule Action (indirectly by setting a Connector variable), what is very strange, as I thought that the two rules would be running concurrently... :thinking:

Well, I'd need to see all of the supporting information and log screenshots to make any sense of this. Have you turned on rule action logging. That's going to show in gory detail what the rule does or doesn't do.

Even the full log IMHO shows nothing strange - until I click on the actions edit button...

So, what can I do, what and how shall I send to you exactly?

Wait, talking past each other.

That's the sort of things logs reveal, and has nothing to do with an error when opening the rule to edit. If you can't open the rule to edit it without getting an error, then it's toast and needs to be removed. But before you do that, please take a screenshot from Application State (the gear icon should still work), for the state variable named "actionsMain".

Here it is:

Thanks. The error you reported above can only occur from a Wait action. I am not able to reproduce it by just adding a Wait for Events to a rule. So, I need some idea of what the action was with some specificity.

I (think that I) wanted to wait for the Custom Attribute "mediaSource" (Chromecast Audio Device)...

Mhhh, maybe I hit "Add another WaitEvent" and than - without specifiing anything - hit the "Done" button? :thinking:
BTW: Why is it there a "Done" but no "Cancel"? :wink:

IMHO it's strange that this ugly test rule is still running (and editable!):
BTW: How can I remove an empty Wait-For? :thinking:

However, I'm not able to reproduce the error message with a new rule. (In the meantime I had already done the big update.) The old rule is still error'ing...

These sorts of UI issues simply have not been caught up with. Having the functionality work when setup correctly was more important than catching every UI problem that can arise when not setup correctly.

1 Like