SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.45k stars 308 forks source link

menue thinks docker 20.10 is less than 18.2.0 #496

Closed Magke closed 2 years ago

Magke commented 2 years ago

grafik

Paraphraser commented 2 years ago

I don't really understand why this happens but I do know how to cure it.

If we go back in time to gcgarner/IOTstack:

Thereafter, both docker and docker-compose were updated by apt.

That approach was inherited by SensorsIot/IOTstack.

The problem was that the docker-compose installed by apt was never actually updated during the evolution of Buster and became increasingly out-of-date. The workaround was to delete the apt version and use pip3 instead:

$ sudo apt -y remove docker-compose
$ sudo pip3 install -U docker-compose

Next came "modern" docker-compose which is installed by downloading a platform- and version-specific compiled binary from docker/compose/releases and copying it to the right places.

Depending on when you started with IOTstack and how long it has been since you last rebuilt your Raspberry Pi, you can have various versions and combinations of docker and docker-compose installed on your Pi.

The trigger conditions for getting a version number like "20.10.5+dfsg1" seem to be:

  1. Having a version of docker-compose installed by apt.
  2. That version of docker-compose recently being updated by apt, possibly as a side-effect of upgrading to Bullseye, or possibly the result of something that happened behind the scenes related to Bullseye that affected Buster.

How or why apt updating docker-compose affects the version number of docker is not clear. However, the menu does not expect version numbers with a "+" in the middle so the parsing algorithm gets it wrong and decides the installed version needs to be upgraded - which it can't be.

The solution is to get rid of both docker and docker compose, and then re-install them properly.

There is a wrinkle, though. If you're also running Supervised Home Assistant (also known as Home Assistant Core and hass.io) then removing docker causes Home Assistant to stop working. The way Supervised Home Assistant gets installed has also gone through a few changes and the IOTstack menu methods no longer work. In the case of "old menu", the HA script has disappeared. In the case of "new menu", an intermediate script (nothing to do with IOTstack) is broken and the author seems to have given up. There are some pull requests pending to remove Home Assistant from the IOTstack menu.

To be clear, this does not affect the standalone Home Assistant container. That still works just fine.

If you read the material here it explains how to uninstall Supervised Home Assistant (if you are running it), docker and docker-compose, and then re-install the components correctly.

To be clear, Supervised Home Assistant can be installed alongside IOTstack but the IOTstack menu can't do it any more.

Anyway, if you follow those instructions, everything will be reinstalled correctly, the menu will be happy and won't complain about "20.10.5+dfsg1", and the problem will just go away.

I hope this helps.