openHAB 3.2 Release discussion

This topic can be used to discuss problems/experiences/questions on the openHAB 3.2 release as announced in openHAB 3.2 is here!.

Hi, I updated from 3.1.1 to 3.2.0.
Now I get frequently the following error in openhab.log

Web Socket close 1005. Reason: null

i’m getting the same on OH 3.1.1, so i don’t think it is related to OH 3.2. Are you using the amazonechocontrol bindig?

Hi, yes. I’m using the amazonecho control addon

Hi,

I updated to 3.2.8 which fixed the issue:

Hi, first of all many thanks to those that have contributed to this release.

I just have setup a new openhabian instance which pulls in 3.2.0 as of the release

I encounter a problem a startup of openhab. It seems somehow related to log4j issue. Or is it a pure coincidence_

#2021-12-20 14:00:16.079 [ERROR] [ternal.service.BootFeaturesInstaller] - Error installing boot features
org.apache.karaf.features.internal.util.MultiException: Error:
        Error downloading mvn:org.ops4j.pax.logging/pax-logging-api/2.0.12
        Error downloading mvn:org.ops4j.pax.logging/pax-logging-log4j2/2.0.12
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:91) ~[?:?]
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.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(FeaturesServiceImpl.java:1069) ~[?:?]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
        Suppressed: java.io.IOException: Error downloading mvn:org.ops4j.pax.logging/pax-logging-api/2.0.12
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77) ~[?:?]
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
                at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
                at java.lang.Thread.run(Thread.java:829) [?:?]
        Caused by: java.io.IOException: Error resolving artifact org.ops4j.pax.logging:pax-logging-api:jar:2.0.12: [Could not find artifact org.ops4j.pax.logging:pax-logging-api:jar:2.0.12 in openhab (https://openhab.jfrog.io/openhab/libs-release/)]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803) ~[?:?]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774) ~[?:?]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657) ~[?:?]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598) ~[?:?]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565) ~[?:?]
                at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52) ~[?:?]
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) ~[?:?]
                ... 6 more
                Suppressed: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.ops4j.pax.logging:pax-logging-api:jar:2.0.12 in openhab (https://openhab.jfrog.io/openhab/libs-release/)
                        at shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48) ~[?:?]
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:368) ~[?:?]
                        at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75) ~[?:?]
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:642) ~[?:?]
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262) ~[?:?]
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:489) ~[?:?]
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:390) ~[?:?]
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:215) ~[?:?]
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:192) ~[?:?]
                        at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:247) ~[?:?]
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767) ~[?:?]
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657) ~[?:?]
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598) ~[?:?]
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565) ~[?:?]
                        at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52) ~[?:?]
                        at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) ~[?:?]
                        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
                        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

I just upgraded on ubuntu x86_64 docker from 3.2.0-M4 to 3.2.0 and it does not start anymore. Upgrade seemed to have worked in general:

Performing pre-update tasks for version 3.2.0:
  Adding '.bak' to /openhab/userdata/etc/log4j2.xml
  Using default file /openhab/userdata/etc/log4j2.xml
Replacing userdata system files with newer versions...
Clearing cache...
Performing post-update tasks for version 3.2.0:
SUCCESS: openHAB updated from 3.2.0.M4 to 3.2.0

docker logs also seems ok:

...
+ '[' 'gosu openhab tini -s ./start.sh' == 'gosu openhab tini -s ./start.sh' ']'
+ command=($@ server)
+ exec gosu openhab tini -s ./start.sh server
Launching the openHAB runtime...

But all log files are empty and when trying to start a shell:

/srv/openhab$ docker exec -it openhab_openhab_1 /openhab/runtime/bin/shell
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at org.apache.karaf.shell.impl.console.JLineTerminal.<clinit>(JLineTerminal.java:53)
	at org.apache.karaf.shell.impl.console.standalone.Main.run(Main.java:177)
	at org.apache.karaf.shell.impl.console.standalone.Main.run(Main.java:149)
	at org.apache.karaf.shell.impl.console.standalone.Main.run(Main.java:82)
	at org.apache.karaf.shell.impl.console.standalone.Main.main(Main.java:64)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 5 more

Any ideas? Upgrades have worked very fine since 3.0 for me until now.

1 Like

@timbms This sounds as if the karaf feature xml file was not correctly overwritten by the update. I did an 3.1->3.2 update through APT and it worked as expected. Could you try to manually replace the content of that file as provided in the link above?

1 Like

@andres_meyer I am not using docker myself, so @wborn might be the best to comment here. But what I see is that you are calling runtime/bin/shell, which we assumed are not used. You would have to change them manually to put the correct version (2.0.13) of pax-logging-api on your classpath.

If you experience troubles with missing, or wrong pax logging version being used have a look on workaround I mentioned there: Log4j vulnerability - #49 by splatch. Mount files which are missing from host system or other container if you prefer, but mount ones which are free of vulnerabilities.

You can also use the /openhab/runtime/bin/client script. That one does work.

/srv/openhab$ docker exec -it openhab_openhab_1 /openhab/runtime/bin/client
Logging in as openhab
Failed to get the session.

Somehow does not work for me. But I don’t know where to look for the errors, /userdata/logs/openhab.log is empty, and docker logs just look normal.

I don’t know how much patience you have… but when openHAB isn’t fully started, it is normal to see this “Failed to get the session.” and empty logs.

Well, I waited for 2h now… And this is a NUC with 16GB RAM, SSD and i5-8259U where it normally starts in a second or so.

dd6b99cffb24   openhab/openhab:milestone      "/entrypoint gosu op…"   2 hours ago    Up About an hour (unhealthy)

The file org.apache.karaf.features.xml was functionally empty:

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
        http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- you can eventually blacklist features repositories, features, or even bundle here, to exclude from resolution -->
<!-- <blacklistRepositories/> -->

I replaced it with

<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
        http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- you can eventually blacklist features repositories, features, or even bundle here, to exclude from resolution -->
<!-- <blacklistRepositories/> -->

<bundleReplacements>
    	<bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-api/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-api/2.0.13" mode="maven" />
    	<bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-log4j2/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-log4j2/2.0.13" mode="maven" />
    	<bundle originalUri="mvn:org.ops4j.pax.logging/pax-logging-logback/[0,2.0.13)" replacement="mvn:org.ops4j.pax.logging/pax-logging-logback/2.0.13" mode="maven" />
</bundleReplacements>

openhabian works on 3.2.0 again!
I found the culprit:

restore

replaces the file

3 Likes

I can see the 2.0.13 version being in there

/srv/openhab$ docker exec -it openhab_openhab_1 ls /openhab/runtime/system/org/ops4j/pax/logging/pax-logging-log4j2
2.0.13

which seem to be the latest ones (Maven Central Repository Search).

interesting, when starting with:

/srv/openhab$ docker-compose run --entrypoint /openhab/start_debug.sh openhab
Launching the openHAB runtime...
Listening for transport dt_socket at address: 5005

I can attach the debugger, so it is running, but no services are running (eg, nothing on 8080) and no logs are written.
Does it work for anyone with docker?

Was not able to fix it for now, reverted back to M4

I can confirm, that at least the RC1 version works fine with Docker.

Just as a data point, I upgraded docker from 3.2.M3 to M5 to RC1 to 3.2.0 release, over time as they were released, without any significant issues. Needed the multiple restarts to get everything synced, but that has been standard practice sin 2.5.x. Everything working as expected at this point.

1 Like