mailcow / mailcow-dockerized

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

Problem with IPv6 #1600

Closed josselinlbe closed 6 years ago

josselinlbe commented 6 years ago

Hi,

Google Cloud Platform Docker version 18.06.0-ce, build 0ffa825 Docker-compose version 1.22.0, build f46880fe

I update my repo and I have this error:

root@mx:/home/**/Mailcow# docker-compose up -d
Creating network "mailcow_mailcow-network" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
root@mx:/home/**/Mailcow# docker network create mailcow_mailcow-network
0a3a9927b57f4ac1bcb6a53679f1393bb88a63236fd1ff48799567d644c448e2
root@mx:/home/**/Mailcow# docker-compose up -d
ERROR: Network "mailcow_mailcow-network" needs to be recreated - enable_ipv6 has changed

I test this: https://docs.docker.com/config/daemon/ipv6/ + docker-compose down + docker network rm = but it didn't change anything.

And try to disabled IpV6: docker-compose.yml

networks:
  mailcow-network:
    driver: bridge
    enable_ipv6: true
    ipam:
      driver: default
      config:
        - subnet: ${IPV4_NETWORK:-172.22.1}.0/24
        - subnet: ${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64}

mailcow.conf

# Disable IPv6
# mailcow-network will still be created as IPv6 enabled, all containers will be created
# without IPv6 support.
# Use 1 for disabled, 0 for enabled
SYSCTL_IPV6_DISABLED=0

But i have many errors...

root@mx:/home/**/Mailcow# docker-compose up -d
Creating network "mailcow_mailcow-network" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
root@mx:/home/**/Mailcow# docker network create mailcow_mailcow-network
0c821ce01ba590affffb9f219b869c02c26f7816867f0b622f4e54586b8feddb
root@mx:/home/**/Mailcow# docker-compose up -d
Creating mailcow_watchdog-mailcow_1 ...
Creating mailcow_unbound-mailcow_1  ...
Creating mailcow_sogo-mailcow_1      ... error
Creating mailcow_unbound-mailcow_1   ... error
Creating mailcow_clamd-mailcow_1    ...
Creating mailcow_ipv6nat_1          ...
Creating mailcow_watchdog-mailcow_1  ... done
Creating mailcow_dovecot-mailcow_1   ...
Creating mailcow_memcached-mailcow_1 ...
Creating mailcow_postfix-mailcow_1   ... done
Creating mailcow_clamd-mailcow_1     ... done
Creating mailcow_ipv6nat_1           ... done
Creating mailcow_dockerapi-mailcow_1 ... done
Creating mailcow_dovecot-mailcow_1   ... done
Creating mailcow_memcached-mailcow_1 ... done
Creating mailcow_mysql-mailcow_1     ... done
ERROR: for mailcow_redis-mailcow_1  user specified IP address is supported only when connecting to networks with user configured subnets

ERROR: for sogo-mailcow  user specified IP address is supported only when connecting to networks with user configured subnets

ERROR: for unbound-mailcow  user specified IP address is supported only when connecting to networks with user configured subnets

ERROR: for redis-mailcow  user specified IP address is supported only when connecting to networks with user configured subnets
ERROR: Encountered errors while bringing up the project.
root@mx:/home/**/Mailcow#
mkuron commented 6 years ago

If it worked previously, there is no need to disable IPv6. It looks like you might still have containers or networks that were not taken down successfully before the upgrade. Try docker-compose down, check whether docker ps lists any leftover containers, reboot your server and then bring Mailcow back up.

andryyy commented 6 years ago

Also looks like you moved the folder and it cannot read a .env file anymore. Is .env still a symlink to mailcow.conf?

josselinlbe commented 6 years ago

Hi there, ok @mkuron. Done but I still have the same error. .env symlink is ok. If I save mailcow with the tool, it is possible to reinstall everything cleanly?

root@mx:/home/**/Mailcow# ls -l -a
total 124
drwxr-xr-x 5 root           root            4096 Jul 23 16:05 .
drwxr-xr-x 8 ** ** 4096 Jul 22 19:08 ..
-rw-r--r-- 1 root           root            3223 Jan 16  2018 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root           root             954 Jan 16  2018 CONTRIBUTING.md
drwxr-xr-x 6 root           root            4096 Jan 16  2018 data
-rw-r--r-- 1 root           root           12755 Jul 23 16:05 docker-compose.yml
-rw-r--r-- 1 root           root            2327 Jul 22 18:54 .env
-rwxr-xr-x 1 root           root            4209 Jul 22 17:55 generate_config.sh
drwxr-xr-x 8 root           root            4096 Jul 22 20:20 .git
-rw-r--r-- 1 root           root             578 Apr 12 10:24 .gitignore
drwxr-xr-x 2 root           root            4096 Jul 22 17:55 helper-scripts
-rw-r--r-- 1 root           root           35141 Jan 16  2018 LICENSE
-rw-r--r-- 1 root           root            2446 Jul 23 16:05 mailcow.conf
-rw-r--r-- 1 root           root            2537 Jul 22 17:56 mailcow.conf_backup
-rw-r--r-- 1 root           root             592 Jan 16  2018 README.md
-rw-r--r-- 1 root           root            1746 Jan 16  2018 .travis.yml
-rwxr-xr-x 1 root           root           12171 Jul 22 17:55 update.sh
root@mx:/home/**/Mailcow# cat .env
# ------------------------------
# mailcow web ui configuration
# ------------------------------
# example.org is _not_ a valid hostname, use a fqdn here.
# Default admin user is "admin"
# Default password is "moohoo"
MAILCOW_HOSTNAME=**

