If you ever get a ‘Failed loading environment’ in Portainer after a recent update of Portainer and/or Docker, then a short term fix is in the following comment on Github.
Quoted here:
You can fix it without downgrading Docker or Portainer. You can add the variable DOCKER_MIN_API_VERSION=1.24 to the docker service config ( this fixes the issue for Traefik aswell if you are using this, since traefik uses the version 1.24 )
systemctl edit docker.service
Add this part above the line ### Lines below this comment will be discarded: [Service]
Environment=DOCKER_MIN_API_VERSION=1.24
Save the file and exit
systemctl restart docker
Edit: We are using Version: 2.27.3 LTS Community Edition and did not encounter any issues whatsoever after doing that.
Edit 2: If you are using the Business Edition it seems that there still is an issue with you not being able to see the docker-compose.yml files for your stacks. The CE edition does not have this issue.
Thanks for the issue. Traefik is aware that they are using an ancient Docker API version not by default supported by the Daemon anymore? EDIT: Ah both independently: Portainer and Traefik
I.e. adding "min-api-version": "1.41" to /etc/docker/daemon.json.
API v1.41 is sufficient for Portainer, v1.24 needed only for Traefik.
Default minimum with latest Docker has been raised from 1.24 to 1.44, hence the issue. Latest API version is 1.52. 1.44 has been introduced with Docker 25 in early 2024. So they made it quite narrow, indeed. Any software which starts using API v1.44 hence limits itself somewhat about which Docker versions are supported. E.g. they won’t run with the Docker v20 shipped by Debian Bullseye and Bookworm repos. Luckily DietPi adds the official Docker repo.
Better official info from Docker blog:
EDIT: I opened an issue on GitHub with one-line workaround for this: