Update from OH4.0.1 to 4.0.2 (docker) results in ERROR:HANDLER for 99% of openhab things

No, your mounts look OH. I couldn’t begin to guess why your add-ons didn’t get installed. If it ever happens again, we’ll want to look into it. At this point all I can recommend is to give OH time to come up and install everything that first time after an upgrade. It can sometimes take quite some time.

…it did not install any lost binding itself in the last 5 hours. Also i greped for errors in openhab.log and nothing was reportet from unsuccessful download or something from bindings (only the javascript from engine not yet reinstalled) so from my opinion it could also be that it wasnt initiated automaticly. But if someone else the same problem appeared he/she could write a notice here to see if it is a generally problem. For me its solved by the manual action :slight_smile:

But you said you rebooted. It might be the case that if the installation of the add-ons were interrupted during that reboot they became corrupted. Clearing the cache was exactly the right remedy if that was the case.

I don’t think we have enough details to really know what happened. I’m just making educated guesses.

1 Like

I switched over to 4.0.2. (docker) It started ok from what I could see in the console. But I cannot get any other response out of it - neither the browser log nor the UI. Switching back to 3.x - everything back to normal.
I also tried 4.0.1 which did start (incl. UI) but often lost the connection to my homematic binding.

Please create your own post @s0170071 and provide detailed logging and what you already tried to resolve it.

2 Likes

Actually I did solve it:

Sorry for the hijacking attempt :wink:

today i had the same problem again. All addons were lost. The only thing what happened was a restart.

What i also dont understand: - “openhab_addons:/openhab/addons” The Folder itself is empty:
docker exec -it openhab_openhab_1 ls -la /openhab/addons
total 12
drwxr-xr-x 2 openhab openhab 4096 Aug 28 15:14 .
drwxr-xr-x 1 openhab openhab 4096 Aug 16 03:47 …

Where are the cached Bindings? What can i do?

Cached bindings are in $OH_USERDATA/cache. The addons folder is only a place to put .jar and .kar files to install addons manually instead of through OH itself. For most users that folder remains and will forever remain empty.

Watch $OH_USERDATA/logs/update.log. Is it doing an update prior to when you lose the add-ons? An update includes a clearing of the cache which forces a reinstallation of all the add-ons. You want this to happen when the version of OH changes, but no on every startup.

One thing you can do to lessen the impact of this problem is to download the .kar file with all the addons from the download page and drop that into the addons folder. Instead of reaching out to the internet to download the add-ons it will pull from that .kar file. However, it’ll be up to you to ensure that .kar file always matches your OH version. And of course it does nothing to solve the root problem.

Hi Rich,
Thanks. In the update.log is exactly same what i copied in first post of this case.

The newly downloaded bindings are in there (also outside container on the volume whih i verified).

Thanks for the workaround with the kar files which i will do if it happens again.

So something seems there which is cleaning this cache from whatever reason. Can i do something to find out from what this comes? In openhab.log there was no hint.

As i told i had such behavior never before 4.0.2. You know from changes which impacting such kind of behavior?

There wouldn’t be anything there. OH doesn’t clean out it’s own cache. That always comes from somewhere external.

In Docker the only thing that clears the cache is the entrypoint.sh script which only does that if it detects that the version of OH running in the container is different from the version specified in the configs, specifically $OH_USERDATA/etc/version.properties. When the versions are different it makes a backup of userdata ($OH_USERDATA/backup), deletes the contents of cache and tmp (clearing the cache) and replaces etc with the defaults (with some exceptions, I don’t think it replaces log4j2.xml, users.properties, and similar files which are likely to be customized by end users). You should see these briefly mentioned in update.log. Here is my most recent update from a week ago.

Image and userdata versions differ! Starting an upgrade.
You can find backup of userdata in /openhab/userdata/backup/userdata-2023-08-22T10-21-50.tar

################################################
          openHAB Docker update script
################################################

