Can't clone rule steps: Error: Cannot invoke method clone() on null object

I've tried cloning a couple of steps I have in a rule and get:

Error: Cannot invoke method clone() on null object

After that, the rule is broken, when I click on the steps again I keep getting that error. Only thing I can do is restore the DB. I can work around but wanted to share in case there was something diagnostic I could share to address the bug.

This is what's in the logs:
[error] java.lang.NullPointerException: Cannot invoke method clone() on null object on line 2892 (method selectActions)

What do you mean by "cloning"? Copy/paste? At what step in the process do you get the error? What build are you on?

2.3.4.112

Yes, I guess it's copy/paste in the RM UI. I was using the term from the error.

I played around with it a bunch and it seems like a very specific edge case. In this case, if I select the last 2 of 3 actions in my rule and hit the copy button. Any other combo seems to work.

1 Like

It would sure help if you could show what this looks like right before it blows up.

I ended up editing the rule to make the changes I needed without copy / pasting. Now I'm unable to recreate the issue. It must have been a corner case specific to the steps in my rule. I'll be sure to grab screenshots going forward.

I’ll play! I just had Rule Machine throw the same error and now the rule seems permanently broken (I can’t edit the action block anymore without evoking the error).

Attached are photos of the rule and the error in the log.

I caused the error by copying both of the Open:Gate and Open:Garage commands in the first IF block and then attempting to paste both commands to the ELSE-IF block just above the On:Relay Garage command.


That is also what happened to me. It was challenging to keep reproducing because I had to keep restoring a backup every time I broke it.

What release are you on?

Try as I might, I can't get this failure to happen. I need to know more specifically where you are trying to paste it, before which action. "the ELSE-IF block" is not specific enough".

Since you can mark the screenshot, how about providing an arrow showing where it happens?

Also, Export this rule and email it to me (see PM).

I think newest release 2.3.4.115, otherwise 2.3.4.114.

To copy the rule: I checkmarked both Open:Gate and Open:Garage, hit the copy button at the bottom, and hit the paste button to the right of the On: Relay Garage step to try and paste both the copied steps before that step.

I will email you the exported rule.

Argh, I've just run into this error and im not even sure how I caused it! And now I cant get back into the rule to even try fixing it:

Here's the JSON:

PS, Im on 2.3.4.116

That is a defining characteristic of this bug - I needed to restore from backup or rebuild the rule each time I broke it while troubleshooting.

Unfortunately, it was a rule I was building from scratch and I don't have a backup. :weary:

It wasnt even a complex rule either:

I ran into this as well. The way I triggered it is with this rule:

I had just copied the third to last rule (the rule in which I set thermostats), in order to clone it into the while condition. When I went to clone the action at the end, it failed on me and then whenever I open the action page, I get the same error as above.

I don't know what is causing this problem, but will put in a bandaid fix. That at least will stop the rule from crashing. Perhaps if there is some other bug, it will become more evident.

1 Like

Just had this happen and provoked it by clicking on the Copy without having anything selected to copy. Just willy-nilly clicking forgetting what steps come when in this new interface. Stupid mistake....but it did break a rule I had spent some time on. Now in the process of upgrading to .117 in case that might shake the tree and allow me back into that rule. (Still broken, can't get back to editing the Actions, damn)

EDIT: Specifically I think I clicked on the + down there at the bottom on the copy line.

EDIT 2: OK trying to be more specific for you Bruce @bravenel
image

I'm still learning this interface so excuse the ignorance on how I got to the point that my click caused the error but the last item under the Actions list was this line, I THINK I clicked on that plus sign with the intent to create a new action w/o thinking that CREATE NEW ACTION was not showing when I did.

In hindsight I must have done something to cause the clipboard to show up.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.