OpenHAB no longer working after upgrade

After upgrade the system (including openHAB) via

sudo apt-get update
sudo apt-get upgrade

I can no longer connect via web browser. It just says connection refused. SSH does work. When I issue the command

sudo systemctl status openhab.service

I get the following:

 openhab.service - openHAB - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2023-08-05 11:48:55 EDT; 10min ago
     Docs: https://www.openhab.org/docs/
           https://community.openhab.org
 Main PID: 1759 (java)
    Tasks: 29 (limit: 4915)
   CGroup: /system.slice/openhab.service
           └─1759 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.userdata=/var/lib/openhab -Dopenhab.logdir=/var/log/openhab -Dfelix.cm.

Aug 05 11:49:07 openhab karaf[1759]:         ... 12 more
Aug 05 11:49:07 openhab karaf[1759]: Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve openhab-core-base/4.0.0: missing requirement [openhab-core-base/4.0.0] osgi.identity; osgi.identity=org.openhab.core.conf
Aug 05 11:49:07 openhab karaf[1759]:         at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
Aug 05 11:49:07 openhab karaf[1759]:         ... 13 more
Aug 05 11:49:07 openhab karaf[1759]: Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.core.config.core/4.0.0: missing requirement [org.openhab.core.config.core/4.0.0] osgi.wiring.package; filter:
Aug 05 11:49:07 openhab karaf[1759]:         at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
Aug 05 11:49:07 openhab karaf[1759]:         ... 14 more
Aug 05 11:49:07 openhab karaf[1759]: Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"
Aug 05 11:49:07 openhab karaf[1759]:         at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
Aug 05 11:49:07 openhab karaf[1759]:         ... 15 more

cat /var/log/openhab/openhab.log shows the following:

2023-08-05 11:49:08.006 [ERROR] [ternal.service.BootFeaturesInstaller] - Error installing boot features
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,4.0.0]"; filter:="(&(osgi.identity=openhab-runtime-base)(type=karaf.feature)(version>=4.0.0)(version<=4.0.0))" [caused by: Unable to resolve openhab-runtime-base/4.0.0: missing requirement [openhab-runtime-base/4.0.0] osgi.identity; osgi.identity=openhab-core-base; type=karaf.feature [caused by: Unable to resolve openhab-core-base/4.0.0: missing requirement [openhab-core-base/4.0.0] osgi.identity; osgi.identity=org.openhab.core.config.core; type=osgi.bundle; version="[4.0.0,4.0.0]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.core.config.core/4.0.0: missing requirement [org.openhab.core.config.core/4.0.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common.registry)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]]]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:256) ~[?:?]
        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) ~[?:?]
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve openhab-runtime-base/4.0.0: missing requirement [openhab-runtime-base/4.0.0] osgi.identity; osgi.identity=openhab-core-base; type=karaf.feature [caused by: Unable to resolve openhab-core-base/4.0.0: missing requirement [openhab-core-base/4.0.0] osgi.identity; osgi.identity=org.openhab.core.config.core; type=osgi.bundle; version="[4.0.0,4.0.0]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.core.config.core/4.0.0: missing requirement [org.openhab.core.config.core/4.0.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common.registry)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve openhab-core-base/4.0.0: missing requirement [openhab-core-base/4.0.0] osgi.identity; osgi.identity=org.openhab.core.config.core; type=osgi.bundle; version="[4.0.0,4.0.0]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.core.config.core/4.0.0: missing requirement [org.openhab.core.config.core/4.0.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common.registry)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.core.config.core/4.0.0: missing requirement [org.openhab.core.config.core/4.0.0] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.openhab.core.common.registry)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
        ... 12 more
2023-08-05 11:49:11.073 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.smarthomej.binding.amazonechocontrol-3.2.7.jar
org.osgi.framework.BundleException: Could not resolve module: org.smarthomej.binding.amazonechocontrol [27]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"

        at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

