Javascript Scripting add-on keeps disappearing

  • Alma Linux 9.x
  • OH 5.0.2

Three times this weekend I’ve found that the Javascript Scripting add-on is not installed so a couple small inline scripts are failing to run. If I install the add-on the rules will work. But if there’s a restart of OH or the system reboots it disappears again.

What is the content of /etc/openhab/services/addons.cfg?

root@wopr3:~# cat /etc/openhab/services/addons.cfg

# Access Remote Add-on Repository
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons. (default is true)
#
#remote = true

# Some add-on services may provide add-ons where compatibility with the currently running system is not expected.
# Enabling this option will include these entries in the list of available add-ons.
#
#includeIncompatible = false

# The system can automatically suggest add-ons for installation using add-on finders.
# If you don't want add-on suggestions from specific finders, you can disable the respective finders.
# They are enabled by default.
#
#suggestionFinderIp = true
#suggestionFinderMdns = true
#suggestionFinderSddp = true
#suggestionFinderUpnp = true
#suggestionFinderUsb = true

# The add-on configuration in the lists below is applied EVERY TIME openHAB is started.
# Add-ons installed using the UI that do not occur in the lists will be uninstalled each startup.
# When lists are commented again any add-ons in the list remain installed and are not removed.
# So if you want to uninstall all add-ons part of a list, first remove all add-ons from it, restart
# openHAB and then comment the list.

# A comma-separated list of automation services to install (e.g. "automation = groovyscripting")
#automation = 
automation = rules-dsl

# A comma-separated list of bindings to install (e.g. "binding = knx,sonos,zwave")
#binding = 

# A comma-separated list of miscellaneous services to install (e.g. "misc = openhabcloud")
#misc = 

# A comma-separated list of persistence services to install (e.g. "persistence = jpa,rrd4j")
#persistence = 

# A comma-separated list of transformation services to install (e.g. "transformation = jsonpath,map")
#transformation = 

# A comma-separated list of UIs to install (e.g. "ui = basic,habpanel")
#ui = 

# A comma-separated list of voice services to install (e.g. "voice = googletts,marytts")
#voice = 

Just on a whim I installed the “Java 223 Scripting” addon, rebooted and it’s still there. At least it doesn’t seem to be a problem with installing other addons.

my guess is that it is related to

automation = rules-dsl

you should install all automation bindings only in one way. Means install all automation bindings only via web ui or all via addons.cfg

if the addon.cfg is processed and evaluated it detects that only “rules-dsl” is configured and maybe thats the reason why jsscripting is uninstalled after some time. The logic which is processing the addons.cfg has no knowledge about the installation way. It just sees that jsscripting is installed, but not configured in addons.cfg

1 Like

@holger_hees I don’t recall changing the addons.cfg file manually. Can I safely comment that line or remove the rules-dsl part and then add rules-dsl through the web UI?

I’m not 100% sure if "rules-dsl” is needed to get old dsl based rules working. Maybe this is a leftover. If you don’t need it (means you create only js based rules), just comment it out and install jsscripting via webui.

I’m gonna reboot and get a clonezilla backup and then try commenting that line out and add rules-dsl addon via the web UI. Have to wait until after work for that.

Rules DSL is installed by default. So I have no clue where this comes from or why this could be required. I don’t have this line in my addons.cfg. And this file is not written by OH itself. It could only be changed by directly editing the file or an OH upgrade script.

1 Like

Something weird is happening. I commented that line “automation = rules-dsl” in addons.cfg and almost nothing would work. So I reverted that change and got back to the same state I was in before. I can install Javascript Scripting but it’ll disappear on any OH restart. Tried installing it via the console and it shows up as installed but a minute or less after that it’ll disappear even without a restart.

Just installed Javascript and python scripting addons and restarted openhab. Went to set up a new rule using python and was able to select python as the engine, the script edit window came up but I couldn’t edit it. Went back to the list of rules, selected the rule I was working on tried to add an inline script and both Javascript and Python Scripting are both gone.

It looks like the addons will install but then they disappear after some random amount of time, and definitely disappear after an openhab restart or a system reboot.

Forgot one thing… In openhab.log I am seeing:

2025-10-31 06:47:51.204 [WARN ] [core.karaf.internal.FeatureInstaller] - The automation add-on 'rules-dsl' does not exist - ignoring it.

I did revert addons.cfg to have “automation = rules-dsl” again cause commenting it out made OH seem very unstable, things just weren’t behaving as usual.

I have never heard of that entry and there is no single hit when searching for it, you need to get rid of that.
Comment it or delete it and then check $OH_USERDATA/config/org/openhab/addons.config (addons.config, not addons.cfg), which gets populated automatically when making changes to the addons.cfg or through MainUI.
If that entry is present there, too, remove it (stop openHAB before removing). Then restart openHAB.

Make a backup of all files before changing anything.

If that entry is not present, clean cache and tmp folders after commenting or deleting the faulty entry.

1 Like

Commented the addons.cfg line. Stopped OH, cleared cache and tmp, restarted.

Just checked and python and javascript addons seem to be staying installed now and the addons.config looks correct.

root@wopr3:/var/lib/openhab/config/org/openhab# cat addons.config 
:org.apache.felix.configadmin.revision:=L"49"
automation="rules-dsl,pythonscripting,jsscripting"
binding="govee,astro,hue,telegram,zwavejs,zigbee,sonos,network"
core-config-discovery-addon="usb,ip,sddp,upnp,mdns"
misc="openhabcloud"
service.pid="org.openhab.addons"
ui="basic"

Hmm, I don’t think so: rules-dsl should not be there.

My addons.config:

automation="jsscripting"

My addons.cfg is empty, everything is commented. And I am able to write rules in DSL and JS …

But if it’s working: great :innocent:

1 Like