Weird quirk when first editing rules after some time causes Broken item

I have noticed a repeated issue on my Hub when I go to edit rules after some elapsed time. Let's say I haven't done it in a couple of days.

I load up a rule, go in to add a new line, then I select the action, and then it does not allow me to complete and jumps back to the main rule display with the broken message. I delete the line, try again and it works fine.

I can then continue editing rules with no issues.

It doesn't happen every time, but enough that I notice. And this has been going on for a long time - perhaps years.

Things that I am watching that might cause it - updating the hub and/or restarting. I did update this morning and it did it right after this. So will look to check this next time I update.

Is it a big deal? Not at all. I just thought I would mention it to see if this is unique to my hub or if this happens to others. It is happening on my C8Pro. I have other hubs that I use but I centralize most of the rules on my C8Pro so I haven't seen it that I recall on the other hubs.

When this happens, did you already have the rule open in a tab from when you worked on it 4 days ago? Does this happen in Rule Machine, or another rule app?

It doesn’t sound like something that is normal, or that I’ve seen before.

I can't say how to repeat this, but I have seen it. It's very random. In fact just a few days ago I went to modify a rule and it sounds like I saw what you describe. Basically you go to add a action and it just jumps back to the action list and shows a broken action. Never gave me a chance to add anything.

@bravenel This just randomly happened to me on a rule that I haven't opened in ages.

  1. click + to add an action at the end
  2. chose control music player
  3. didn't give me a chance to choose a specific action or device and just returned to actions screen with broken action.
  4. cannot fix the action. I can open the action, but only option available is Cancel, and that button doesn't even respond.
  5. must reload app from Apps list.
  6. deleting the broken action by clicking trash in the right column returns expected functionality.

Detailed logs were not turned on. Nothing untoward was expected to happen. No other hubitat tabs/rules/pages open. I will turn on logs on another very similar rule before editing, though I suspect turning on logs and clicking done may fix whatever was wrong. I can try to export the other rule to preserve it and see if I can duplicate this issue.

If you have any suggestions or requests for testing, please let me know.

This is exactly the issue I was describing. I don't think it matters what you select as it returns to the main screen. Not sure if it is opening older rules on my end but will note that when it happens again.

1 Like

Do you have a music player installed in your system? I am not able to reproduce a problem with this action.

All I can say is that software itself is not random at all. I have never seen this happen in RM, and I create/edit a lot of rules. So, it's a mystery what would cause this. I know the code involved, and it does not do this. There has to be some user input, i.e., from the browser...

I can’t speak for Neerav but in my case it doesn’t appear to be related to any one particular action. It seems to be related more to time elapsed between editing rules. But that is only a guess.

I recognize that this is impossible to diagnose given the information. I was really posting to see if anyone else had seen this. And it appears that I am not alone.

I have to keep a screen recorder loaded when I go into edit to see if I can catch it doing it.

Yes, I have Echo dots, which show up the second time I try to add that action. As simon4 mentioned, I don't think it's related to a particular action. I have noticed similar random weirdness where i couldn't choose any submenu and get returned. It's happened more recently when adding a conditional, which results in a broken IF statement. Delete and try again and it works. I think this has happened a half a dozen times in the last few months.

I guess a better way to say it would be it seems random, or not any thing consistent that I can point to. I only posted to let the OP know I have seen this. So it's not just him, but I have no idea how to replicate the issue.

I have seen this behavior as well, Since it is very random (i.e. hard to reproduce) and a "fix" is relatively simple (delete and repeat) I didn't make any noise. This is not something introduced recently. I don't remember when I saw this first time but it was long time ago.

1 Like

Just thinking out loud. Wondering if improved rule error and sanity checking started catching some saved quirk at some point in the past.

I exported a couple of really old rules from the list, not opening them first. Also cloned them. Adding an action worked fine. Would exporting or cloning touch the original rule in any way?

The only thing noticed so far is adding the action that broke was in a very old rule that had disabled actions. Correlation? Still continuing to test.

No.

No.

No.

Investigating this, and posting about it, are both wastes of time...

1 Like

Got it. :slight_smile:

Did you recently (or previously when editing that or another rule) cancel an action in the middle of creating it, exit the rule in the middle of editing? Sometimes, it seems when you're editing an action, you might be able to click something prematurely and save the action--before you properly set & save all the parameters in the expected manner.

Or, if you closed a window while you were in the middle of editing a rule.

Those can sometimes cause something unexpected.

All in all, you do want to make sure you're properly completing all editing steps and saving the rule in one window.

After reading this thread, I decided to try it exactly as described - take an old rule, append an action to the rule (I selected Switch) and boom - no follow-up options, a ** Broken Action ** was appended to my rule. When I tried again, it worked normally. BUT I made a backup prior to the test and when I restored that, I exported the rule so I have exported rule file that reliably fails that first attempt to append. Will that help get this over the "waste of time" hump?

3 Likes

Email the exported to me: bruce@hubitat.com

Wow, when I first posted this it was more to see if I was the only one seeing this or not. It is not a big deal but happy that I was not the only one and that we might be on the track to hunt the issue down. Thanks.

Maybe to save time - I found 1 difference between the exported files of a rule that works and one that fails - the failed one does not have the line "actionDone": true,
I'll email you the exported rules

FWIW, I removed "state.actionDone" from a rule, opened it, added an action, no problemo.