OH4 on buster

I installed 4.0 snapshot via openhabian-config on my RPI4 and it resulted into

org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-runtime-base; type=karaf.feature; version="[4.0.0.SNAPSHOT,4.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=openhab-runtime-base)(type=karaf.feature)(version>=4.0.0.SNAPSHOT)(version<=4.0.0.SNAPSHOT))" [caused by: Unable to resolve openhab-runtime-base/4.0.0.SNAPSHOT: missing requirement [openhab-runtime-base/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=openhab-core-automation-module-script; type=karaf.feature [caused by: Unable to resolve openhab-core-automation-module-script/4.0.0.SNAPSHOT: missing requirement [openhab-core-automation-module-script/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=openhab-core-base; type=karaf.feature [caused by: Unable to resolve openhab-core-base/4.0.0.SNAPSHOT: missing requirement [openhab-core-base/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.core.automation; type=osgi.bundle; version="[4.0.0.202212240306,4.0.0.202212240306]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.core.automation/4.0.0.202212240306: missing requirement [org.openhab.core.automation/4.0.0.202212240306] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0.202212240301: missing requirement [org.openhab.core/4.0.0.202212240301] 
osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]]]]]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.17.200.jar:?]

I overlooked that it hints into the direction of jdk17 - of course. :stuck_out_tongue_closed_eyes:

And I could have known this, I admit! openHAB 4.0 SNAPSHOT discussion - #21 by wborn

So my first feedback or question would be (no complaint :pray: );

Doesn’t it make sense that openhabian-config automatically either checks if JDK 17 is installed and informs the user or directly does the upgrade before installing 4.0?

Anyways, I then tried to install jdk 17 via openhabian-config but then it fails with

 ....