I am dead in the water so if anyone could help ASAP, I would be greatly appreciated.

Did you upgrade to Java 17 ?

Nope, figured it would have either said to or did it. I’ll do that and try again.

EDIT: Documentation says:

openHABian will install openHAB 4 and Java 17 by default.

looks like the documentation needs updated or there is a bug in the update script.

that is meant for a fresh installation not for an installation that is being upgraded.

Your first post says you did a manual update/upgrade via apt, that‘s out of openHABians control.

But @Wolfgang_S is right, the docs refer to first install, not update/upgrade.

This is in the release notes:

openHABian will automatically install Java 17 during the upgrade.

2 Likes

It would have done that, too if properly used as recommended i.e. using menu 03.

2 Likes

It appears as though openhab has screwed my system. I had no choice but to upgrade via apt to get other updates. Buit, apparently, openhab is not able to handle (why is it even updatable via apt then?). I can’t upgrade to jdk17 because I’m on

Linux version 5.10.103-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1529 SMP Tue Mar 8 12:24:00 GMT 2022

which apparently is not compatible with either jdk17 or openhab 4 (again, why did it upgrade it if wasn’t compatible).

So unless someone sees anything above that is incorrect, how do I revert back to openhab 3 without loosing all my settings?

Okay. Luckly, I upgrade the openhabian OS and the was able to install JRE 17 and now it works. Two things should be looked at to prevent somebody else from encountering this:

  • Don’t register for update via apt
  • If 1 isn’t fixed, Fix documentation to make it clear that JRE 17 will NOT be intalled this route.

Better for 1 to be fixed.

There’s a lot wrong with what you’re saying here.
Noone and none of the docs said installing openhab via apt would install Java or do anything but install/upgrade the openHAB package.
And if on openHABian, to upgrade you should not be using apt but the proper menu option.

And if the below means you’re really using openHABian on Ubuntu then you’ve fully messed it up yourself.
Openhabian is not supported on Ubuntu as clearly state the docs.

Noone and none of the docs said installing openhab via apt would install Java or do anything but install/upgrade the openHAB package.

As show in previous messages, in at least two places the documentation (initial install and release notes) says it will

openHABian will automatically install Java 17 during the upgrade.

Show me a link where it says apt won’t do that; I may have missed that line.

The upgrade section from version 2 to 4 specifically says to use apt to do the upgrading.

My initial install (several years ago) used the openHabian image. The new instructions can be found here (option 1). The linux version shown above is what is a result of that install plus the upgrades over the years. Not to mention the documentation mentions Ubuntu all through it; if it isn’t supported, it should be removed. Did you also notice that the like provided also gives an option for install using apt?

I reiterate:

Two things should be looked at to prevent somebody else from encountering this:

  • Don’t register for update via apt
  • If 1 isn’t fixed, Fix documentation to make it clear that JRE 17 will NOT be installed this route.

Better for 1 to be fixed.

That would have prevented the grief I encountered. At minimum, if an update is attempted, it should fail and not leave the system unusable.

There is no such section on upgrades from OH2 to OH4.
Show the link.

All the quotes the others have given here are from the official openHABian docs or openHABian section of the Release Notes.
NONE of those did nor will ever tell to use apt at all yourself.
OpenHABian is a menu driven system it’s made that you don’t have to use apt.

Anything else is just a (false) interpretation of yours.

No. THE official openHABian docs definitely do NOT mention Ubuntu other than with the clear statement that it is NOT supported. It never ever was.

Reading and respecting the (right) docs rather than making assumptions would have.

I have the feeling you have either a fundamental misunderstanding of what openHABian is versus what openHAB itself is, or you have been using some wrong docs or misreading the right ones.

Rather than just refer to those please give the exact links here.

I’ll adjust the thread title and solution tick, too, as they’re misleading to readers.
Next time please also mind the posting rules below and clarify right in the original post what system you are using and what’s the proper context required for any reader to apply to understand your post.

How to ask a good question / Help Us Help You - Tutorials & Examples - openHAB Community

That links talks about Ubuntu, apt and upgrading fron OH2.

Changing the solution will only mislead others as that WAS the solution for me.

It looks like you are mixing up openHABian and openHAB. The first section discusses openHABian but everything else (apt and rpm based distributions) is openHAB on anything but openHABian.

Exactly. @edwolfe3 you misread those docs.

The solution tick isn’t there to document your outcome, it’s there to provide others a hint what they might want to try when they are in about the same situation as you and face about the same problem.
That now obviously doesn’t apply here.

I know yhe difference between openhabian and openhab. I think you are completly wrong and i stand by my solution.

The documentation isn’t clear that apt should not be used. If it shouldnt be used why does it let me? Why didn’t openhab at least stop the upgrade when it detected the envireonment wasn’t right capabke of running the upgrade?

The solution tick isn’t there to document your outcome, it’s there to provide others a hint what they might want to try when they are in about the same situation as you and face about the same problem.

The difference?

When i used apt to update other things, it updated openhab to v4 in an environment that did not support java 17. Therfore, i was unable to start the upgraded openhab server and was also unable to install java 17. Therefore MY SOLUTION BASED ON MY ISSUE was to upgrade ubuntu (which was setup using the original openhabian image). It then worked.

I know yhe difference between openhabian and openhab. I think you are completly wrong and i stand by my solution.

The documentation isn’t clear that apt should not be used.

This is very much a legitimate concern. I don’t think that the openhabian devs would any way be opposed to any PRs that improve on the documentation.

If it shouldnt be used why does it let me?

For a number of reasons (and I’m speaking as a non-openHABian user/developer):

  1. Because rolling your own packaging manager and distribution mechanism is a lot of work for no gain. It makes much more sense to use existing mechanisms and formats (such as apt/deb). It’s based on debian after all.
  2. There is little incentive to take away choice from end-users. The recommendation is “we strongly suggest you do it this way. If you don’t, you can, but you’re on your own”

Why didn’t openhab at least stop the upgrade when it detected the envireonment wasn’t right capabke of running the upgrade?

I’m not sure how openhab (the application) should prevent an OS level change.

The solution tick isn’t there to document your outcome, it’s there to provide others a hint what they might want to try when they are in about the same situation as you and face about the same problem.

The difference?

When i used apt to update other things, it updated openhab to v4 in an environment that did not support java 17. Therfore, i was unable to start the upgraded openhab server and was also unable to install java 17. Therefore MY SOLUTION BASED ON MY ISSUE was to upgrade ubuntu (which was setup using the original openhabian image). It then worked.

I think it’s very reasonable to assume that if you break things by using apt directly, you can also unbreak it by using apt. That however doesn’t mean that this is a solution that should be recommended. The recommendation is still to use the openhabian config tool, which if you do, do not get you into this mess.

And I’m saying that this is NOT clear in the documentation, but that aside, I wasn’t even trying to upgrade openhab when this happened. I was just trying to keep my system updated which then upgraded openhab and cause the problem. That would be the reason to create a custom package manager that doesn’t allow the update; maybe just put a warning that says openhab is not going to be updated use this other option instead.

I stand by openhab updating when it shouldn’t have caused my problem and the solution was to upgrade to a version of the OS that allowed me to get out of the mess OH created.

To prevent this from happening I think different package names e.g. openhab4, openhab5 like openjdk11, openjdk17 would be required. Going from one to an other version the package name explicitly needs to be changed.
But I assume this has other drawbacks.

1 Like

That was an openhabian distribution (iso) downloaded from a link on this page which was the current at the time. The command cat /proc/version shows ubuntu. So if ubuntu isnt supported why is openhabian using it as its base that is linked from yhe download oage and why does the documentation show commands for an ubuntu base?