Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rrd4j] "Tried to set invalid state" errors when restoring values on startup #8806

Closed
robnielsen opened this issue Oct 19, 2020 · 14 comments · Fixed by #8815
Closed

[rrd4j] "Tried to set invalid state" errors when restoring values on startup #8806

robnielsen opened this issue Oct 19, 2020 · 14 comments · Fixed by #8815
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@robnielsen
Copy link
Contributor

I see the following in openhab.log:

2020-10-14 16:59:40.497 [ERROR] [org.openhab.core.items.GenericItem  ] - Tried to set invalid state 0.0 (DecimalType) on item bathFans of type SwitchItem, ignoring it

The .items file is similar to:

Group:Switch:OR(ON, OFF) bathFans    "All Bath Fans [%d are on]" (all)
Switch mMainBathFan   (bathFans) {channel=""}
Switch sMasterBathFan (bathFans) {channel=""}
Switch sBathFan       (bathFans) {channel=""}
Switch bBathFan       (bathFans) {channel=""}
@wborn
Copy link
Member

wborn commented Oct 19, 2020

Do you also use mapdb to restore values on startup? The version used with OH3 was rewritten and seems to have some issues.

@robnielsen
Copy link
Contributor Author

No, I don't use mapdb at all, is it enabled by default?

@wborn
Copy link
Member

wborn commented Oct 19, 2020

No it's not enabled by default. But I have also seen similar error logging about invalid state. I hope to find the root cause. :-)

@robnielsen
Copy link
Contributor Author

It does appear that state is somehow persisted across restarts

@wborn
Copy link
Member

wborn commented Oct 19, 2020

It could be that you are now using rrd4j to restore the state on startup. IIRC rrd4j doesn't store the unit with quantity type items so that might cause your other issue https://github.com/openhab/openhab-core/issues/1732.

@robnielsen
Copy link
Contributor Author

Yes, it does appear that it is installed. I didn't configure any sort of persistence. It isn't enabled:
image

@robnielsen
Copy link
Contributor Author

I uninstalled rrd4j and the errors went away.

@wborn
Copy link
Member

wborn commented Oct 19, 2020

OK that at least explains some of the issues. When a persistence service is installed it is enabled and it will use the default persistence strategies of the service if none are configured, which seems to be storing items every minute and restoring on startup.

The default service setting is only used to determine which source should be used for charts.

@robnielsen
Copy link
Contributor Author

I didn't install a persistence service. I'm using the conf/services/addons.cfg, and persistence isn't even defined.

@wborn
Copy link
Member

wborn commented Oct 19, 2020

It's installed by default and that is also not obvious in the setup wizard, see openhab/openhab-webui#306 (comment). So it doesn't help that its default persistence strategies will now also start generating these issues for everyone out of the box.

@kaikreuzer
Copy link
Member

We'd have to investigate why this happens - for me, restoring switch items works flawlessly with rrd4j.
But I guess we can assume that the problem is within the rrd4j persistence service, so I suggest to move the issue to openhab-addons.

@kaikreuzer kaikreuzer changed the title Logging issues at startup in openhab.log [rrd4j] Logging issues at startup in openhab.log Oct 19, 2020
@kaikreuzer kaikreuzer transferred this issue from openhab/openhab-core Oct 19, 2020
@wborn
Copy link
Member

wborn commented Oct 19, 2020

It seems when rrd4j restores values the precision gets lost causing #8798 and it has other issues as well.

When I use the demo setup it also cannot restore the Heating item:

[ERROR] [org.openhab.core.items.GenericItem ] - Tried to set invalid state 1.0 (DecimalType) on item Heating of type SwitchItem, ignoring it

@wborn wborn changed the title [rrd4j] Logging issues at startup in openhab.log [rrd4j] "Tried to set invalid state" errors when restoring values on startup Oct 20, 2020
@wborn wborn added the bug An unexpected problem or unintended behavior of an add-on label Oct 20, 2020
@kaikreuzer
Copy link
Member

I have found a few flaws in rrd4j and am working on fixing it - stay tuned.

@kaikreuzer
Copy link
Member

Here you go: #8815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants