mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.75k stars 1.17k forks source link

Update to June update not possible #4618

Closed timscha closed 2 years ago

timscha commented 2 years ago

Contribution guidelines

I've found a bug and checked that ...

Description

I tried to update to new june update. I installed docker compose 2 on the server. When running the update.sh script the following happens:

root@mx2:/opt/mailcow# ./update.sh
checking docker compose version...
Found Compose v2!
Checking internet connection... OK
Checking for newer update script...
Updated 0 paths from 81c34126
Are you sure you want to update mailcow: dockerized? All containers will be stopped. [y/N] y
Great! Native IPv6 NAT is active.
Validating docker-compose stack configuration...
1 error(s) decoding:

* error decoding 'Ports': Invalid ip address :: address ::: too many colons in address

Oh no, something went wrong. Please check the error message above.

Logs

No logs available. That's all I got.

Steps to reproduce

  1. Install docker compose 2 as mentioned on the offical documentation
  2. run the ./update.sh script

System information

Question Answer
My operating system Debian 11
Is Apparmor, SELinux or similar active? No
Virtualization technology (KVM, VMware, Xen, etc - LXC and OpenVZ are not supported KVM
Server/VM specifications (Memory, CPU Cores) 4 GB, 4 Cores
Docker version (docker version) 20.10.17
docker-compose version (docker-compose version) Docker Compose version v2.6.0
mailcow version (git describe --tags `git rev-list --tags --max-count=1`) 2022-06
Reverse proxy (custom solution) No

Output of git diff origin/master, any other changes to the code? If so, please post them:

root@mx2:/opt/mailcow# git diff origin/master
diff --git a/data/Dockerfiles/acme/Dockerfile b/data/Dockerfiles/acme/Dockerfile
index f5b7b56c..a0ec058c 100644
--- a/data/Dockerfiles/acme/Dockerfile
+++ b/data/Dockerfiles/acme/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.16
+FROM alpine:3.15

 LABEL maintainer "Andre Peters <andre.peters@servercow.de>"

diff --git a/data/Dockerfiles/clamd/Dockerfile b/data/Dockerfiles/clamd/Dockerfile
index a4971133..42d0ce97 100644
--- a/data/Dockerfiles/clamd/Dockerfile
+++ b/data/Dockerfiles/clamd/Dockerfile
@@ -1,4 +1,4 @@
-FROM clamav/clamav:0.105.0_base
+FROM clamav/clamav:0.104.2-2_base

 LABEL maintainer "André Peters <andre.peters@servercow.de>"

diff --git a/data/Dockerfiles/dockerapi/Dockerfile b/data/Dockerfiles/dockerapi/Dockerfile
index 41d4a78f..fb51f079 100644
--- a/data/Dockerfiles/dockerapi/Dockerfile
+++ b/data/Dockerfiles/dockerapi/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.16
+FROM alpine:3.15

 LABEL maintainer "Andre Peters <andre.peters@servercow.de>"

diff --git a/data/Dockerfiles/netfilter/Dockerfile b/data/Dockerfiles/netfilter/Dockerfile
index 621da149..ce8fddbc 100644
--- a/data/Dockerfiles/netfilter/Dockerfile
+++ b/data/Dockerfiles/netfilter/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.16
+FROM alpine:3.15
 LABEL maintainer "Andre Peters <andre.peters@servercow.de>"

 ENV XTABLES_LIBDIR /usr/lib/xtables
diff --git a/data/Dockerfiles/olefy/Dockerfile b/data/Dockerfiles/olefy/Dockerfile
index 889f84b4..a1a42482 100644
--- a/data/Dockerfiles/olefy/Dockerfile
+++ b/data/Dockerfiles/olefy/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.16
+FROM alpine:3.15
 LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
TokkCorp commented 2 years ago

I've got the same Problem with Ubuntu 20.04

FreddleSpl0it commented 2 years ago

have you set HTTP_BIND or HTTPS_BIND in mailcow.conf? Currently only IPv4 bindings are possible for the Admin UI. IPv6 binding must be done with a docker.override.yml

probably triggered by these lines https://github.com/mailcow/mailcow-dockerized/blob/63f718178e22ad0c89e0cacd64aadb8beda9301b/docker-compose.yml#L379-L381

TokkCorp commented 2 years ago

I have the following lines in my docker-compose.yml:

    ports:
        - "${HTTPS_BIND:-:}:${HTTPS_PORT:-443}:${HTTPS_PORT:-443}"
        - "${HTTP_BIND:-:}:${HTTP_PORT:-80}:${HTTP_PORT:-80}"
FreddleSpl0it commented 2 years ago

I have the following lines in my docker-compose.yml:

    ports:
        - "${HTTPS_BIND:-:}:${HTTPS_PORT:-443}:${HTTPS_PORT:-443}"
        - "${HTTP_BIND:-:}:${HTTP_PORT:-80}:${HTTP_PORT:-80}"

please adjust these lines to this. https://github.com/mailcow/mailcow-dockerized/blob/63f718178e22ad0c89e0cacd64aadb8beda9301b/docker-compose.yml#L379-L381

I'll have a look why your docker-compose.yml wasn't updated

timscha commented 2 years ago

@FreddleSpl0it: With you bugfix it worked. Update completed.

chatainsim commented 2 years ago

please adjust these lines to this.

https://github.com/mailcow/mailcow-dockerized/blob/63f718178e22ad0c89e0cacd64aadb8beda9301b/docker-compose.yml#L379-L381

Thank you, it worked for me too.

TokkCorp commented 2 years ago

@FreddleSpl0it Worked for me too! Thank you.
Perhaps it is worth mentioning that I chanceled the update-script to install docker-compose v2 after the warning and restarted the update afterwards.

timscha commented 2 years ago

Oh and for further debugging @FreddleSpl0it: HTTP_BIND & HTTPS_BIND are not set in my config.

mnin commented 2 years ago

Maybe there is an docker-compose.override.yml file which defines some redirects with ipv6 addresses.

https://github.com/docker/compose/issues/8721#issuecomment-932403006

docker compose v2 uses now [2a01::1]:25:25 as an valid format (before 2a01::1:25:25).

timscha commented 2 years ago

Nop, on my installations there is no docker-compose.override.yml file :)