The script will attempt to update openHAB to version 4.1.0-SNAPSHOT
Please read the following ESC[32mnotesESC[m and ESC[31mwarningsESC[m:

Replacing userdata system files with newer versions...
Clearing cache...

Starting JSON database update...
[main] INFO org.openhab.core.tools.internal.Upgrader - Already executed 'itemCopyUnitToMetadata' on 2023-05-25T10:39:15.030364826-06:00[America/Denver]. Use '--force'  to execute it again.
[main] INFO org.openhab.core.tools.internal.Upgrader - Already executed 'linkUpgradeJsProfile' on 2023-05-25T10:39:15.085525400-06:00[America/Denver]. Use '--force'  to execute it again.
JSON database updated successfully.


SUCCESS: openHAB updated from 4.1.0-SNAPSHOT to 4.1.0-SNAPSHOT

There will not be an update.log file at all in cases where you’ve started a container that matches the version of the configs.

Outside of that, if something is deleting these folders it’s outside of openHAB and the container.

docker exec -it openhab_openhab_1 ls -la /openhab/userdata/etc/version.properties
-rw-r--r-- 1 openhab openhab 342 Aug 16 10:35 /openhab/userdata/etc/version.properties

The date matches the date of the update.log and the beginning of this thread…

Outside container are only Backupscripts and to the server no other persons should have access

So its very mysterious…

SD or SSD? Sudden loss of power instead of a normal shutdown?

… no powerloss, no reboot, only containerrestart. Its an ssd

docker ps |grep openhab_openhab_1
ffa033886a19   local/openhab:latest             "/entrypoint gosu op…"   2 hours ago    Up 2 hours (healthy)                                                                                                                                                                                                                                                                                                                                                                                      openhab_openhab_1
uptime -s
2023-08-25 17:20:27

When all other problems are eliminated, a health check on the file system/storage is prudent. I’ve got nothing else.

interesting: The count of directories in cache and on screenshot of webgui of installed bindings are mismatching

docker exec -it openhab_openhab_1 ls -la /openhab/userdata/cache
total 44
drwxr-xr-x   7 openhab openhab  4096 Aug 24 08:18 .
drwxr-xr-x  22 openhab openhab  4096 Aug 23 09:59 ..
-rw-r--r--   1 openhab openhab 13089 Aug 24 08:18 1692772817522.log
drwxr-xr-x 283 openhab openhab  4096 Aug 28 16:25 org.eclipse.osgi
drwxr-xr-x   2 openhab openhab  4096 Aug 16 17:32 org.openhab.binding.chromecast
drwxr-xr-x   2 openhab openhab  4096 Aug 28 10:27 org.openhab.binding.icalendar
drwxr-xr-x   2 openhab openhab  4096 Aug 16 17:31 org.openhab.binding.openweathermap
drwxr-xr-x   2 openhab openhab  4096 Aug 23 10:00 org.openhab.voice.tts


There are definitively more bindings installed which the Screenshot shows.
And the as installed shown bindings are working but i dont know where they are installed if not in cache-folder…

Not every add-on gets it’s own root folder. I’ve never had this problem and I’ve only the following:

rich@argus:/s/o/userdata (main) ✗ 👁️  ls -l cache
total 24
drwxr-xr-x 332 openhab openhab  4096 Aug 24 09:30 org.eclipse.osgi
drwxr-xr-x   2 openhab openhab 12288 Aug 28 06:46 org.openhab.binding.chromecast
drwxr-xr-x   2 openhab openhab  4096 Aug 28 00:32 org.openhab.binding.openweathermap
drwxr-xr-x   2 openhab openhab  4096 Aug 22 10:34 org.openhab.voice.tts

It looks like the rest show up under tmp/mvn/org/openhabn.addons/bundles

rich@argus:/s/o/userdata (main) ✗ 👁️  cd tmp/mvn/org/openhab/addons/bundles/
rich@argus:/s/o/u/t/m/o/o/a/bundles (main) ✗ 👁️  ls
org.openhab.automation.jsscripting     org.openhab.binding.mqtt.espmilighthub  org.openhab.binding.roku                      org.openhab.binding.zigbee.ember      org.openhab.persistence.rrd4j
org.openhab.binding.amazonechocontrol  org.openhab.binding.mqtt.generic        org.openhab.binding.shelly                    org.openhab.binding.zigbee.firmware   org.openhab.transform.jinja
org.openhab.binding.astro              org.openhab.binding.mqtt.homeassistant  org.openhab.binding.vesync                    org.openhab.binding.zigbee.serial     org.openhab.transform.jsonpath
org.openhab.binding.chromecast         org.openhab.binding.mqtt.homie          org.openhab.binding.zigbee                    org.openhab.binding.zigbee.telegesis  org.openhab.transform.map
org.openhab.binding.http               org.openhab.binding.mqtt.ruuvigateway   org.openhab.binding.zigbee.cc2531             org.openhab.binding.zigbee.xbee       org.openhab.transform.regex
org.openhab.binding.ipcamera           org.openhab.binding.network             org.openhab.binding.zigbee.console            org.openhab.binding.zwave             org.openhab.voice.googletts
org.openhab.binding.mail               org.openhab.binding.networkupstools     org.openhab.binding.zigbee.console.ember      org.openhab.io.openhabcloud
org.openhab.binding.mqtt               org.openhab.binding.openweathermap      org.openhab.binding.zigbee.console.telegesis  org.openhab.persistence.mapdb

more differences with this folder:

docker exec -it openhab_openhab_1 ls -la /openhab/userdata/tmp/mvn/org/openhab/addons/bundles
total 144
drwxr-xr-x 36 openhab openhab 4096 Aug 28 11:19 .
drwxr-xr-x  4 openhab openhab 4096 Aug 23 09:59 ..
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:01 org.openhab.automation.jsscripting
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:48 org.openhab.automation.jsscriptingnashorn
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:27 org.openhab.binding.astro
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:32 org.openhab.binding.chromecast
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:41 org.openhab.binding.dsmr
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:28 org.openhab.binding.feed
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:33 org.openhab.binding.gpstracker
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:32 org.openhab.binding.hpprinter
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:06 org.openhab.binding.http
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:05 org.openhab.binding.icalendar
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:28 org.openhab.binding.ipcamera
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:01 org.openhab.binding.knx
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:39 org.openhab.binding.mail
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:03 org.openhab.binding.network
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:03 org.openhab.binding.onewire
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:25 org.openhab.binding.onewiregpio
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:31 org.openhab.binding.openweathermap
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:31 org.openhab.binding.publictransportswitzerland
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:40 org.openhab.binding.pulseaudio
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:02 org.openhab.binding.smartmeter
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:31 org.openhab.binding.snmp
drwxr-xr-x  3 openhab openhab 4096 Aug 28 11:11 org.openhab.binding.telegram
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:03 org.openhab.binding.unifi
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:26 org.openhab.binding.upnpcontrol
drwxr-xr-x  3 openhab openhab 4096 Aug 16 16:32 org.openhab.binding.yamahareceiver
drwxr-xr-x  3 openhab openhab 4096 Aug 18 10:47 org.openhab.io.metrics
drwxr-xr-x  3 openhab openhab 4096 Aug 23 08:50 org.openhab.io.openhabcloud
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:43 org.openhab.persistence.influxdb
drwxr-xr-x  3 openhab openhab 4096 Aug 18 10:51 org.openhab.transform.jsonpath
drwxr-xr-x  3 openhab openhab 4096 Aug 18 10:52 org.openhab.transform.regex
drwxr-xr-x  3 openhab openhab 4096 Aug 28 11:19 org.openhab.voice.marytts
drwxr-xr-x  3 openhab openhab 4096 Aug 23 09:59 org.openhab.voice.picotts
drwxr-xr-x  3 openhab openhab 4096 Aug 23 09:59 org.openhab.voice.voicerss
drwxr-xr-x  3 openhab openhab 4096 Aug 16 15:57 org.openhab.voice.voskstt
root@dockerpi01:~/openhab# docker exec -it openhab_openhab_1 ls -la /openhab/userdata/tmp/mvn/org/openhab/addons/bundles/org.openhab.binding.dsmr
total 12
drwxr-xr-x  3 openhab openhab 4096 Aug 16 17:41 .
drwxr-xr-x 36 openhab openhab 4096 Aug 28 11:19 ..
drwxr-xr-x  2 openhab openhab 4096 Aug 16 17:41 4.0.2
root@dockerpi01:~/openhab# docker exec -it openhab_openhab_1 ls -la /openhab/userdata/tmp/mvn/org/openhab/addons/bundles/org.openhab.binding.dsmr/4.0.2
total 164
drwxr-xr-x 2 openhab openhab   4096 Aug 16 17:41 .
drwxr-xr-x 3 openhab openhab   4096 Aug 16 17:41 ..
-rw-r--r-- 1 openhab openhab 151694 Aug 16 17:41 org.openhab.binding.dsmr-4.0.2.jar
-rw-r--r-- 1 openhab openhab     40 Aug 16 17:41 org.openhab.binding.dsmr-4.0.2.jar.sha1

i picked out one binding: dsmr

filesystem in container shows the files, but gui tells its not installed.

docker exec -it openhab_openhab_1 sha1sum /openhab/userdata/tmp/mvn/org/openhab/addons/bundles/org.openhab.binding.dsmr/4.0.2/org.openhab.binding.dsmr-4.0.2.jar
85782d812851850e21d580e4a4d4fcabd331e7fa

and the sum in the sha1 file shows 85782d812851850e21d580e4a4d4fcabd331e7fa so it seems the correct file

The files merely being present is not sufficient to indicate whether the add-on is installed. To see what add-ons and other bundles are installed and active use the karaf console. The Console | openHAB

bundle:list|grep -i dsmr

empty result. So could it be that we are not speaking about a problem of filesystem, maybe something in the registry where the bundles are registered?

I don’t know how that parts work. All I can recommend is removing and readding the missing add-on to see what changes.