-
Notifications
You must be signed in to change notification settings - Fork 780
Item already exists! Failed to add a second with the same UID! #4565
Comments
@mherwege thanks for opening this issue. |
@htreu It only happens with items defined through PaperUI. I do have other items in .items files, but these do not seem to be affected. I will post a full log when it happens. |
Here is a log. Note the 3 errors at the start. These are from a new binding I am testing and is loaded through the addons folder. I did have the issue before starting to test this new binding, so this is not likely to be the cause.
|
I did an analysis, this is a bug in ESH. Technical explanationTwo ItemProviders will try to add new items to the ItemRegistry:
Since #3670 there is a mechanism in the AbstractRegistry which prevents duplicate elements. This introduced also the behaviour we can see here: When the ChannelItemProvider is the first to add its items to the ItemRegistry the ManagedItemProvider will later try to add its items too and create the log messages. WorkaroundIn case all items in a setup are either provided by .items files or created vie PaperUI/REST API and not automagically by the ChannelItemProvider (which is needed primarily when activating new channels in PaperUI in "Simple Mode"*), the ChannelItemProvider can be deactivated completely. To achieve this create a * in Simple Mode no real items are created but only "virtual" items are implicitly created by the ChannelItemProvider. @mherwege, do you mind testing the described workaround with your setup? |
@htreu I did as described and I don’t see warnings anymore. Thank you for investigating. |
Thanks @mherwege for reporting and testing! |
...so it gets informed before (resp. after) items are added (resp. removed) by other providers. fixes eclipse-archived#4565 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
* Hook the ChannelItemProvider into the ItemRegistry ...so it gets informed before (resp. after) items are added (resp. removed) by other providers. fixes #4565 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
I'm still having the issue reported using OH 2.2 release as well as using latest OH 2.3 snapshot build. The suggested workaround to disabled ChannelItemProvider seems to work for me, too. |
relates to eclipse-archived#5112, eclipse-archived#4565 and others Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
Team, it seems I have the same issue here. openHAB 2.3.0 build 1238. Workaround is still working fine. |
See #5112 |
Has this issue been fixed? I am using openhab2.3.0 on openhabian and having this warning show in my log file. I was trying to clear up warnings. I also tried the work around and it does not work for me. I created the attached file and put it in the conf/services folder then restarted. Note .txt added to the end only for posting purposes. |
I am running the latest OH snapshot. On some startups, I get the following in my logs:
The items affected differ. Some startups don't have issues at all.
Other people have the same problem, see discussion in community https://community.openhab.org/t/item-issues-after-upgrade-to-snapshot-2-2-1004/32927/23.
The text was updated successfully, but these errors were encountered: