Error downloading mvn:org.openhab.addons

If you recently got problems trying to install addons on openHAB see below:

Try running openhab-cli showlogs and observe similar errors:

Error downloading mvn:org.openhab.addons....

Use openhab-cli info to locate the userdata folder.
Sudo edit this file:
{userdata}/etc/org.ops4j.pax.url.mvn.cfg
For hestia-pi-ONE-v1.2-dev images:
sudo nano /var/lib/openhab2/etc/org.ops4j.pax.url.mvn.cfg

Change the entry org.ops4j.pax.url.mvn.repositories to

org.ops4j.pax.url.mvn.repositories= \
 https://openhab.jfrog.io/openhab/libs-release@id=openhab,\
 https://jcenter.bintray.com/@id=jcenter

No need to reboot. Just wait 5 minutes. In our case, installation requests were satisfied automatically without having to re-request them from PaperUI.

Reference:

Thank you for this. One thing I didn’t quite understand, however, is why the file gets overwritten by OpenHab (and the values reverted) a few minutes after I edited it. I was able to get my packages updated, so I guess it doesn’t matter, but I couldn’t figure out why it would do that (even when the service had not yet started when I modified my sources).

I made this change to org.ops4j.pax.url.mvn.cfg, but I’m still getting errors when attempting to execute rules such as “Heating/Cooling Check”.

2021-12-29 19:43:55.137 [WARN ] [e.automation.internal.RuleEngineImpl] - Fail to execute action: 3
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.eclipse.smarthome.model.script.actions.ScriptExecution cannot be found by com.eclipsesource.jaxrs.publisher_5.3.1.20160228125
...

I looked around in the AddOns section of the Paper UI, but I didn’t see anything with “Script” or “ScriptExecution” in the name.

I also found that my changes are being reverted, exactly as @rucker reported. To attempt to answer this, I installed auditd but the kernel doesn’t have support for the audit subsystem. My plan to find what was making this change was to do something like this…

sudo auditctl -w /var/lib/openhab2/etc/org.ops4j.pax.url.mvn.cfg -p wa
tail -f /var/log/audit/audit.log

As a workaround, I made that file immutable with filesystem attributes:

sudo chattr +i /var/lib/openhab2/etc/org.ops4j.pax.url.mvn.cfg

It’s not the right solution, but it’s what I know and it’ll keep the settings correct for long enough to do what I need to do.

I tried removing the entire rules engine, thinking that if that were reinstalled, it might pick up the ScriptExecution class as well. The uninstall went fine, but this is where things got ugly. Now I don’t have a rules engine and I can’t get it back. Here’s the output of openhab.log:

2021-12-29 20:52:50.844 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:53:50.490 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:54:50.208 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:55:50.483 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:56:50.097 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:57:50.187 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)
2021-12-29 20:58:50.122 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-ruleengine': Error:
        Error downloading mvn:org.openhab.addons.bundles/org.openhab.binding.exec/[2.5.0,2.6)

Hi there. When I first encountered issues with installing addons due to the repository changes, I had considerable issues that I had to work through (really my fault because I ran the update script which was not intended for end users).

I don’t believe I ran into the specific issue with installing org.openhab.binding.exec you’re describing, but I did find one thing that helped me was to stop openhab, clear the cache, and start it again after making the repo updates via:
sudo systemctl stop openhab2.service && sudo openhab-cli clean-cache && sudo systemctl start openhab2.service

Obviously this might not fix your problem but it’s worth a shot

Thanks for the quick response. I tried that, but it didn’t help in my case. It just keeps spamming that same error in the logs. I’m not sure what I’m doing to cause this issue in the first place, but hopefully I’ll be able to track it down and let people know what NOT to do.