mnin commented 2 years ago

@timscha are you have some ipv6 addresses defined in the other config files on your setup?

DerLinkman commented 2 years ago

For all who have the same issue:

  1. Uninstall Docker Compose v2 (apt remove docker-compose-plugin)
  2. Run the update.sh Script
  3. Reinstall Docker Compose v2 (apt install docker-compose-plugin)
  4. Stop the mailcow Stack with Docker Compose v1 (docker-compose down)
  5. Start the mailcow Stack with Docker Compose v2 (docker compose up -d)
timscha commented 2 years ago

@mnin I have two instances. One updated, one old one. On both IPV6_NETWORK in mailcow.conf is filled in with something that looks like a private IPv6 address.

timscha commented 2 years ago

Second instance update worked without a problem, following the steps provided by @DerLinkman. I guess, having installed both docker-compose versions causing the problem.

DerLinkman commented 2 years ago

Could be. As the update.sh Script use the newest compose he finds to run the update process. If you have a unpatched compose.yml inside your mailcow directory then this error will thrown, since this format is to old for the new compose.

jacotec commented 2 years ago

Same issue here on 3 instances. The steps from @DerLinkman did not work, I needed to manually correct the two mentioned lines to get it working.

DerLinkman commented 2 years ago

Yes alternatively do a git checkout origin/master docker-compose.yml and rerun the script again.

CrazyLinuxNerd commented 2 years ago

I did my usual and checked for bug reports before running upgrade, and found this one - anyway, after finding and reading this I found the following upgrade path worked for me:

1) Remove Docker compose v1 2) Install Docker compose v2 3) Apply changes by FreddleSpl0it 4) Run update.sh 5) Done - successful upgrade!

Anyway, thanks again to all the mailcow devs!

milkmaker commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.