Upgrade from Openhabian point release 3.4.5 failed.
I had been on Raspi with Buster, long standing system (Openhabian), did a manual apt upgrade as usual and bricked my installation as automatic upgrade to 4.0 was performed yet underlying Java upgrade failed.
Installed openhabian from openhabian-pi-raspios32-202212201337 to migrate from Buster to Bullseye
Restored 3.4 backup from previous installation - everything works.
There was an error or interruption during the execution of: “03 | Install openHAB”
Setting debug to maximum renders an output where I believe this is the relevant section:
+ apt-get install --allow-downgrades --yes -o DPkg::Lock::Timeout= --option Dpkg::Options::=--force-confnew openhab= openhab-addons=
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Version '' for 'openhab' was not found
E: Version '' for 'openhab-addons' was not found
+ return 100
+ echo FAILED
FAILED
I did not do a manual apt update & upgrade, which would be my natural next impulse, rather I welcome any guidance on locating and addressing the root cause. Thank you so much
Upgrade to OpenHAB 4 also fails using option 41 of openhabian-config:
I continued with the following steps:
I used menu option 41 to update to version 4, which worked without error
I then used menu option 20 to upgrade everything
Did a reboot
I can still ssh to the Raspi, however the server website is not reachable. The log file shows that something is wrong…
cat /var/log/openhab/openhab.log
2023-08-06 15:50:57.231 [ERROR] [Events.Framework ] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.xtext [135]
Unresolved requirement: Require-Bundle: org.objectweb.asm; bundle-version="[9.4.0,9.5.0)"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.emf.mwe.core; bundle-version="1.3.21"; visibility:="reexport"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.emf.mwe.utils; bundle-version="1.3.21"; visibility:="reexport"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.xtend; bundle-version="2.2.0"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.xtend.typesystem.emf; bundle-version="2.2.0"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.xtext.util; visibility:="reexport"
at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1847) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1840) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1745) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1667) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) ~[org.eclipse.osgi-3.18.0.jar:?]
I am not clear how I should do the upgrade nor how I can continue with OpenHAB 3.4.5 in a stable manner, as apt will automatically install OpenHAB 4. I believe I can fix the version somehow to 3.4.5 but didn’t investigate. I’d rather fix version 4…
You are right, only it had not been my intent to upgrade to OH4 at all. I was running my long time reliable Openhabian installation which was still on Debian 10 (basis for Openhabian when it was first installed). I merely did “apt update” and “apt upgrade” to maintain my installation, didn’t expect I would get an upgrade to OH4.
Thanks for pointing to the FAQ, I hadn’t seen that before. I found several statements that backups can only be restored to the same version they had been issued with. So I assumed that I would need to install a 3.4 release first in order to restore from the OH 3.4 backup. I see in the FAQ that there is another way and the current Openhabian release is able to restore an OH3 backup. Thank you for the clarification.
Still, I succeeded in restoring OH 3.4.5 based on the Openhabian point release with everything working, but now based on Debian 11. I had assumed I could upgrade from there via the menu options to OH4.
Of course, I am sorry, the options for upgrading from that situation that I tried were:
01
03 (Java 17 succeeded, upgrade failed due to version being empty)
41 (worked without error)
02 (not 20) to update everything
Then Openhab doesn’t start due to the quoted Java error.
I will try the path recommended in the FAQ starting with the 1.8 image right away with using 3.4. backup. Thank you!
Well. The menu text of 02 says 02 | Upgrade System Update all installed software packages (incl. openHAB) to their latest version
so what else did you expect.
I am sorry, no offense meant. I appreciate the terrific work you are providing and am very thankful. I was just trying to explain my reasoning, hoping it might help others. I regurlarly use ‘apt upgrade’ to maintain security and did not expect a breaking change, but could have looked at the package list up for upgrade. This can be accomplished with:
apt list --upgradable
Thank you for the clarification. Since I cannot accomplish the upgrade to OH4 yet (as discussed below), meanwhile I use apt-mark to lock the openHAB version to 3:
sudo apt-mark hold openhab openhab-addons
Holds can be shown with
apt-mark hold showholds
Without holding any packages I have followed the FAQ instructions in order to try migrating from OH 3.4.5. to 4.0.1 (openHAB 4 migration FAQ):
Latest openHABian release with change in openhabian.conf, backup as initial.zip, additional change : remove comment in the line where initial.zip is specified.
Everything is great, I (again) have a running OH3 instance (3.4.5) based on Bullseye and openHABian 1.8. So I have successfully moved from Debian 10 to Debian 11 using the FAQ instructions maintaining my site’s functionality. However the subsequent upgrade to OH4 fails:
results in the same error I had before (‘maximum’ debug output ):
2023-08-06_19:22:05_CEST [openHABian] Adding required keys to apt... OK
2023-08-06_19:22:05_CEST [openHABian] Installing selected openHAB version...
$ apt-get update
Hit:1 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:3 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:4 https://deb.nodesource.com/node_18.x bullseye InRelease
Reading package lists... Done
$ apt-get install --allow-downgrades --yes -o DPkg::Lock::Timeout= --option Dpkg::Options::=--force-confnew openhab= openhab-addons=
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Version '' for 'openhab' was not found
E: Version '' for 'openhab-addons' was not found
FAILED
It instructs apt to install “openhab” and “openhab-addons” each with an empty version information "= ".
So instead, I tried option 40->41, the config script claims that I am now running the stable version. The same apt-get install line is called but now the versions are specified:
Upgrading as proposed in the FAQ using menu option 03 did not work for me. It does not supply a version number and fails to install “openhab=” and “openhab-addons=” as discussed before
I used option 01 to chose the branch to latest, not release! (This apparantly did the trick.)
I then used option 40, 41 to “Install or switch to the latest openHAB Release”.
Now I didn’t get any errors. Note that I also had previously used
apt-mark hold openhab openhab-addons
Then used option 02 Upgrade System which upgrades all packages but not openhab, then
apt-mark unhold openhab openhab-addons
Now openHAB restartet without the above Java errors.