[SOLVED] Rule/Sitemap can't resolve item - after 2.4 to 2.5 migration

Hey guys,

yesterday i tried to migrate my openHab main installation, from 2.4 to 2.5.
Everything looked good (no error in logs, every *items, *things, *sitemap model was loaded successfully), up to the point where the first rule was executed.

It seems to me that the rule engine has a problem with items that have an underscore in their name.
I have a few examples…

[ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Set daily max and min temperature': The name 'Aussen_Temperatur' cannot be resolved to an item or type; line 7, column 12, length 17
rule "Set daily max and min temperature"
when
	Item Aussen_Temperatur changed or
	Time cron "55 * * * * ?" or
	System started
then
	val max = Aussen_Temperatur.maximumSince(now.withTimeAtStartOfDay,"influxdb") // line 7!
	val min = Aussen_Temperatur.minimumSince(now.withTimeAtStartOfDay,"influxdb")

	if( max !== null && min !== null) {
		postUpdate(Weather_Temp_Max, max.state)
		postUpdate(Weather_Temp_Min, min.state)
	}
end
Number KNX_Aussen_Temperatur    "Aussen Temperatur [%.1f °C]" <temperature> { channel="knx:device:bridge:general:Aussen_Temperatur" }

another one

java.lang.reflect.UndeclaredThrowableException: null
	at com.sun.proxy.$Proxy127.apply(Unknown Source) ~[?:?]
	at org.eclipse.smarthome.model.script.internal.actions.TimerExecutionJob.execute(TimerExecutionJob.java:48) ~[?:?]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [bundleFile:?]
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [bundleFile:?]
Caused by: org.eclipse.smarthome.model.script.engine.ScriptExecutionException: The name 'Enable_Signal' cannot be resolved to an item or type; line 35, column 9, length 13
rule "Doorbird init"
when
    System started
then
    createTimer(now.plusSeconds(30), [|
        Enable_Signal.postUpdate(ON) // line 35!
    ])
end
Switch  Enable_Signal   "Türklingel Signalton  [%s]"    <soundvolume>

and one more

[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Cinema status': The name 'Wohnzimmer_Beamer_Power' cannot be resolved to an item or type; line 32, column 9, length 23
rule "Cinema status"
when
    Item WohnzimmerBeamerPower changed or
    Item Leinwand changed or
    Item HarmonyActivity changed or
    Member of gRolladenEG changed 
then
    if (WohnzimmerBeamerPower.state == ON       &&    // line 32!
        HarmonyActivity.state         == "CINEMA" &&
        Leinwand.state              == 100 &&
        Rolladen_Esszimmer.state    == 100 &&
        Wohnzimmer_Rolladen.state   == 100 &&
        Kuechen_Rolladen.state      == 100 &&
        Rolladen_Esszimmer.state    == 100 &&
        Rolladen_TV_Zimmer.state    == 100) 
    {
        Cinema_Switch_state.postUpdate(ON)
    }
    else 
    {
        Cinema_Switch_state.postUpdate(OFF)
    }
end
Switch Wohnzimmer_Beamer_Power    "Beamer"    { channel="knx:device:bridge:wohnzimmer:Kino_Szene_Wohnzimmer_Status" }

This is a small selection, the errors I get. As a test, I removed the underscore in the name of one item, which solved the problem the single item
Unfortunately, several hundred items with many, many rules of their own are still affected. Therefore renaming is currently not an option.
Also the sitemaps, show a large part of the affected items no longer correctly.

Does anyone have any ideas about that?

if the errors appear shortly during/after startup, you can ignore them.
i implemented a rule delay at system start, see here

Hi there,

is it just the log-entries or do you have issues during runtime, too? As @HaKuNa already said, if you see that log-entries popping up during start-up they may be annoying, but shouldn’t cause too much troubles.

I do have similar issues , also with “_” - but not all of them are throwing errors.

KR

I already had some “system started” timers in the rules. I have now added timers to all “system started”-rules.
Unfortunately it has no effect on my problem, even after 30 minutes of running time, the rules cannot be executed and some items are not displayed on the sitemaps.

There is a known issue where after clearing the cache (which happens during an upgrade) OH just seems to forget a bunch of Items. Waiting for OH to calm down and then restarting it seems to clear the problem up. I’ve seen reports of two or three restarts being necessary.

Please try that and come back if that doesn’t fix it for further exploration.

2 Likes

Adding to what Rich mentioned, after a few restarts do a reboot as well. This was needed on my server when I upgraded (as well as the restarts).

Restarting openHab twice, did the trick.
Thanks for your ideas and suggestions.

Where could we monitor the fix of the issue?

There will be no fix for this issue or any core issue for OH 2.5. OH 2 is done. Given the massive changes to OH core that are taking place for OH 3, in all likelihood what will happen is when OH 3 is released a new Issue will be created should the problem somehow still exist in OH 3 or the issue will be fixed.