Problem after upgrade

Hello all,

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):

-rw-rw-r-- 1 openhab openhab 2095 27. Jul 16:56 icloud%3Aaccount%3Acd9aecf60a.json
-rw-rw-r-- 1 openhab openhab 2364 28. Jul 23:07 org.openhab.core.config.discovery.DiscoveryResult.json
-rw-rw-r-- 1 openhab openhab 2 27. Jul 16:56 org.openhab.core.items.Item.json
-rw-rw-r-- 1 openhab openhab 2 27. Jul 16:56 org.openhab.core.thing.link.ItemChannelLink.json
-rw-rw-r-- 1 openhab openhab 2654335 27. Jul 16:56 org.openhab.core.thing.Thing.json
-rw-rw-r-- 1 openhab openhab 5566 27. Jul 16:56 StorageHandler.For.OAuthClientService.json
-rw-r–r-- 1 openhabian openhab 0 28. Jul 23:08 test
-rw-rw-r-- 1 openhab openhab 270 27. Jul 16:56 thing_status_storage.json
-rw-rw-r-- 1 openhab openhab 116000 27. Jul 16:56 uicomponents_habpanel_panelconfig.json
-rw-rw-r-- 1 openhab openhab 418 27. Jul 16:56 uicomponents_ui_page.json
-rw-rw-r-- 1 openhab openhab 4133 28. Jul 22:59 users.json

Does somebody has any clue why it is not working and support me, please?

Thanks in advance.

Weird issue after upgrading from 3.4.4-2 to 4.0.1:

Frist: After upgrading to 4.0.1 from 3.4.4 I can control all my items and all things are online.

But:

  • No rule will be triggered via item change or update events and no entries in the events.log files either?
  • But I can see in the developer sidebar the stream events of the items that are changing.

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:

Following automation addins I have installed as I have also rules that weren’t migrated to ECMA 2022 yet:

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) ~[?:?]

Fixed my problem. I installed zRAM again and adjusted the DHCP settings. Afterwards everything is working more or less fine.

Same Issue here

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

[\w-]*

^

@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.

Let me know if that solved your Issue!

I will give a try, but it’s working before without any issues and i didn’t add new groups or devices. Do you have a trick to do this easily?

Open the log-viewer then click on the items menu-tab, it should show you a warning that there are items with group loops.

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.

Open the log-viewer then click on the items menu-tab, it should show you a warning that there are items with group loops.

Can you explain a little bit more which log viewer you are mean exactly? The web based log viewer has no items menu-tab on my side.

Thanks.

Please see my comment in the German Facebook group.

1 Like

It seems that I have the same problem.

Can you please provide an explanation or a link (I’m not on facebook).

thanks in advance.

Hello Hermann,

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…

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.