I do have a very strange behavior observed and looking for some support.
What I did:
I am using Openhabian and in the config file (01) marked openHAB3 (some other versions you fetched yourself).
I wanted to backup my files and thought I can use the config-tool (50) - > Backup openHab config.
During the backup process it was upgraded to Openhab 4.0 (without my acknowledgment). The files seems adapted to Openhab4.0.
After upgrading from buster to bullseye and installing java 17 Openhab4.0 is now working fine. With the help of the config-tool I restored the backup.
Now my current problem:
All Items and bindings are availbe and I can see them admin-gui. Unfortunately they are not working. E.g. even I do have a sitemap available the webbage is saying:
Willkommen!
VerfĂŒgbare Sitemaps
Sie haben noch keine Sitemaps definiert. Hilfe zur Erstellung von Sitemaps finden Sie in der Dokumentation.
In the logfile I can see some permission issues (partial):
2023-07-28 21:12:09.724 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
2023-07-28 21:17:49.898 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
2023-07-28 21:27:49.864 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
2023-07-28 21:37:49.939 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
2023-07-28 21:47:49.904 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
2023-07-28 21:48:21.907 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/users.json. Cause /var/lib/openhab/jsondb/users.json (Keine Berechtigung).
2023-07-28 21:54:31.187 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/users.json. Cause /var/lib/openhab/jsondb/users.json (Keine Berechtigung).
2023-07-28 21:57:49.874 [ERROR] [re.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json. Cause /var/lib/openhab/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json (Keine Berechtigung).
The file system is correcty mounted and the permissions are correct set (I did a touch to see if I can write a file):
How can I troubleshoot this kind of issues?
Following basic steps I have done already: clean-cache, reboot openhab, reinstall zram and frontail, checking log4j2.xml.
Should I alter any other logs for more visibility:
After Upgrading to OH 4.0.1 my Semantic-Model is not loading anymore, I suppose it has something to do with the following error happening at the start:
2023-07-29 22:34:28.787 [ERROR] [s.internal.SemanticsMetadataProvider] - bundle org.openhab.core.semantics:4.0.1 (209)[org.openhab.core.semantics.internal.SemanticsMetadataProvider(236)] : The activate method has thrown an exception
java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 2
[\w-]*
^
at java.util.regex.Pattern.error(Pattern.java:2028) ~[?:?]
at java.util.regex.Pattern.(Pattern.java:1432) ~[?:?]
at java.util.regex.Pattern.compile(Pattern.java:1069) ~[?:?]
at java.util.regex.Pattern.matches(Pattern.java:1174) ~[?:?]
at java.lang.String.matches(String.java:2840) ~[?:?]
at org.openhab.core.common.AbstractUID.validateSegment(AbstractUID.java:100) ~[?:?]
at org.openhab.core.common.AbstractUID.(AbstractUID.java:76) ~[?:?]
at org.openhab.core.common.AbstractUID.(AbstractUID.java:59) ~[?:?]
at org.openhab.core.items.MetadataKey.(MetadataKey.java:42) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:109) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
at org.openhab.core.semantics.internal.SemanticsMetadataProvider.processItem(SemanticsMetadataProvider.java:131) ~[?:?]
âŠ
(It actually goes one for about another 1000 lines with the same output)
My âorg.openhab.core.items.Item.jsonâ seems to be valid and is the same as before.
Can someone please help?
OH4 after upgrade error , seems only to be a startup issue
My javascript is doing a HTTPGet , Iâm not 100% sure but it appears âactionsâ is not initialised
// every hour total for this period
rules.when().cron("15 0 * * * ? *").then(event => {
var response = actions.HTTP.sendHttpGetRequest(url_hb);
var js = JSON.parse(response)
console.log("heartbeat:" + js.success + ", ServerTime:" + js.servertime)
if (!js.success) {
console.log("heartbeat failed!" )
}
}).build("heartbeat to Internet", "heartbeat heartbeat to Internet host");
2023-07-30 08:28:12.264 [ERROR] [b.automation.script.javascript.stack] - Failed to execute script:
org.graalvm.polyglot.PolyglotException: Error: Failed to get any services of type(s): org.openhab.core.items.ItemBuilderFactory
at <js>.getService(@openhab-globals.js:2) ~[?:?]
at <js>.789(@openhab-globals.js:2) ~[?:?]
at <js>.__webpack_require__(@openhab-globals.js:2) ~[?:?]
at <js>.595(@openhab-globals.js:2) ~[?:?]
at <js>.__webpack_require__(@openhab-globals.js:2) ~[?:?]
at <js>.870(@openhab-globals.js:2) ~[?:?]
at <js>.__webpack_require__(@openhab-globals.js:2) ~[?:?]
at <js>.get rules(@openhab-globals.js:2) ~[?:?]
at <js>.:anonymous(@openhab-globals.js:2) ~[?:?]
at org.graalvm.polyglot.Context.eval(Context.java:399) ~[?:?]
at org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine.beforeInvocation(OpenhabGraalJSScriptEngine.java:285) ~[?:?]
at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.eval(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:89) ~[?:?]
at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndAutocloseable.eval(DelegatingScriptEngineWithInvocableAndAutocloseable.java:58) ~[?:?]
at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.eval(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:90) ~[?:?]
at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.loadScript(ScriptEngineManagerImpl.java:165) ~[?:?]
at org.openhab.core.automation.module.script.rulesupport.loader.AbstractScriptFileWatcher.createAndLoad(AbstractScriptFileWatcher.java:336) ~[?:?]
at org.openhab.core.automation.module.script.rulesupport.loader.AbstractScriptFileWatcher.lambda$14(AbstractScriptFileWatcher.java:310) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
2023-07-30 08:28:12.270 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script '/etc/openhab/automation/js/cloud_hb.js': null
2023-07-30 08:28:12.270 [WARN ] [ort.loader.AbstractScriptFileWatcher] - Script loading error, ignoring file '/etc/openhab/automation/js/cloud_hb.js'
2023-07-30 08:28:14.129 [WARN ] [ore.internal.scheduler.SchedulerImpl] - Scheduled job '<unknown>' failed and stopped
java.lang.NullPointerException: Cannot invoke "org.openhab.core.model.rule.scoping.RulesClassCache.get(Object)" because "cache" is null
at org.openhab.core.model.rule.scoping.RulesClassFinder.forName(RulesClassFinder.java:43) ~[?:?]
bundle org.openhab.core.semantics:4.0.1 (210)[org.openhab.core.semantics.internal.SemanticsMetadataProvider(250)] : The activate method has thrown an exception
java.util.regex.PatternSyntaxException: Stack overflow during pattern compilation near index 2
@Wikibear
I found a solution: The update to OH4 introduced a group loop in my items. I solved it by looking at all my items and made sure that they were not listed as their own group members and that a member of a group does not have the âupper-level groupâ as their group member.
In my case, I had two such group loops once I remove them and restarted Openhab everything worked perfectly as before.
Everything i see is same in CLI and there isnât any issue with that. I wrote a script and i canât find a group name in json key. So, the issue is persistent.
There was a loop problem. I had a room and a item itself as group member. Than you get a loop and an error. You must check this with all your groups. Other way is to check the json file.
I had a Lamp as group to the room group. The room group was the main group of the lamp but then i added it in the last time to the sub group where all items are e.g.:
Lamp->
Main Group: Room
Sub Group:
Switch
Energy
Power
Current
Room
And this was the issue.
In the future you get information if there is a loop. At the moment there is no informationâŠ