mailcow / mailcow-dockerized

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

Docker-compose Error:Additional property restart not allowed #5456

Closed DatDucati closed 11 months ago

DatDucati commented 11 months ago

Contribution guidelines

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

Description

docker-compose does not start up the containers after running update.sh script.
Affected Containers: 
 - clamd-mailcow
 - postfix-mailcow

I've commented the options out to get the server back up and running, to explain the diff :)

Logs:

Detecting if your IP is listed on Spamhaus Bad ASN List...
Check completed! Your IP is clean
Checking internet connection... OK
Detecting which build your mailcow runs on...
You are receiving stable updates (master).
To change that run the update.sh Script one time with the --nightly parameter to switch to nightly builds.
Checking for newer update script...
Updated 0 paths from 16097d6c
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...
services.clamd-mailcow.depends_on.unbound-mailcow Additional property restart is not allowed

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

Steps to reproduce:

1. run update.sh
2. get error

Which branch are you using?

master

Operating System:

Ubuntu 20.04

Server/VM specifications:

32G, 4 Cores with HT

Is Apparmor, SELinux or similar active?

yes

Virtualization technology:

Docker version:

Docker version 20.10.24, build 297e128

docker-compose version or docker compose version:

Docker Compose version v2.9.0

mailcow version:

2023-10-54-ge133b2dc

Reverse proxy:

-

Logs of git diff:

diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf
index 237b4263..ab68be8c 100644
--- a/data/conf/postfix/main.cf
+++ b/data/conf/postfix/main.cf
@@ -170,3 +170,41 @@ parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks

 # DO NOT EDIT ANYTHING BELOW #
 # Overrides #
+
+    # Autogenerated by mailcow
+    postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
+      hostkarma.junkemailfilter.com=127.0.0.1*-2
+      list.dnswl.org=127.0.[0..255].0*-2
+      list.dnswl.org=127.0.[0..255].1*-4
+      list.dnswl.org=127.0.[0..255].2*-6
+      list.dnswl.org=127.0.[0..255].3*-8
+      ix.dnsbl.manitu.net*2
+      bl.spamcop.net*2
+      bl.suomispam.net*2
+      hostkarma.junkemailfilter.com=127.0.0.2*3
+      hostkarma.junkemailfilter.com=127.0.0.4*2
+      hostkarma.junkemailfilter.com=127.0.1.2*1
+      backscatter.spameatingmonkey.net*2
+      bl.ipv6.spameatingmonkey.net*2
+      bl.spameatingmonkey.net*2
+      b.barracudacentral.org=127.0.0.2*7
+      bl.mailspike.net=127.0.0.2*5
+      bl.mailspike.net=127.0.0.[10;11;12]*4
+      dnsbl.sorbs.net=127.0.0.10*8
+      dnsbl.sorbs.net=127.0.0.5*6
+      dnsbl.sorbs.net=127.0.0.7*3
+      dnsbl.sorbs.net=127.0.0.8*2
+      dnsbl.sorbs.net=127.0.0.6*2
+      dnsbl.sorbs.net=127.0.0.9*2
+      zen.spamhaus.org=127.0.0.[10;11]*8
+      zen.spamhaus.org=127.0.0.[4..7]*6
+      zen.spamhaus.org=127.0.0.3*4
+      zen.spamhaus.org=127.0.0.2*3
+  zen.spamhaus.org=127.0.0.[10;11]*8
+  zen.spamhaus.org=127.0.0.[4..7]*6
+  zen.spamhaus.org=127.0.0.3*4
+  zen.spamhaus.org=127.0.0.2*3
+
+# User Overrides
+
diff --git a/docker-compose.yml b/docker-compose.yml
diff --git a/docker-compose.yml b/docker-compose.yml
diff --git a/docker-compose.yml b/docker-compose.yml
index c8cfd589..959925ba 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -63,7 +63,7 @@ services:
       depends_on:
         unbound-mailcow:
           condition: service_healthy
-          restart: true
+          #  restart: true
       dns:
         - ${IPV4_NETWORK:-172.22.1}.254
       environment:
@@ -305,7 +305,7 @@ services:
           condition: service_started
         unbound-mailcow:
           condition: service_healthy
-          restart: true
+          # restart: true
       volumes:
         - ./data/hooks/postfix:/hooks:Z
         - ./data/conf/postfix:/opt/postfix/conf:z
@@ -600,36 +600,6 @@ services:
           aliases:
             - ofelia

-    ipv6nat-mailcow:
-      depends_on:
-        - unbound-mailcow
-        - mysql-mailcow
-        - redis-mailcow
-        - clamd-mailcow
-        - rspamd-mailcow
-        - php-fpm-mailcow
-        - sogo-mailcow
-        - dovecot-mailcow
-        - postfix-mailcow
-        - memcached-mailcow
-        - nginx-mailcow
-        - acme-mailcow
-        - netfilter-mailcow
-        - watchdog-mailcow
-        - dockerapi-mailcow
-        - solr-mailcow
-      environment:
-        - TZ=${TZ}
-      image: robbertkl/ipv6nat
-      security_opt:
-        - label=disable
-      restart: always
-      privileged: true
-      network_mode: "host"
-      volumes:
-        - /var/run/docker.sock:/var/run/docker.sock:ro
-        - /lib/modules:/lib/modules:ro
-
 networks:
   mailcow-network:
     driver: bridge

Logs of iptables -L -vn:

-

Logs of ip6tables -L -vn:

-

Logs of iptables -L -vn -t nat:

-

Logs of ip6tables -L -vn -t nat:

-

DNS check:

-
DatDucati commented 11 months ago

Commit 0b62701 is the commit, where the "restart: true" got added.

DocFraggle commented 11 months ago

https://community.mailcow.email/d/2853-servicesclamd-mailcowdepends-onunbound-mailcow

I opened a discussion here

immanuelfodor commented 11 months ago

The service_healthy for Unbound was also problematic for me as I don't use it and it's always unhealthy, so it caused half the stack not start up. I needed to modify the compose file to service_started everywhere to make the stack work again.

DerLinkman commented 11 months ago

Commit 0b62701 is the commit, where the "restart: true" got added.

Could you maybe try updating your docker compose version and readd the changes?

I have no problems with that but i'm using a newer compose version then you

DerLinkman commented 11 months ago

Jup confirmed.

It's because of the old compose version.

Alright, i'll remove that restart options as they are not necessary anyways.

DerLinkman commented 11 months ago

Fixed with 2023-10a

DocFraggle commented 11 months ago

@DerLinkman as long as you don't edit the docker-compose.yml file manually you can't update, because the docker compose validation check still complains about the dependency issue:

>  ./update.sh 
Detecting if your IP is listed on Spamhaus Bad ASN List...
Check completed! Your IP is clean
Checking internet connection... OK
Detecting which build your mailcow runs on...
You are receiving stable updates (master).
To change that run the update.sh Script one time with the --nightly parameter to switch to nightly builds.
Checking for newer update script...
Updated 0 paths from a843066d
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...
services.postfix-mailcow.depends_on.unbound-mailcow Additional property restart is not allowed

Oh no, something went wrong. Please check the error message above.
DerLinkman commented 11 months ago

Yeah all who have this issue need to edit their compose.yml it's not solveable otherwise. For newly updaters it is however.

high3eam commented 11 months ago

I had both old docker-compose and docker compose installed on my system. 2023-10 complained about the restart option. I've removed the old docker-compose using package manager apt --purge remove docker-compose. Then tried again with 2023-10 and it successfully updated.

DerLinkman commented 11 months ago

To manually check out the current docker compose version use:

git fetch && git checkout docker-compose.yml origin/master