+ cond_redirect apt-get install --yes openjdk-17-jre-headless
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ apt-get install --yes openjdk-17-jre-headless \033[39;49;00m'

$ apt-get install --yes openjdk-17-jre-headless
+ apt-get install --yes openjdk-17-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openjdk-17-jre-headless : Depends: libc6 (>= 2.34) but 2.28-10+rpt2+rpi1+deb10u1 is to be installed
                           Depends: libgcc-s1 (>= 3.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
+ return 100
+ echo FAILED

I even did an

apt-get update

but it didn’t help (the above log is after the apt-get update).

Any idea how to proceed or fix this?

Should I dare to do a

sudo apt upgrade -y

?

What’s your base OS image? Could it be an older version like stretch or buster?

1 Like

What’s the output of (don’t press Y)

apt full-upgrade

And also:

cat /etc/os-release

I am pretty sure I have openhabian 1.7.5 (the latest version) installed (don’t know how to verify that though) and the I login it says

Release = Raspbian GNU/Linux 10 (buster)
Kernel = Linux 5.10.63-v7l+

So, yes, it IS BUSTER but

The last openhabian OS upgrade was done during 1.7.1 to BULLSEYE and the release notes say

openHABian v1.7.1
We have upgraded our base operating system to Raspberry Pi OS **Bullseye**.

As usual upgrades on supported systems will be unaffected, use the openhabian-config menu to apply any updates available to your system.
We will not automatically update your current base system (i.e buster -> bullseye) - don't fix what ain't broken.
Debian buster will be at least supported two more years. If you are eager to upgrade, read up on dist-upgrade or reinstall your system. Please note that if you choose to upgrade and not reinstall, you are on your own, don't expect to get support from the developers of openHABian if something goes wrong.

So I am wondering why I am on BUSTER?

I just had the idea to select

but it didn’t help either.

Thanks, I was always looking for that as there are so many different way to detect the version of the different linuxes :wink:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Doesn’t seem an upgrade would do anything at all, would it?

The above release notes/CHANGELOG says:

We will not automatically update your current base system (i.e buster → bullseye) - don’t fix what ain’t broken.

Reading through the description, I’d guess this option only performs an apt upgrade or apt full-upgrade which upgrades all installed packages but keeps the distro version.
As described in the CHANGELOG above, the command to upgrade the system would be apt dist-upgrade, but those operations are potentially risky — I wouldn’t recommend to do.

1 Like

Ok, only now I understand what it seem to mean: openhabian will NOT automatically upgrade to bullseye even though when you install it fresh it would be based on bullseye (sometimes you read something but you just overread it even though in this case the statement is more than clear - mea culpa).

Is that correct?

Anyway, do I need bullseye for jdk17 or should it work on buster (I would guess so) and if the latter is right, why doesn’t it install correctly?

@florian-h05 and I joint forces on that offline and this is what we found out so far

As it says it requires a new libc6

Depends: libc6 (>= 2.34) but 2.28

The following exactly shows the version I am on with BUSTER

dpkg -l | grep libc6
ii  libc6:armhf                    2.28-10+rpt2+rpi1+deb10u1           armhf        GNU C Library: Shared libraries
ii  libc6-dbg:armhf                2.28-10+rpt2+rpi1+deb10u1           armhf        GNU C Library: detached debugging symbols
ii  libc6-dev:armhf                2.28-10+rpt2+rpi1+deb10u1           armhf        GNU C Library: Development Libraries and Header Files

The apt-repos (seem to) show that there is no newer version available for Buster (or I am wrong?) which would mean (these are more like questions and not statements)

  • we either have to pull from an unstable version (how?)
  • or we have to tell everyone for 4.0 to move to bullseye (which we probably do have to support with openhabian-config)

I am not a linux expert and I am not saying what has to be done but only try to document what I am experiencing.

You could try installing an unstable version which I did for the purpose of research (sudo apt install libc6 -t unstable) but it broke my system (sudo: account validation failure, is your account locked?), so I do not recommend that!

Zulu

openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8)
OpenJDK Server VM Zulu17.38+21-CA (build 17.0.5+8, mixed mode)

seems to run on Buster.

2 Likes

Too late :stuck_out_tongue_closed_eyes: but probably a good choice for all others and an option to move forward.

But the openHABian config-tool has no option to install Zulu Java 17, IIRC they switched to OpenJDK as the primary Java provider.

That is true, openhabian-config doesn’t provide it.

What I did so far:

  • I completely wiped my card and installed the latest openhabian-snapshot 4.0.0. Note that it does not install 4.0.0 by default (I think it always installs the latest release)
  • I then also sdk-man (see https://foojay.io/today/java-17-on-the-raspberry-pi/) which really is hazzle free on installing an sdk. I installed ZULU-17.0.5 which I then verified
openhabian@openhabian:~ $ java -version
openjdk version "17.0.5" 2022-10-18 LTS
OpenJDK Runtime Environment Zulu17.38+21-CA (build 17.0.5+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.38+21-CA (build 17.0.5+8-LTS, mixed mode)

Note that

  • I installed the JDK and not the JRE
  • it seems that JAVA_HOME is not set (don’t know why) - does openhab require it?

However, it seems that openhab is not using that java version as I am still getting that error and it just starts from

“/usr/bin/java”

which is

/usr/bin/java -version

openjdk version “11.0.16” 2022-07-19

org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-runtime-ui; type=karaf.feature; version="[4.0.0.SNAPSHOT,4.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=openhab-runtime-ui)(type=karaf.feature)(version>=4.0.0.SNAPSHOT)(version<=4.0.0.SNAPSHOT))" [caused by: Unable to resolve openhab-runtime-ui/4.0.0.SNAPSHOT: missing requirement [openhab-runtime-ui/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=openhab-core-ui-icon; type=karaf.feature [caused by: Unable to resolve openhab-core-ui-icon/4.0.0.SNAPSHOT: missing requirement [openhab-core-ui-icon/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=openhab-core-base; type=karaf.feature [caused by: Unable to resolve openhab-core-base/4.0.0.SNAPSHOT: missing requirement [openhab-core-base/4.0.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.core.automation; type=osgi.bundle; version="[4.0.0.202212240306,4.0.0.202212240306]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.core.automation/4.0.0.202212240306: missing requirement [org.openhab.core.automation/4.0.0.202212240306] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0.202212240301: 

missing requirement [org.openhab.core/4.0.0.202212240301] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]]]]]

	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.17.200.jar:?]

What is the output of:

dpkg -l | grep jre

ii openjdk-11-jre-headless:arm64 11.0.16+8-1~deb11u1 arm64 OpenJDK Java runtime, using Hotspot JIT (headless)

Even though I set JAVA_HOME

export JAVA_HOME=/home/openhabian/.sdkman/candidates/java/current/bin/java

karaf is still starting from /usr/bin/java

As this a symlink, would it be correct to redirect the symlink to the new location?

Current setup:

openhabian@openhabian:/etc/systemd/system $ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Dec 26 12:14 /usr/bin/java -> /etc/alternatives/java
openhabian@openhabian:/etc/systemd/system $ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 43 Dec 26 12:14 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-arm64/bin/java

I think whenever I install java I install the jre rather than the jdk.

You can use update-alternatives to switch all the relevant links.

Thanks Wolfgang, I didn’t know (again something new that I learned!)

I have relinked the location via

cd /etc/alternatives/
sudo ln -sfn /home/openhabian/.sdkman/candidates/java/current/bin/java java

(my hope would be that this would be adapted in case openhabian-config eventually delivers a different distribution)

at least now openHAB is starting up again and 4.0.0

is up

image

However there are a lot of issues in installing the bindings after I restored by backup. Basically all of my bindings failed to install:

2022-12-26 13:55:37.262 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-package-standard': Error:

	Error downloading mvn:com.google.code.gson/gson/2.8.9

2022-12-26 13:55:38.581 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-hue, openhab-persistence-mapdb, openhab-binding-deconz, openhab-misc-openhabcloud, openhab-binding-network, openhab-persistence-influxdb, openhab-ui-habpanel, openhab-binding-nanoleaf, openhab-binding-jeelink, openhab-automation-jsscripting, openhab-binding-shelly, openhab-binding-chromecast, openhab-binding-mqtt, openhab-transformation-map, openhab-binding-ipcamera, openhab-binding-lgwebos, openhab-binding-systeminfo, openhab-binding-icalendar, openhab-binding-mail, openhab-voice-googletts, openhab-transformation-regex, openhab-binding-yamahareceiver, openhab-transformation-jsonpath, openhab-binding-homeconnect, openhab-binding-zwave, openhab-persistence-rrd4j, openhab-ui-basic, openhab-binding-ntp, openhab-binding-openweathermap, openhab-binding-gardena, openhab-binding-http, openhab-binding-astro, openhab-binding-unifi, openhab-binding-squeezebox, openhab-binding-gpstracker, openhab-binding-onkyo': Error:

	Error downloading mvn:com.google.code.gson/gson/2.8.9
2022-12-26 13:55:39.830 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed to refresh bundles after processing config update
org.apache.karaf.features.internal.util.MultiException: Error:
	Error downloading mvn:com.google.code.gson/gson/2.8.9
	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) ~[?:?]
	....
	Suppressed: java.io.IOException: Error downloading mvn:com.google.code.gson/gson/2.8.9
		at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77) ~[?:?]
		....
	Caused by: java.io.IOException: Error resolving artifact com.google.code.gson:gson:jar:2.8.9: [Could not find artifact com.google.code.gson:gson:jar:2.8.9 in openhab (https://openhab.jfrog.io/openhab/libs-snapshot/)]
		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 com.google.code.gson:gson:jar:2.8.9 in openhab (https://openhab.jfrog.io/openhab/libs-snapshot/)
			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 
....
	Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact com.google.code.gson:gson:jar:2.8.9
		at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:413) ~[?:?]
.....
		at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) ~[?:?]
		... 6 more


should be located in /usr/share/openhab/runtime/system/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar.
I think they are normally downloaded during install resp. upgrade in this case from JFrog

IIRC OH4 should use GSON 2.9.1.