openhab / openhab-docker

Repository for building Docker containers for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
209 stars 128 forks source link

Upgrade script fails for new image #379

Closed svenb1234 closed 2 years ago

svenb1234 commented 2 years ago

Summary

(https://www.openhab.org/docs/installation/docker.html#updating-the-image) describes how to update a docker installation.

"The Docker image will automatically perform an upgrade on your mapped in userdata folder whenever it detects that your userdata version and the image's version differ. It determines the versions are different by comparing userdata/etc/version.properties. Any changes between the two files will trigger and upgrade."

This did not work for me because the upgrade script compares the wrong versions. The same issue was reported on the forums for other versions. (https://community.openhab.org/t/upgrade-docker-installation-from-3-0-2-to-3-1-0/124492)

Expected Behavior

The upgrade script should work.

Current Behavior

After starting the new image it fails after a few seconds. With the logs below.

Possible Solution

A workaround is to fake a lower openhab version by editing userdata/etc/version.properties. I set it to 3.0.9.

Steps to Reproduce

  1. Recreate the container via portainer to load the new image
  2. Restart the container

Context

Your Environment

Docker on a raspberrypi 4 running raspberry pi os buster.

Image

Docker Host

Configuration

Logs:

Fail:

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

You are already on openHAB 3.1.0 Configuring Zulu JDK 11 unlimited strength cryptography policy...

Success: You are already on openHAB 3.1.0 Configuring Zulu JDK 11 unlimited strength cryptography policy...

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

The script will attempt to update openHAB to version 3.1.0 Please read the following notes and warnings:

Important notes for version 3.1.0: Warning: Hue Binding: The type of the channels 'switch', 'brightness', 'color' and 'colortemperature' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels. Warning: Keba Binding: Introduced Units of Measurements and the channel 'pwmpilotcurrent' was replaced by 'maxpilotcurrentdutycyle'. Items must be adapted and things created through the UI must be recreated. Warning: Nest Binding: The binding now also supports the SDM API. To keep using the WWN API, add the 'wwn' prefix to Thing Types in files or recreate the WWN Nest Things using the UI with your current WWN account configuration parameters. Warning: OpenUV Binding: The type of the channels 'UVMaxTime', 'OzoneTime' and 'UVTime' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels. Warning: Xiaomi MiIo Binding: Many channels have been converted from Number to a Number with dimension, e.g. temperature channels have been changed from Number to Number:Temperature. Please see the binding documentation for details.

Important notes for version 3.2.0: Warning: Air Quality Binding: Full refactoring of things and channels. Please read the updated documentation and start with new things. Warning: DanfossAirUnit Binding: The channel 'manual_fan_speed' has been deprecated and replaced by channel 'manual_fan_step'. Items should be relinked to the new channel. Warning: EnOcean Binding: The RockerSwitch channels do not longer react if two buttons of a rocker switch are pressed simultaneously. If needed, the new channel RockerSwitchAction can be used instead. Warning: Homematic Binding: The DOUBLE_PRESSED trigger event was removed from the BUTTON channel. If needed, it can be replaced by a rule triggered by the SHORT_PRESSED event which employs a timer to check for double presses. Warning: Hunter Douglas (Luxaflex) PowerView Binding: Channel groups have been introduced for the PowerView Hub thing. Scene channels should be relinked to the new channels for channel group 'Scenes'. Warning: IpCamera Binding: The URLs that serve the files have changed to now be on port 8080 and the serverPort config is no longer needed. Update any widget and rules if you have hard coded the URLs into them. Warning: LG webOS Binding: The type of the channels 'power', 'mute', 'volume' and 'mediaPlayer' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels. Warning: Miele Binding: The temperature channels have been converted from Number to Number:Temperature. Warning: Miele Binding: The channels 'state', 'program' and 'phase' are improved with better and possibly localized texts. Rules should use the new channels 'rawState', 'rawProgram' and 'rawPhase' for reliability. Please see the binding documentation for details. Warning: RFXCOM Binding: Lighting4 default command ids are deprecated and will be removed in a future version. You must specify command ids in the thing configuration for Lighting4 devices. Warning: Sager Weathercaster Binding: The type of the channels 'pressure', 'temperature' and 'wind-angle' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels. Warning: Sony Projector Binding: The type of the channel 'power' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use this channel.

Performing pre-update tasks for version 3.2.0: Adding '.bak' to /openhab/userdata/etc/log4j2.xml Using default file /openhab/userdata/etc/log4j2.xml Replacing userdata system files with newer versions... Clearing cache...

Performing post-update tasks for version 3.2.0:

SUCCESS: openHAB updated from 3.0.9 to 3.1.0

wborn commented 2 years ago

It's a portainer bug, see the common problems.

svenb1234 commented 2 years ago

Ok, thanks for the info. I will add it to the forum so that it is easier to find.