openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Rules lose access to items when unrelated things files are updated

Open morph166955 opened this issue 3 years ago • 7 comments

Noticed first on S2046 but could have been present before. When I update a things file my rules seem to lose access to items that are totally unrelated.

I started working with the HTTP binding yesterday. When I would make changes to the things file, other unrelated items were made unavailable to the rules. Specifically, I have a (different) file of items that are not tied to any bindings/channels that store some runtime things for me. Those items will just be unavailable for no real reason. See example below. To note, the two items in this example are created in two different items files. There are no items in either of those files tied to the roku.things file at all.

@kaikreuzer I know you're trying to focus in on rules, pointing you towards this oddity

2020-12-06 11:59:27.590 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'roku.things'
2020-12-06 11:59:27.611 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU1'.
2020-12-06 11:59:27.615 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU2'.
2020-12-06 11:59:27.618 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU3'.
2020-12-06 11:59:27.622 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU4'.
2020-12-06 11:59:27.630 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU5'.
2020-12-06 11:59:27.636 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU6'.
2020-12-06 11:59:27.640 [INFO ] [nding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:ROKU7'.
2020-12-06 11:59:28.641 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'roku.things'
2020-12-06 11:59:39.912 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'zwave-1' failed: The name 'OFF' cannot be resolved to an item or type; line 7, column 67, length 3 in zwave
2020-12-06 11:59:39.913 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'zwave-1' failed: The name 'OFF' cannot be resolved to an item or type; line 7, column 67, length 3 in zwave
2020-12-06 11:59:39.913 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'zwave-1' failed: The name 'ZWave_FirstFloorMotionSensor_BinarySensor' cannot be resolved to an item or type; line 7, column 16, length 41 in zwave
2020-12-06 11:59:39.914 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'zwave-1' failed: The name 'ZWave_FirstFloorMotionSensor_BinarySensor' cannot be resolved to an item or type; line 7, column 16, length 41 in zwave
2020-12-06 11:59:51.151 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'ON' cannot be resolved to an item or type; line 69, column 36, length 2 in sonos-one_kitchen
2020-12-06 11:59:54.443 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'ON' cannot be resolved to an item or type; line 69, column 36, length 2 in sonos-one_kitchen
2020-12-06 11:59:54.443 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'ON' cannot be resolved to an item or type; line 69, column 36, length 2 in sonos-one_kitchen
2020-12-06 11:59:54.443 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'ON' cannot be resolved to an item or type; line 69, column 36, length 2 in sonos-one_kitchen
2020-12-06 11:59:54.453 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.454 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.454 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.454 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.455 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.455 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen
2020-12-06 11:59:54.459 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_kitchen-4' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 69, column 14, length 12 in sonos-one_kitchen

Switch  openHAB_Init                    "OpenHAB Initialized"           <settings>

Switch  ZWave_FirstFloorMotionSensor_BinarySensor   "First Floor Motion Sensor [%s]"

Line 7 from zwave :
        if ( ( ZWave_FirstFloorMotionSensor_BinarySensor.state == OFF ) &&

Line 69 from sonos-one_kitchen :
        if ( openHAB_Init.state == ON ) {

morph166955 avatar Dec 06 '20 18:12 morph166955

Is this still there? I'd hope that it got solved by one of the many rule engine bug fixes.

kaikreuzer avatar Jan 12 '21 20:01 kaikreuzer

Yes, I saw this over the weekend.

morph166955 avatar Jan 12 '21 20:01 morph166955

I'm on S2146 now and this may be resolved. I attempted to force it and I have not been able to thus far. I'll keep monitoring.

morph166955 avatar Jan 16 '21 22:01 morph166955

I was wrong. I'm now on S2169 and I had this happen twice just now. It happened when I added a new Sonos speaker to the .things file that had the other 7 speakers I have in it.

2021-01-28 19:31:34.575 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_bedroom-3' failed: The name 'Silent_Running' cannot be resolved to an item or type; line 120, column 27, length 14 in jarvis-speech-one_7828CAC2780A01400 2021-01-28 19:31:34.575 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'sonos-one_bedroom-3' failed: The name 'openHAB_Init' cannot be resolved to an item or type; line 52, column 14, length 12 in jarvis-speech-one_7828CAC2780A01400

morph166955 avatar Jan 29 '21 01:01 morph166955

Can you provide a complete set of items/things/rules that shows this issue? Preferably one that does not rely on external hardware (http binding, astro binding are fine).

J-N-K avatar May 23 '22 16:05 J-N-K

I will have to see if I can recreate this on a more current build. I've moved twice since posting this and my OH has been rebuilt twice since as well.

morph166955 avatar May 23 '22 19:05 morph166955

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 22 '22 20:07 stale[bot]