Rule w/ Error "Error: class java.lang.Integer cannot be cast to class java.lang.String"

Hub model - recently migrated from C8 to C8 Pro. Most everything has been amazing but there is one rule that is broken with the following error when I click to Select Trigger Events:

Error: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')

My events are a v-switch OR a cloud endpoint. My guess is the cloud endpoint is causing this as when I use my iOS shortcut to call the endpoint, it doesn't work.

This is a pretty simple rule that just turns off/on some lights before bed when I press the shortcut button on my iPhone 17.

Is there a way to fix this without recreating the entire rule again...?:crossed_fingers:t2:

Thanks!

Just a stab in the dark on this one, but did you update the end point on your iPhone? My understanding is that every cloud endpoint issued by rule machine is unique (per hub, per rule), so maybe the old copy is being sent.

I don't think I've done what you're asking. :man_shrugging:t2: I haven't updated anything.

I'm trying to check the end point to update it and can't because of the aforementioned error. Side note: I had another end point that required being regenerated after the migration and I suspect this is a similar issue.

I probably asked the question backwards: I was hinting that you might need to recreate the cloud endpoint in RM and paste that into whatever app is sending from your iPhone.

Ah, I think I understand.

This is what I was trying to do (recreate the end point) in RM but I get the above error when attempting to do so. Or is there some other mechanism to recreate the end point? I did this a very long time ago and haven't thought about it since! :joy:

Mea culpa, I did a tldr on your op and didn't realize rule machine was crashing on you. I've had that happen many times in the past for other reasons. Coincidentally, yesterday someone else complained about not being able to edit triggers, but it was a different symptom: they had three triggers and couldn't access the third one.

In your case, it sounds increasingly like you will have to recreate the rule from scratch.

I've never found a satisfactory way to get out of the situation you're in. My hope was that you could sneak by with just editing the triggers and creating a new cloud endpoint.

Do "Logs" have more information about this error, maybe a line number?

Interestingly, I've only seen this error once:

usually it's just blank.

The log does show a bit more (line 1309):

java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap') on line 1309 (method selectTriggers)

S'all good. :slightly_smiling_face:

Thanks! That's usually helpful to share when you run into this.

In this case, I'm really not seeing how/why this should happen. Is it possible you were editing the rule and went back, closed the browser page, etc., without hitting "Done" or otherwise navigating away using the app buttons? If you figure out what caused it, that could be looked into for a fix. As-is, the fastest path will probably be to re-create you rule, as suggested above. (If you can still get to the actions page, you might be able to copy and paste those if they are complicated and that is your concern.)

2 Likes