Getting an "UndeclaredThrowableException" Error and the Piston is not working properly


#1

Hi All,

I am getting this error occasionally: “An error occurred while executing the event: java.lang.reflect.UndeclaredThrowableException”. I have 4 Ceiling Fans and I am starting them based on my Furnace Fan/Blower starting. Sometimes, all 4 start with no issues, but occasionally 1 does not start and looking at the logs, I see what I have pasted above. This also occurs on occasion when I use the same piston to stop the ceiling fan. Each fan has a separate Piston to start or stop it.

Any thoughts and help would be greatly appreciated.

Thanks,

John


#2


#3

Please search topics for UndeclaredThrowableException, this is a ST platform timeout that has been giving people grief since late last year.


#4

You may want to edit your piston and fix the very last IF block… you have an IF Block embedded within an empty IF block.


#5

I did not notice that. I am changing all 4 of my pistons that control ceiling fans this way. I will let you know if this fixes the issue. Thanks so much for taking a look at the entire piston I posted. Awesome!!!


#6


#7

Here is an example of the updated Piston.


#8

Hello ipaterson,

Looking through many comments and updates, it looks to me that the only thing that sometimes works is to reduce the number of devices assigned to Webcore. I went through and any device that I am not using in a Piston has been removed.

Thanks for the advice.

John


#9

Hello,

I have fixed the programming issue noted by jkp and also removed as many devices from Webcore (through SmartThings) that I can without removing pistons. I’ve also cleaned out the Java Cache/memory. I’ve tested it multiple times and still occasionally getting the error and a fan not starting or not stopping.

Is there any consistent method or other ideas to solve this issue. I was not having this a couple weeks ago.

Thanks,

John


#10

Would you please try switching this piston to Full logging mode and then trying to reproduce the error? This sounds like a new case of that exception since iirc the original was preventing access to the dashboard but did not affect execution of pistons.

If you can collect logs from a few instances of that exception we might see a pattern in the surrounding logs to identify where this occurs. If you ever see the exception logged with a reference to a specific line number that would be even more helpful.


#11

I’ll give that a try. Thanks for the information.


#12

This is a log with the error. The desired Ceiling Fan did not turn on.

3/31/2019, 1:14:28 AM +375ms
+2ms ╔Received event [Furnace Heat (On = Closed)].contact = closed with a delay of 922ms
+127ms ║RunTime Analysis CS > 20ms > PS > 52ms > PE > 54ms > CE
+130ms ║Runtime (49603 bytes) successfully initialized in 52ms (v0.3.10a.20190223) (126ms)
+131ms ║╔Execution stage started
+146ms ║║Condition #2 evaluated false (8ms)
+147ms ║║Condition group #1 evaluated false (state did not change) (10ms)
+154ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+157ms ║║Cancelling condition #27’s schedules…
+158ms ║║Condition #27 evaluated true (7ms)
+169ms ║║Comparison (enum) off is (string) off = true (2ms)
+171ms ║║Cancelling condition #28’s schedules…
+172ms ║║Condition #28 evaluated true (12ms)
+232ms ║║An error occurred while executing the event: java.lang.reflect.UndeclaredThrowableException
+233ms ║╚Execution stage complete. (103ms)
+235ms ╚Event processed successfully (235ms)


#13

This is a copy of the piston that had the error.


#14

I posted a “full log” with the error and also a copy of the piston that this happened on. In the case, closing of the contact was to turn on the fan and the fan did not turn on. 3 other Fans that are programmed the same turned on.


#15

This is the Log for an identical piston (other than a different Ceiling Fan) that worked with no issue.

3/31/2019, 1:14:28 AM +372ms
+1ms ╔Received event [Furnace Heat (On = Closed)].contact = closed with a delay of 918ms
+130ms ║RunTime Analysis CS > 23ms > PS > 46ms > PE > 61ms > CE
+133ms ║Runtime (49261 bytes) successfully initialized in 46ms (v0.3.10a.20190223) (131ms)
+134ms ║╔Execution stage started
+149ms ║║Condition #2 evaluated false (8ms)
+150ms ║║Condition group #1 evaluated false (state did not change) (10ms)
+158ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+160ms ║║Cancelling condition #27’s schedules…
+161ms ║║Condition #27 evaluated true (8ms)
+172ms ║║Comparison (enum) off is (string) off = true (2ms)
+174ms ║║Condition #28 evaluated true (12ms)
+315ms ║║Comparison (dynamic) 37 is_less_than (integer) 65 = true (1ms)
+317ms ║║Condition #29 evaluated true (142ms)
+318ms ║║Cancelling condition #26’s schedules…
+319ms ║║Condition group #26 evaluated true (state changed) (166ms)
+323ms ║║Cancelling statement #30’s schedules…
+328ms ║║Executed virtual command [Ceiling Fan Master Bedroom].wait (1ms)
+329ms ║║Waiting for 2000ms
+2368ms ║║Executed physical command [Ceiling Fan Master Bedroom].setLevel([20]) (34ms)
+2370ms ║║Executed [Ceiling Fan Master Bedroom].setLevel (36ms)
+2377ms ║║Executed virtual command [Ceiling Fan Master Bedroom].setVariable (3ms)
+2389ms ║║Condition #8 evaluated false (6ms)
+2390ms ║║Condition group #7 evaluated false (state did not change) (9ms)
+2398ms ║║Comparison (enum) closed changes_to (string) closed = true (1ms)
+2400ms ║║Cancelling condition #35’s schedules…
+2401ms ║║Condition #35 evaluated true (8ms)
+2411ms ║║Comparison (enum) off is (string) on = false (2ms)
+2413ms ║║Condition #36 evaluated false (10ms)
+2414ms ║║Condition group #34 evaluated false (state did not change) (22ms)
+2425ms ║║Cancelling condition #13’s schedules…
+2427ms ║║Condition #13 evaluated false (8ms)
+2428ms ║║Condition group #12 evaluated false (state did not change) (10ms)
+2435ms ║║Comparison (enum) closed changes_to (string) open = false (1ms)
+2437ms ║║Condition #43 evaluated false (6ms)
+2439ms ║║Condition group #42 evaluated false (state did not change) (8ms)
+2450ms ║║Condition #52 evaluated false (6ms)
+2451ms ║║Condition group #17 evaluated false (state did not change) (9ms)
+2454ms ║╚Execution stage complete. (2320ms)


#16

I copy and pasted of a “Full Log” of a Ceiling Fan that worked and started the Fan.

Any help would be appreciated. I tend to think this is a SmartThings Issue as I am noticing that many times when one of these ceiling fans is actually running, my Action Tiles app shows it as off. Seems that SmartThings is not communicating consistently to third party software. Also concerned it could be related to using TWCWeather.


#17

Thanks for your help with this ???