Cannot install jinja transformation on FreeBSD

  • Platform information:
    • Hardware: Amd64
    • OS: FreeBSD 13.1
    • Java Runtime Environment: openjdk 11.0.18 2023-01-17
    • openHAB version: openhab-3.4.2
  • Issue of the topic: Download error during Jinja transformation installation
  • If logs where generated please post these here using code fences:

This is the latest version packaged by FreeBSD. Addons are installed also:

# pkg info | grep openhab
openhab-3.4.2                  Vendor and technology agnostic open source smart-home software
openhab-addons-3.4.2           Addons for openhab

Same behavior regardless of remote option setting in /usr/local/etc/openhab/services/addons.cfg.

I have successfully installed MQTT. The instance was working for half year wihtout issues.

It seems that it is trying to install different version than is actually published on the server (2.12.2).
https://openhab.jfrog.io/ui/native/libs-release/com/fasterxml/jackson/core/jackson-databind/

Any recommendation, please? Should you need any data from the system, don’t hesitate to ask, please.

> openhab> feature:install openhab-transformation-jinja                                                 
> org.apache.karaf.features.internal.util.MultiException: Error:                                                Error downloading mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.12.6     
>         Error downloading mvn:com.fasterxml.jackson.core/jackson-core/2.12.6                                  Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.12.6         
>         Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.12.6                  Error downloading mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.12.6
>         Error downloading mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.12.6                           Error downloading mvn:com.fasterxml.jackson.core/jackson-databind/2.12.6.1
>         Error downloading mvn:com.fasterxml.jackson.core/jackson-annotations/2.12.6                           Error downloading mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.12.6
>         Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.12.6                 at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init
> >(MavenDownloadManager.java:91)                                                                               at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(Mave
> nDownloadManager.java:72)                                                                             
>         at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:457)            at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:452)    
>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:224)                                                                                                  
>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)                      at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceI
> mpl.java:1069)                                                                                                at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1
> 3(FeaturesServiceImpl.java:1004)                                                                              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)                         
>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  
>         at java.base/java.lang.Thread.run(Thread.java:829)
>         Suppressed: java.io.IOException: Error downloading mvn:com.fasterxml.jackson.module/jackson-mo
> dule-jaxb-annotations/2.12.6
> ...
> Error executing command: Error:                                                                       
>         Error downloading mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.12.6             Error downloading mvn:com.fasterxml.jackson.core/jackson-core/2.12.6                          
>         Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.12.6                 Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.12.6          
>         Error downloading mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.12.6           
>         Error downloading mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.12.6                   
>         Error downloading mvn:com.fasterxml.jackson.core/jackson-databind/2.12.6.1                            Error downloading mvn:com.fasterxml.jackson.core/jackson-annotations/2.12.6                   
>         Error downloading mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.12.6          
>         Error downloading mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.12.6

Looks like its inconsistency in the versions which are available/listed by jfrog. Maven central have it all.

As a workaround you can modify userdata/etc/org.ops4j.pax.url.mvn.cfg and add additional remote repository. To do so modify org.ops4j.pax.url.mvn.repositories property to be:

org.ops4j.pax.url.mvn.repositories= \
	https://openhab.jfrog.io/openhab/libs-release@id=openhab,
	https://repo1.maven.org/maven2@id=central

Hi Lukas,

thanks much for advice. I have modified /usr/local/share/openhab/etc/org.ops4j.pax.url.mvn.cfg to have:

org.ops4j.pax.url.mvn.repositories= \
        https://openhab.jfrog.io/openhab/libs-release@id=openhab, \
        https://repo1.maven.org/maven2@id=central

This is the only file distribute with openhab having same name. But no change, the log says the same error after openhab restart and after feature:install. Is there a way how can I check if the change was used at all, please? The actual configuration on FreeBSD is in /usr/local/etc/openhab, but there is no org.ops4j.pax.url.mvn.cfg in there.

# cd /usr/local/etc/openhab/
# ls
automation      icons           persistence     scripts         sitemaps        things
html            items           rules           services        sounds          transform
# ls services/
addons.cfg              readme.txt              runtime.cfg
addons.cfg.sample       rrd4j.cfg               runtime.cfg.sample

Thank you!

m.

Also OpenHAB is periodically trying to install it and it messes the log with the same β€˜dump’. Is there a way how to cancel the operation which I know is going to fail, please?

Okay, so I found the file to modify:

/var/db/openhab/userdata/etc/org.ops4j.pax.url.mvn.cfg

But now I get this error:

2023-03-28 09:42:47.385 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-transformation-jinja': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-transformation-jinja; type=karaf.feature; version="[3.4.2,3.4.2]"; filter:="(&(osgi.identity=openhab-transformation-jinja)(type=karaf.feature)(version>=3.4.2)(version<=3.4.2))" [caused by: Unable to resolve openhab-transformation-jinja/3.4.2: missing requirement [openhab-transformation-jinja/3.4.2] osgi.identity; osgi.identity=org.openhab.transform.jinja; type=osgi.bundle; version="[3.4.2,3.4.2]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.transform.jinja/3.4.2: missing requirement [org.openhab.transform.jinja/3.4.2] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.commons.net.util)(version>=3.9.0)(!(version>=4.0.0)))"]]

Thank you for any advice.

Failure you saw is having different nature. Try:

install mvn:commons-net/commons-net/3.9.0
feature:install openhab-transformation-jinja

Overall - the jinja transformation feature seems to be incomplete or not covered by deployment test resulting in missing dependencies.

Works like a charm now. Can I do something to fix the dependencies, please?

Thank you!
m.

Try clearing the bundle cache (userdata/cache).

If you use KAR based Marketplace add-ons, they can also cause wrong dependencies to be resolved. So in that case uninstalling such add-ons may help.

The Jinja transformation should use the Jackson bundles that are pre-installed in openHAB:

openhab> bundle:list -s | grep jackson                                                                                                                                                                                          
 29 β”‚ Active   β”‚  80 β”‚ 2.12.7                 β”‚ com.fasterxml.jackson.core.jackson-annotations
 30 β”‚ Active   β”‚  80 β”‚ 2.12.7                 β”‚ com.fasterxml.jackson.core.jackson-core
 31 β”‚ Active   β”‚  80 β”‚ 2.12.7.1               β”‚ com.fasterxml.jackson.core.jackson-databind
 32 β”‚ Active   β”‚  80 β”‚ 2.12.7                 β”‚ com.fasterxml.jackson.dataformat.jackson-dataformat-yaml
 33 β”‚ Active   β”‚  80 β”‚ 2.12.7                 β”‚ com.fasterxml.jackson.datatype.jackson-datatype-jsr310

So it should not try to download them.

I have cleared the cache and jackson version jumped from 2.16 to 2.17. All installs are working now.

Thank you very much indeed.
m.

1 Like