openHAB 3.4 Milestone discussion

It is not the script, its a timeout issue with slower hardware. If I rename the script to a different name, it fails on the next script that is ran.

I did not say anything against it, only wanted to mention that our addon-maintainers are quite busy and if review and merge will not be finished before the release, the marketplace is a second option.

1 Like

Following the upgarde from 3.4.0.M5 to 3.4.0.M6, when I try to execute a simple JSScript in the editor, I get the following error:
2022-12-12 10:44:20.677 [ERROR] [rg.apache.cxf.jaxrs.utils.JAXRSUtils] - No message body reader has been found for class java.util.Map, ContentType: application/octet-stream
2022-12-12 10:44:20.686 [WARN ] [s.impl.WebApplicationExceptionMapper] - javax.ws.rs.WebApplicationException: HTTP 415 Unsupported Media Type

here is the script :console.log(items.getItem(“test”).state)

Running on Windows

1 Like

Ah okay, so it only times out during the initial startup of openHAB. There’s definitely a lot going on at that time outside of your script’s control. When loading later, it seems to work fine. This is definitely not a permanent workaround, but can you try renaming the file to garage.sl100.js? That will force it to wait until the UI is fully booted before trying to load it.

Renaming the file didn’t help at all:

2022-12-12 11:44:23.268 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2022-12-12 11:44:36.466 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2022-12-12 11:44:47.224 [INFO ] [ort.loader.AbstractScriptFileWatcher] - Loading script '/opt/openhab/conf/automation/js/garage.sl100.js'
2022-12-12 11:45:02.916 [INFO ] [etatmo.internal.servlet.GrantServlet] - Registered Netatmo servlet at '/netatmo/connect/xxxxxx'
2022-12-12 11:45:16.748 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = xx...xx, base URL = http://localhost:8080)
2022-12-12 11:46:04.869 [WARN ] [ipt.internal.ScriptEngineManagerImpl] - Script evaluation of 'file:/opt/openhab/conf/automation/js/garage.sl100.js' takes more than 30000ms
2022-12-12 11:46:04.910 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'Runnable.run()' on 'org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl$$Lambda$1488/0x98eae028@29afc4': Multi threaded access requested by thread Thread[OH-safeCall-1,5,main] but is not allowed for language(s) js.
java.lang.IllegalStateException: Multi threaded access requested by thread Thread[OH-safeCall-1,5,main] but is not allowed for language(s) js.
	at com.oracle.truffle.polyglot.PolyglotEngineException.illegalState(PolyglotEngineException.java:129) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:1034) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:893) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.enterThreadChanged(PolyglotContextImpl.java:723) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.enterCached(PolyglotEngineImpl.java:1991) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.enterIfNeeded(PolyglotEngineImpl.java:1919) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotValueDispatch.hostEnter(PolyglotValueDispatch.java:1227) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1040) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:98) ~[?:?]
	at org.graalvm.polyglot.Context.getBindings(Context.java:560) ~[?:?]
	at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.invokeFunction(GraalJSScriptEngine.java:548) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndAutocloseable.invokeFunction(DelegatingScriptEngineWithInvocableAndAutocloseable.java:123) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.invokeFunction(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:119) ~[?:?]
	at org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine.invokeFunction(OpenhabGraalJSScriptEngine.java:233) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndAutocloseable.invokeFunction(DelegatingScriptEngineWithInvocableAndAutocloseable.java:123) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.invokeFunction(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:119) ~[?:?]
	at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.lambda$5(ScriptEngineManagerImpl.java:307) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-12-12 11:46:05.099 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'Runnable.run()' on 'org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl$$Lambda$1488/0x98eae028@820308': Multi threaded access requested by thread Thread[OH-safeCall-1,5,main] but is not allowed for language(s) js.
java.lang.IllegalStateException: Multi threaded access requested by thread Thread[OH-safeCall-1,5,main] but is not allowed for language(s) js.
	at com.oracle.truffle.polyglot.PolyglotEngineException.illegalState(PolyglotEngineException.java:129) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:1034) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:893) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.enterThreadChanged(PolyglotContextImpl.java:723) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.enterCached(PolyglotEngineImpl.java:1991) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.enterIfNeeded(PolyglotEngineImpl.java:1919) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotValueDispatch.hostEnter(PolyglotValueDispatch.java:1227) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextImpl.getBindings(PolyglotContextImpl.java:1040) ~[?:?]
	at com.oracle.truffle.polyglot.PolyglotContextDispatch.getBindings(PolyglotContextDispatch.java:98) ~[?:?]
	at org.graalvm.polyglot.Context.getBindings(Context.java:560) ~[?:?]
	at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.invokeFunction(GraalJSScriptEngine.java:548) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndAutocloseable.invokeFunction(DelegatingScriptEngineWithInvocableAndAutocloseable.java:123) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.invokeFunction(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:119) ~[?:?]
	at org.openhab.automation.jsscripting.internal.OpenhabGraalJSScriptEngine.invokeFunction(OpenhabGraalJSScriptEngine.java:233) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndAutocloseable.invokeFunction(DelegatingScriptEngineWithInvocableAndAutocloseable.java:123) ~[?:?]
	at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.invokeFunction(InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable.java:119) ~[?:?]
	at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.lambda$5(ScriptEngineManagerImpl.java:307) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]
2022-12-12 11:46:05.178 [INFO ] [ort.loader.AbstractScriptFileWatcher] - Loading script '/opt/openhab/conf/automation/js/keypads.sl100.js'
2022-12-12 11:46:06.603 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script 'file:/opt/openhab/conf/automation/js/garage.sl100.js': java.io.IOException: Stream closed

The problem with the GraalJSScriptEngine was not, that it was not happy to get interrupted, but instead the problem was that while it was evaluating the script file the scriptUnloaded function was called. I’ve fixed that by extending the multi-thread synchronization.

I can verify that the

java.lang.IllegalStateException: Multi threaded access requested by thread Thread[OH-safeCall-1,5,main] but is not allowed for language(s) js.

log messages don’t appear anymore and the underlying issue is fixed on both my PC (Fedora 36, amd64, openHAB SNAPSHOT #2221) and my Raspberry Pi (SNAPSHOT #2220).

Bugfix has been merged: https://github.com/openhab/openhab-addons/pull/13924.

In case anyone wants to try this out, you should be able to download the artefact from the PR.

1 Like

I started the review Thursday, and we are progressing quite fast with the help of @lsiepel also. So the plan is to get it merged within the next few days, assuming @maihacke will still have time also.

4 Likes

Yes, with combined efforts I think this would be merged within a day or so. We can, in case of lack of time, always decide to temporary remove it or go the marketplace route. But I’m working on it as we speak and not willing to give up yet. :grin:

4 Likes

+1

It doesn’t matter whether you run manually a rule or a script:

image

1 Like

FTR: The 415 with runNow is fixed in [rest] Fix missing backward compatibility in rules/runNow by J-N-K · Pull Request #3225 · openhab/openhab-core · GitHub

4 Likes

Yes, I should find some time. Btw review/polishing made great process in the last days.

1 Like

There exists a problem in sitemap UI editor when using group element:

When switching to code window, syntax error occurs:

@davesen The syntax error is actually on the line before. Your group needs an item as a parameter. So there is a real syntax error. The parser sometimes shows the error in a later line, as it tries to analyse the whole widget in one go.

To have it mentioned here. With a joined effort we were able to bring the PR for the iCloud binding to a mergeable state. Thanks to @lsiepel & @laursen .
First feedback from the community here is promising: iCloud Binding Communication Error - #499 by John_Cunha. On top its running in my “production” system without any errors so far.

4 Likes

Hello,

From the 3.4 Milestone 6 I only get current values ​​from the 11 Shelly adapters once shortly after the start and then no more current values ​​from all 11 Shelly adapters!

All adapters are displayed online. The Shelly Manager also works, but also no longer shows the current UpTime/Temp/Messages, for example, but the last value after starting Openhab.

  • Resetting/restarting the Shellys doesn’t fix the problem.
  • Restarting OpenHab or the Pi leads to the same problem.
  • The snapshot 3.4.3222/3223/3224 have the same problem.
  • All Milestones M1 to M5 did not have this problem.

I ask for correction of this error.
Or was something fundamental changed that needs to be adjusted?

Thanks very much.

I see only one PR related to shelly that was merged between M5 and M6:

Hello, I only use Shelly Plug S!

I think my Openhab/Linux/Java installation on my Pi has an error after updating from Openhab 3.4 M5 to Openhab 3.4 M6 and rebooting!

I haven’t had that since I started using an SSD. With an SD card very often.

I’ll set up a completely new system tomorrow and will report whether the error with the shellys will then be gone.

First…thank you for the effort you are doing all time :slight_smile:

May I ask you if this Eclipse installation fails due to incompatible plug-ins · Issue #1423 · openhab/openhab-distro · GitHub will be added to openhab 3.4?

I am asking because I struggling with the eclipse setup right now for programming a new plugin.

I installed the SNAPSHOT version and I can verify it’s fixed. BTW, the time between loading the script file and adding the first rule took about 80 seconds.

1 Like

I have just upgraded to RC1 and now my ZWave binding stopped working.
The following is thrown on console:

java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver
java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver

Any idea ??