Multiple problems after rolling back from 4.2.0-1 to 4.1.3-1

Hi, everyone.

I’m trying to roll back from 4.2.0 to 4.1.3 because of some problems with my rules engine and I’m facing some issues with OH.

Hardware: Raspberry Pi 4B
OS: CentOS 9 64-bits
Java version: java-17-openjdk.aarch64
Persistence: MySQL + JDBC

I must disclaim that I didn’t have a backup of v4.1.3, so I restored (openhab-cli restore …) the backup I took from 4.2.0 right after installing OH 4.1.3 using dnf.

The 1st issue I’m facing is with the official add-ons. First, OH wouldn’t display them on the Add-On Store on MainUI, only the Marketplace Add-Ons were available. Restarting the OH service fixed the problem. Now I can find them but can’t install them:

08/05/2024 22:34:14.032 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-hue, openhab-persistence-jdbc-mysql, openhab-voice-marytts, openhab-binding-irobot, openhab-misc-openhabcloud, openhab-ui-habot, openhab-binding-tplinksmarthome, openhab-binding-sonos, openhab-binding-tapocontrol, openhab-binding-netatmo, openhab-binding-roku, openhab-binding-openweathermap, openhab-binding-astro, openhab-binding-telegram, openhab-binding-unifi, openhab-binding-systeminfo': Error:
	Error downloading mvn:org.apache.karaf.wrapper/org.apache.karaf.wrapper.core/4.4.4
08/05/2024 22:34:15.092 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed to refresh bundles after processing config update
org.apache.karaf.features.internal.util.MultiException: Error:
	Error downloading mvn:org.apache.karaf.wrapper/org.apache.karaf.wrapper.core/4.4.4
	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:474) ~[?:?]
	at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:469) ~[?:?]
	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:223) ~[?:?]
	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:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
	Suppressed: java.io.IOException: Error downloading mvn:org.apache.karaf.wrapper/org.apache.karaf.wrapper.core/4.4.4
		at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77) ~[?:?]
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
		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:1136) [?:?]
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
		at java.lang.Thread.run(Thread.java:833) [?:?]
	Caused by: java.io.IOException: Error resolving artifact org.apache.karaf.wrapper:org.apache.karaf.wrapper.core:jar:4.4.4: [Could not find artifact org.apache.karaf.wrapper:org.apache.karaf.wrapper.core:jar:4.4.4 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.apache.karaf.wrapper:org.apache.karaf.wrapper.core:jar:4.4.4 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:401) ~[?:?]
			at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73) ~[?:?]
			at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:669) ~[?:?]
			at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:290) ~[?:?]
			at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520) ~[?:?]
			at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408) ~[?:?]
			at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235) ~[?:?]
			at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212) ~[?:?]
			at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272) ~[?:?]
			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:539) [?:?]
			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:1136) [?:?]
			at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
			at java.lang.Thread.run(Thread.java:833) [?:?]
	Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.karaf.wrapper:org.apache.karaf.wrapper.core:jar:4.4.4
		at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431) ~[?:?]
		at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235) ~[?:?]
		at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212) ~[?:?]
		at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272) ~[?:?]
		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) ~[?:?]
		... 6 more

I’m not sure if it’s of any use, but I found the following after running

openhab> feature:list
Name                                              │ Version          │ Required │ State       │ Repository               │ Description
──────────────────────────────────────────────────┼──────────────────┼──────────┼─────────────┼──────────────────────────┼───────────────────────────────────────────────────
...
maven                                             │ 4.4.4            │          │ Uninstalled │ standard-4.4.4           

And trying to install it returns the following error:

openhab> feature:install maven                                                                                                                                              
Error executing command: Error:
	Error downloading mvn:org.apache.karaf.maven/org.apache.karaf.maven.core/4.4.4
	Error downloading mvn:org.apache.commons/commons-lang3/3.13.0

The 2nd error that happens quite often is:

08/05/2024 22:25:40.643 [ERROR] [ore.storage.json.internal.JsonStorage] - Couldn't deserialize value 'org.openhab.core.storage.json.internal.StorageEntry@667797f4'. Root cause is: java.lang.NumberFormatException: For input string: "2024-08-05T18:28:01.136699527Z"
08/05/2024 22:25:40.647 [ERROR] [ore.storage.json.internal.JsonStorage] - Couldn't deserialize value 'org.openhab.core.storage.json.internal.StorageEntry@63870b1b'. Root cause is: java.lang.NumberFormatException: For input string: "2024-07-25T20:25:29.172923657Z"

I manage all the Things via the MainUI, but the items via files. I have a backup of all the Items, but neither of the Things nor the UI (navigation), apart from the backup I took with openhab-cli.

Is there a simple way to restore them, so I don’t have to copy the YAML code page by page?

That’s unlikely to ever work. There are frequently changes to the fomats and properties stored in the JSONDB and elsewhere which get automatically fixed during the upgrade process. But that leaves those configs no longer compatable with the older version of OH.

I can’t answer the issue with the exception but even when/if you get that fixed you’re going to have to manually fix all the changes to the configs that were made between OH 4.1 and 4.2, find a backup (are you sure you don’t have a backup in $OH_USERDATA/backup? I know with some ways of installing OH a backup is automatically taken as part of the backup process), or start over from scratch.

Might be more worth your time to look into the issue to 4.2 than to try to revert. If you post them we might be of help to solve this quick?

Hi, @rlkoshak. Thanks for your comments and suggestions. I’m working on manually restoring my setup with 4.1.3 without any major errors until now.

@lsiepel, that was my first action, but I’ve been stuck for a while with a connected system with no automation, so I was forced to go for plan B.

@rlkoshak, I removed openHAB with DNF and everything was gone. I had no idea there were automatic backups as part of the update process. That would be very useful and I wonder if it’s possible to:

  1. Make them by default when updating via a package manager.
  2. Do not delete the backups when OH is removed via the package manager.

Do you think that could be possible?

I don’t know for sure if they are always made for all installation methods. I do know it’s done for Docker (which is what I use). It seems like a good idea to do the same foir apt/et al type installations too.

Then I’ll create 2 PRs:

  1. Automatically backup on update
  2. Do not delete the backups when uninstalling openHAB.

It’s a feature request, or will you be providing the solution code, too ?
I’m not convinced this is a good idea: out of scope for packages and not worth the effort to build right for all those package managers out there.
And if I were to guess I believe package maintainer(s) will see it the same way.
But when you want to ask for that, make sure you do in linux-distro repo.

Anyone else I recommend to use openHABian.
It already creates OH config backups if you update through the menu.

Hi, @mstormi.

A feature request. Thank you for pointing me in the right direction (linux-distro)! I think many people (clearly not most) don’t use openHABian, so it could be useful.

The Backup and Restore from Openbian is a great stuff in the OH envirorment.

I’ll take a backup before and after the upgrade.

Backups a stored in my case on the SD-Card. Those files can be copied e.g. to a NAS etc.
Before major updates I make a 1:1 image from the SDCard. If the installation works e.g. after four weeks take a new 1:1 image on this SD-Card.

So you have more or less all the time a working installation on different media’s and can easy restore if needed.

I my case I have three different 1:1 Installation on three different PI’s.
Different is the IP and that the rules are only runing on one (the production) installation.
From each I have several images on my NAS and a lot of backup files and more 1:1 on a SD-card.

Safety first :slight_smile:

Hi, everyone.

I created the following improvement requests: