5.1 upgrade causes file system based JSRule error The rule has incorrect configurations

Running on openhabian, recent upgrade to 5.1. I have a number of JSRule’s defined in the filesystem and they are now throwing an error message when the rule is loaded at startup or upon rule edit.

java.lang.IllegalArgumentException: The rule 'TestRule3' has incorrect configurations
        at org.openhab.core.automation.internal.RuleRegistryImpl.resolveConfigurations(RuleRegistryImpl.java:499) ~[?:?]
        at org.openhab.core.automation.internal.RuleRegistryImpl.onAddElement(RuleRegistryImpl.java:463) ~[?:?]
        at org.openhab.core.automation.internal.RuleRegistryImpl.onAddElement(RuleRegistryImpl.java:1) ~[?:?]
        at org.openhab.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:212) ~[bundleFile:?]
        at org.openhab.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:169) ~[bundleFile:?]
        at org.openhab.core.automation.internal.RuleRegistryImpl.added(RuleRegistryImpl.java:428) ~[?:?]
        at org.openhab.core.automation.internal.RuleRegistryImpl.added(RuleRegistryImpl.java:1) ~[?:?]
        at org.openhab.core.common.registry.AbstractRegistry.added(AbstractRegistry.java:1) ~[bundleFile:?]
        at org.openhab.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:60) ~[bundleFile:?]
        at org.openhab.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:79) ~[bundleFile:?]
        at org.openhab.core.common.registry.AbstractProvider.notifyListenersAboutAddedElement(AbstractProvider.java:83) ~[bundleFile:?]
        at org.openhab.core.automation.module.script.rulesupport.shared.ScriptedRuleProvider.add(ScriptedRuleProvider.java:53) ~[bundleFile:?]
        at org.openhab.core.automation.module.script.rulesupport.shared.RuleSupportRuleRegistryDelegate.add(RuleSupportRuleRegistryDelegate.java:73) ~[bundleFile:?]
        at org.openhab.core.automation.module.script.rulesupport.shared.ScriptedAutomationManager.addRule(ScriptedAutomationManager.java:111) ~[bundleFile:?]
        at org.openhab.automation.jsscripting.internal.threading.ThreadsafeWrappingScriptedAutomationManagerDelegate.addRule(ThreadsafeWrappingScriptedAutomationManagerDelegate.java:71) ~[bundleFile:?]
        at com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:372) ~[bundleFile:?]
        at com.oracle.truffle.host.GuestToHostCodeCache$GuestToHostInvokeHandle.executeImpl(GuestToHostCodeCache.java:88) ~[bundleFile:?]
        at com.oracle.truffle.host.GuestToHostRootNode.execute(GuestToHostRootNode.java:80) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:118) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultRuntimeAccessor$DefaultRuntimeSupport.callInlined(DefaultRuntimeAccessor.java:201) ~[bundleFile:?]
        at com.oracle.truffle.host.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:102) ~[bundleFile:?]
        at com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:408) ~[bundleFile:?]
        at com.oracle.truffle.host.HostExecuteNode.doInvoke(HostExecuteNode.java:906) ~[bundleFile:?]
        at com.oracle.truffle.host.HostExecuteNode.doFixed(HostExecuteNode.java:140) ~[bundleFile:?]
        at com.oracle.truffle.host.HostExecuteNodeGen$Inlined.execute(HostExecuteNodeGen.java:272) ~[bundleFile:?]
        at com.oracle.truffle.host.HostObject.invokeMember(HostObject.java:465) ~[bundleFile:?]
        at com.oracle.truffle.host.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:6988) ~[bundleFile:?]
        at com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:8497) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1548) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:249) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:723) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute_generic3(JSWriteCurrentFrameSlotNodeGen.java:136) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute(JSWriteCurrentFrameSlotNodeGen.java:67) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.executeVoid(JSWriteCurrentFrameSlotNodeGen.java:319) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.binary.DualNode.executeVoid(DualNode.java:140) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.binary.DualNode.execute(DualNode.java:115) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.ReturnNode$TerminalPositionReturnNode.execute(ReturnNode.java:178) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeGeneric(AbstractBlockNode.java:83) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeGeneric(AbstractBlockNode.java:53) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultBlockNode.executeGeneric(DefaultBlockNode.java:65) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:73) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeGeneric(AbstractBlockNode.java:83) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeGeneric(AbstractBlockNode.java:53) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultBlockNode.executeGeneric(DefaultBlockNode.java:65) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:73) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:70) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:155) ~[bundleFile:?]
        at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:96) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:118) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:59) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$DirectJSFunctionCacheNode.executeCall(JSFunctionCallNode.java:1330) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:308) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:253) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:723) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute_generic3(JSWriteCurrentFrameSlotNodeGen.java:136) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.execute(JSWriteCurrentFrameSlotNodeGen.java:67) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.access.JSWriteCurrentFrameSlotNodeGen.executeVoid(JSWriteCurrentFrameSlotNodeGen.java:319) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:78) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:53) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultBlockNode.executeGeneric(DefaultBlockNode.java:63) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:73) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.binary.DualNode.execute(DualNode.java:116) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:70) ~[bundleFile:?]
        at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:155) ~[bundleFile:?]
        at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:96) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:118) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultDirectCallNode.call(DefaultDirectCallNode.java:59) ~[bundleFile:?]
        at com.oracle.truffle.js.lang.JavaScriptLanguage$ParsedProgramRoot.execute(JavaScriptLanguage.java:256) ~[bundleFile:?]
        at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:118) ~[bundleFile:?]
        at com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1898) ~[bundleFile:?]
        at com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:62) ~[bundleFile:?]
        at org.graalvm.polyglot.Context.eval(Context.java:419) ~[bundleFile:?]
        at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:490) ~[bundleFile:?]
        at com.oracle.truffle.js.scriptengine.GraalJSScriptEngine.eval(GraalJSScriptEngine.java:432) ~[bundleFile:?]
        at javax.script.AbstractScriptEngine.eval(Unknown Source) ~[java.scripting:?]
        at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndCompilableAndAutocloseable.eval(DelegatingScriptEngineWithInvocableAndCompilableAndAutocloseable.java:57) ~[bundleFile:?]
        at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndCompilableAndAutoCloseable.eval(InvocationInterceptingScriptEngineWithInvocableAndCompilableAndAutoCloseable.java:116) ~[bundleFile:?]
        at org.openhab.automation.jsscripting.internal.scriptengine.DelegatingScriptEngineWithInvocableAndCompilableAndAutocloseable.eval(DelegatingScriptEngineWithInvocableAndCompilableAndAutocloseable.java:57) ~[bundleFile:?]
        at org.openhab.automation.jsscripting.internal.scriptengine.InvocationInterceptingScriptEngineWithInvocableAndCompilableAndAutoCloseable.eval(InvocationInterceptingScriptEngineWithInvocableAndCompilableAndAutoCloseable.java:116) ~[bundleFile:?]
        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:337) ~[bundleFile:?]
        at org.openhab.core.automation.module.script.rulesupport.loader.AbstractScriptFileWatcher.lambda$13(AbstractScriptFileWatcher.java:311) ~[bundleFile:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Extra configuration properties:  'type'; 'source';
        at org.openhab.core.automation.internal.RuleRegistryImpl.validateConfiguration(RuleRegistryImpl.java:537) ~[?:?]
        at org.openhab.core.automation.internal.RuleRegistryImpl.resolveConfigurations(RuleRegistryImpl.java:495) ~[?:?]
        ... 88 more

This part of the error: Extra configuration properties: ‘type’; ‘source’; comes from the RuleRegistryImpl and my best guess is that the rule configuration set in openhab-js/rules/rules.js rule.setConfiguration which includes type and source does not match a “configurationDescription” which is set in a location I cannot find for this type of rule.

My best guess: there is a configuration validation/normalization process that occurs prior to adding the rule to the rule registry and in this case the openhab-js rule provides a configuration that does not match its description. The IllegalArgumentException is just logged and the code proceeds to add the rule to the registry, so I think it doesn’t affect any actual functionality, but wanted to mention it here regardless in case I’m missing something simple.

Anyone else see this yet or have a different take?

1 Like

I’ve not seen this reported yet.

Do you have a manual install of the helper library or are you depending on the one that’s bundled with the add-on. If a manual install, is it updated to the latest?

As far as I’m aware this is using the bundled one, I haven’t done any manual installs. This is what karaf shows and what’s in the UI:

I can make a rule in the GUI and this doesn’t happen, although the GUI-based rules don’t seem to use “configuration” to store the various values.

When I inspect the RuleRegistry at runtime I see 2 Configuration Properties but zero ConfigurationDescriptions:

This appears to cut against expectations in RuleRegistryImpl.validateConfiguration() which appears to want them to match: openhab-core/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/RuleRegistryImpl.java at 5f074e3c980aa2d65b2c71e57eb759e805b7d4d5 · openhab/openhab-core · GitHub

It looks like the author of this code (below) starts with a Map of all of the configurations and removes them as they are compared to each config description. If any are left at the end, it throws the error. I believe my code above demonstrates zero config descriptions but 2 configs for this rule, I assume that might be a lead.

I pulled up a test instance on 4.3.7 and confirmed that a file-based JSRule behaves differently in 5.1, specifically 5.1 appears to store the code in “configuration” for a file-based rule but in 4.3.7 it’s stored in some other property (presumably under an action configuration?). In both 4.3.7 and 5.1 GUI-based rules are not stored in configuration but deeper in the object, in this case under actions[1].configuration.script, see #1 below.

Incidentally if I add a configuration like #2 above into a GUI-based rule I get the same validation error in all versions that file-based rules are giving me in 5.1. (Note debug logging on org.openhab.core.automation is required to see it)

My guess is below on what a file-based rule looks like in 5.1 which would explain the two extra configurations type and source. Although the GUI just displays source and no other elements.

Same issue, strange that nobody else reporting this. For a quick secondary test I just grabbed the sample from JavaScript Scripting documentation and same error:

2026-01-04 22:39:38.704 [DEBUG] [enhab.automation.openhab-js.triggers] - Creating timer.GenericCronTrigger trigger as 2e2eb676-c37d-4dfb-b90b-6e2442f5230a with config: {“cronExpression”:“0 0 17 * * ?”}
2026-01-04 22:39:38.711 [INFO ] [.openhab.automation.openhab-js.rules] - Adding rule: Balcony Lights ON at 5pm
2026-01-04 22:39:38.716 [DEBUG] [automation.internal.RuleRegistryImpl] - Added rule ‘BalconyLightsOn’ is invalid
java.lang.IllegalArgumentException: The rule ‘BalconyLightsOn’ has incorrect configurations

Seems like despite the error rule has been added and functional. Any suggestions?

K.

Nobody else might be seeing this because it requires DEBUG logging to catch it. Furthermore AFAIK, it doesn’t create any actual functional impact. Inspection of the code reveals that two methods are short-circuited by the throw, which probably aren’t actually doing anything useful in this case. This code below cascades the exception caught on #495 upward, but the next level catches it, logs to DEBUG and proceeds as if nothing had happened.

Yes, that’s exactly what is happening. And yes I have DEBUG enabled and noticed that right away, it is also not affecting rules that are already compiled, only new ones.

I think we need to raise a bug report, it is still annoying as hell.

K.