ECMAScript 262 Edition 11 - Failed to retrieve script script dependency listener from engine bindings


when I use JavaScript rules or scripts (ECMA 2021) I get the following warning when I run the script:

[WARN ] [.internal.OpenhabGraalJSScriptEngine] - Failed to retrieve script script dependency listener from engine bindings. Script dependency tracking will be disabled.

After a couple seconds, the script runs just fine. However, the delay can very annoying - for example if you a rule triggers a light. If I run the script / rule again immediatly, no warning is showing and it runs smoothly. If the script is not executed for some time, the same issue occurs again.

The issue is independend from the complexity of the script - also a “console.log(“Hello World”);” shows the same warning. Does anyone have a solotion to this? Thank you!

Kind regards,

  • Platform information:
    • Hardware: Raspberry Pi 4, 4 GB

    • OS: "Raspbian GNU/Linux 10 (buster)

    • Java Runtime Environment: openjdk 11.0.11 2021-04-20 LTS // OpenJDK Runtime Environment Zulu11.48+21-CA (build 11.0.11+9-LTS) // OpenJDK Client VM Zulu11.48+21-CA (build 11.0.11+9-LTS, mixed mode)

    • openHAB version: 3.2.0

see here

Thank you - although the warning itself seems to be OK to ignore, the time lag it seems to cause is very annoying. Any workaround would be appreciated…

Correlation is not causation. The delay you are seeing is far longer than any I’ve seen reported recently but the delay is caused by OH loading and parsing the Script Actions. After that first run it reuses the Script Actions so the parsing delay doesn’t happen.

That warning you see happens when the script is parsed and loaded but it is almost certainly not the source of the delay. It just happens to occur when the script is loaded.

There were reports of similar behavior for Rules DSL rules in the past which you should be able to find by searching. I think the work around was to keep triggering the rule periodically to keep it from being garbage collected and needing to be reloaded and parsed.

1 Like


As i start migrating to ECMAScript 2021, i also encountered both this message and the delay.

@rlkoshak , I understand that correlation does not mean causality. I would like to start looking for the reason of the delay, but i have no idea where to look. Would you be able to give some pointers on where to start? I am running OH 3.3, and i literally installed the JS addon yesterday. There is not much else done in the system but creating 2 simple rules.

A somewhat related question i have is, what would be the best way to migrate rule templates?


I guess you can start to look at and profile the parts of the add-on code that loads and parses the files. I’m not sure where else I’d look but I don’t get that deep into the code.


If they are rule templates, migrate them like you’d migrate any of your code.

If they are installed form the Marketplace, the whole point of rule templates is you don’t need to touch the code. Your choices are:

  1. Reimplement the rule yourself and no longer use the template.
  2. Wait for the original developer to migrate the rule template (or help them do so).
  3. Just leave well enough alone.

The way that rule templates are intended to be used, you shouldn’t be worrying about migrating them. That’s not your job. You should just use them as written (or with minor changes to support a unique use case).