openhab-core: Items not found when displaying sitemap or executing rules

I just installed build 1607 on a system that had been running 1502 for quite a while.

After an openHAB restart, sometimes, when displaying a sitemap, I see errors in my log indicating that items cannot be found, even though the items exist.

I’ve found each of the following things will clear the issue:

  • sometimes a restart will clear the issue
  • modifying an items file will clear the issue for the items defined in that file
  • stopping/starting org.openhab.core.model.item also resolves the issue

Could there be a timing issue where a dependent bundle might not be available at the right time during startup?

Example of errors.

2019-06-10 13:44:57.912 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:44:57.914 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve visibility item OH_Status for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:44:57.915 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'OH_Status' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:44:57.916 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'OH_Status' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:44:57.917 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'OH_Status' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.191 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.193 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Mark_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.194 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Mark_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.196 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Mark_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.198 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.199 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Cathy_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.200 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Cathy_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text
2019-06-10 13:45:50.201 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Uptime_Cathy_Formatted' for widget org.eclipse.smarthome.model.sitemap.Text

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

I just did an update from one openHAB snapshot to the latest 2.5.6 build #144 and experienced missing items (like on a few updates before).

Then I searched for related bugs and found this issue. I am not sure if its only timing related, which might then be fixed by #1514, because I observed the following:

By comparing the output of “items list” after startup with an “items list” after I had done “touch *.items” in bash, I could see a pattern showing WHICH items were not loaded:

  • items that are NOT linked to any channel (dummy items used for rules only, for example)
  • items filled by openhab-1 bindings, like from the caldav or fritz tr64 binding
  • items that are linked to a channel that belongs to a thing whose binding isn’t installed currently

So all these items didn’t exist after my update and only appeared once I refreshed the .items files.

ALL items that were linked against openHAB-2 thing channels were correctly loaded!

@kaikreuzer FYI: Since you have just worked on improving the model loading. Maybe my observation rings a bell to you.

Sounds to me as if either something has changed wrt to start levels or by having a different startup behavior by recent refactorings wrt service activation

I’ve seen this since before the constructor injection PRs. I don’t specifically remember, so could be mistaken, but I want to say that it’s been happening since S1566. If needed, it wouldn’t be hard to test.

In my setup, I’ve only seen this after clearing the cache.

I confirm the issue. Build #1603 (x86_64, Debian 9, Docker)