# ------------------------------
# SQL database configuration
# ------------------------------
DBNAME=**
DBUSER=**
....
mkuron commented 6 years ago

Something is wrong with your Docker. Please check docker network ls after doing docker-compose down. There are leftovers somewhere. A backup and restore won't help here, you would need to reinstall the entire machine. Or we can try to figure out what is stuck.

mkuron commented 6 years ago

And judging from your ls, the symlink is not ok. It's a file, not a link.

josselinlbe commented 6 years ago

Ah yes, it's ok for the symlink... :+1:

root@mx:/home/**/Mailcow# ls -a -l
total 120
drwxr-xr-x 5 root           root            4096 Jul 23 16:24 .
drwxr-xr-x 8 ** ** 4096 Jul 22 19:08 ..
-rw-r--r-- 1 root           root            3223 Jan 16  2018 CODE_OF_CONDUCT.md
-rw-r--r-- 1 root           root             954 Jan 16  2018 CONTRIBUTING.md
drwxr-xr-x 6 root           root            4096 Jan 16  2018 data
-rw-r--r-- 1 root           root           12755 Jul 23 16:05 docker-compose.yml
lrwxrwxrwx 1 root           root              12 Jul 23 16:24 .env -> mailcow.conf
-rwxr-xr-x 1 root           root            4209 Jul 22 17:55 generate_config.sh
drwxr-xr-x 8 root           root            4096 Jul 22 20:20 .git
-rw-r--r-- 1 root           root             578 Apr 12 10:24 .gitignore
drwxr-xr-x 2 root           root            4096 Jul 22 17:55 helper-scripts
-rw-r--r-- 1 root           root           35141 Jan 16  2018 LICENSE
-rw-r--r-- 1 root           root            2446 Jul 23 16:05 mailcow.conf
-rw-r--r-- 1 root           root            2537 Jul 22 17:56 mailcow.conf_backup
-rw-r--r-- 1 root           root             592 Jan 16  2018 README.md
-rw-r--r-- 1 root           root            1746 Jan 16  2018 .travis.yml
-rwxr-xr-x 1 root           root           12171 Jul 22 17:55 update.sh

root@mx:/home/**/Mailcow# docker-compose down
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
Removing network mailcowdockerized_mailcow-network

root@mx:/home/**/Mailcow# docker network create mailcowdockerized_mailcow-network
4ff15e9c7cf07aa897c26f3277a535815657edf41d714b8c2a075ca4455c9f2d

root@mx:/home/**/Mailcow# docker-compose up -d
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
ERROR: Network "mailcowdockerized_mailcow-network" needs to be recreated - enable_ipv6 has changed

Wut, I don't understand... Even with a new installation it doesn't work, is it my Docker (Compose) version ?

root@mx:/home/**/Mailcow# docker-compose down
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
Removing network mailcowdockerized_mailcow-network

root@mx:/home/**/Mailcow# docker network ls
NETWORK ID          NAME                          DRIVER              SCOPE
0be8e0b85b3b        bridge                        bridge              local
3f777dcff60d        host                          host                local
6c7c9fcdbe0d        **          bridge              local
6fe25796d1d8        **            bridge              local
efb917c032a2        **   bridge              local
e8ed930baa5f        **        bridge              local
45b969e69f63        web                           bridge              local

root@mx:/home/**/Mailcow# docker network create mailcowdockerized_mailcow-network
f8c256fc0ece8ff5de07ce19ad6fd8a2ad44d3cdb687fdaf277f9b39acde256f

root@mx:/home/**/Mailcow# docker-compose up -d
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
ERROR: Network "mailcowdockerized_mailcow-network" needs to be recreated - enable_ipv6 has changed
andryyy commented 6 years ago

Sure, your previous network (and most likely still existing network) was named "mailcow". Do you have any other containers running? If not, kill them all..

docker rm -f $(docker ps -a -q)
docker-compose down
docker network rm $(docker network ls | grep bridge | grep mailcow | awk '{print $1}')
systemctl restart docker
docker-compose up -d
mkuron commented 6 years ago

docker network create mailcowdockerized_mailcow-network

Why would you create the network manually? Delete it and have docker-compose automatically create it (with the right settings) and everything should be fine.

josselinlbe commented 6 years ago

When i try docker network prune + docker-compose up -d I have this:

root@mx:/home/**/Mailcow# docker-compose up -d
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
Creating network "mailcowdockerized_mailcow-network" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
josselinlbe commented 6 years ago

It's ok. I've stop all my containers + deleted all my networks..

root@mx:/home/**/Mailcow# docker network prune
WARNING! This will remove all networks not used by at least one container.
Are you sure you want to continue? [y/N] y
Deleted Networks:
**
**
**

root@mx:/home/**/Mailcow# docker-compose up -d
WARNING: The WATCHDOG_NOTIFY_EMAIL variable is not set. Defaulting to a blank string.
Creating network "mailcowdockerized_mailcow-network" with driver "bridge"
Creating mailcowdockerized_watchdog-mailcow_1  ... done
Creating mailcowdockerized_memcached-mailcow_1 ... done
Creating mailcowdockerized_clamd-mailcow_1     ... done
Creating mailcowdockerized_dockerapi-mailcow_1 ... done
Creating mailcowdockerized_sogo-mailcow_1      ... done
..