mailcow / mailcow-dockerized

mailcow: dockerized - šŸ® + šŸ‹ = šŸ’•
https://mailcow.email
GNU General Public License v3.0
8.75k stars 1.17k forks source link

php-fpm-mailcow-1 | Waiting for SQL... AND php-fpm-mailcow-1 | Could not get mysql-mailcow container id... trying again. #5941

Closed Kamero4K closed 2 months ago

Kamero4K commented 3 months ago

Contribution guidelines

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

Description

Hello,
i tried to install mailcow on a fresh new system.
New Docker and everthing is working. 
Then i followed your mailcow installation guide and everything went trough smoothly.
But when i started (docker compose up -d) and tried to reach the gui i got : 
"What is happening?
Please do not stop the stack while we are initializing the database or do other preparations"
I waited but nothing changed so i went into the logs with " docker compose logs --tail=200 php-fpm-mailcow nginx-mailcow "
and saw ::
php-fpm-mailcow-1  | Waiting for SQL...
.
I tried reinstalling multiple times and also got ::

php-fpm-mailcow-1  | Could not get mysql-mailcow container id... trying again.

Logs:

Mysql container :
2024-07-07 19:22:01-02:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.25+maria~ubu2004 started.
2024-07-07 19:22:02-02:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-07-07 19:22:02-02:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.25+maria~ubu2004 started.
2024-07-07 19:22:02-02:00 [Note] [Entrypoint]: MariaDB upgrade not required
2024-07-07 19:22:02 0 [Note] Starting MariaDB 10.5.25-MariaDB-ubu2004 source revision 29c185bd771ac441121468b3850d6dc8d13b8a1f as process 1
2024-07-07 19:22:02 0 [Note] InnoDB: Uses event mutexes
2024-07-07 19:22:02 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-07-07 19:22:02 0 [Note] InnoDB: Number of pools: 1
2024-07-07 19:22:02 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-07-07 19:22:02 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2024-07-07 19:22:02 0 [Note] InnoDB: Using Linux native AIO
2024-07-07 19:22:02 0 [Note] InnoDB: Initializing buffer pool, total size = 25165824, chunk size = 25165824
2024-07-07 19:22:02 0 [Note] InnoDB: Completed initialization of buffer pool
2024-07-07 19:22:02 0 [Note] InnoDB: 128 rollback segments are active.
2024-07-07 19:22:02 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-07-07 19:22:02 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-07-07 19:22:02 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-07-07 19:22:02 0 [Note] InnoDB: 10.5.25 started; log sequence number 45187; transaction id 20
2024-07-07 19:22:02 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-07-07 19:22:02 0 [Note] InnoDB: Buffer pool(s) load completed at 240707 19:22:02
2024-07-07 19:22:02 0 [Note] Server socket created on IP: '::'.
2024-07-07 19:22:03 1 [Note] Event Scheduler: scheduler thread started with id 1
2024-07-07 19:22:03 0 [Note] mysqld: ready for connections.
Version: '10.5.25-MariaDB-ubu2004'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
________________________________________________________________________________
php - fpm :
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: using the "epoll" event method
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: nginx/1.27.0
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: built by gcc 13.2.1 20231014 (Alpine 13.2.1_git20231014)
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: OS: Linux 6.8.0-36-generic
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker processes
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 20
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 21
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 22
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 23
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 24
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 25
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 26
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start worker process 27
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start cache manager process 28
nginx-mailcow-1    | 2024/07/07 19:22:05 [notice] 1#1: start cache loader process 29
nginx-mailcow-1    | 2024/07/07 19:23:05 [notice] 29#29: http file cache: /tmp 0.000M, bsize: 4096
nginx-mailcow-1    | 2024/07/07 19:23:05 [notice] 1#1: signal 17 (SIGCHLD) received from 29
nginx-mailcow-1    | 2024/07/07 19:23:05 [notice] 1#1: cache loader process 29 exited with code 0
nginx-mailcow-1    | 2024/07/07 19:23:05 [notice] 1#1: signal 29 (SIGIO) received
nginx-mailcow-1    | 2024/07/07 19:23:05 [error] 20#20: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.56, ser                                                                                                                                                                ver: dockervm.fritz.box, request: "GET / HTTP/1.1", upstream: "fastcgi://172.22.1.7:9002", host: "192.168.0.84"
nginx-mailcow-1    | 2024/07/07 19:23:05 [error] 20#20: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.0.56, ser                                                                                                                                                                ver: dockervm.fritz.box, request: "GET / HTTP/1.1", upstream: "fastcgi://[fd4d:6169:6c63:6f77::a]:9002", host: "192.168.0.84"
nginx-mailcow-1    | 192.168.0.56 - - [07/Jul/2024:19:23:05 -0200] "GET / HTTP/1.1" 502 2015 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.3                                                                                                                                                                6 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
root@mail:/opt/mailcow-dockerized# ^C
root@mail:/opt/mailcow-dockerized# docker compose logs --tail=200 -f php-fpm-mailcow nginx-mailcow
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...
php-fpm-mailcow-1  | Waiting for SQL...

Steps to reproduce:

1. Make a new VM 
2. install docker
3. docker ps reporting correctly
4. follow installationsteps for mailcow
5. start up the service for the first time

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Ubuntu 22.04

Server/VM specifications:

12gb

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

TrueNas VM

Docker version:

27.0.3

docker-compose version or docker compose version:

v2.28.1

mailcow version:

2024-06a

Reverse proxy:

None

Logs of git diff:

-/-

Logs of iptables -L -vn:

root@mail:/opt/mailcow-dockerized# iptables -L -vn
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1328  108K MAILCOW    0    --  *      *       0.0.0.0/0            0.0.0.0/0            /* mailcow */
 567K   37M DOCKER-USER  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 567K   37M DOCKER-ISOLATION-STAGE-1  0    --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  *      docker0  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 DOCKER     0    --  *      docker0  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  docker0 docker0  0.0.0.0/0            0.0.0.0/0
 494K   32M ACCEPT     0    --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
72795 4842K DOCKER     0    --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0
  465 43555 ACCEPT     0    --  br-mailcow !br-mailcow  0.0.0.0/0            0.0.0.0/0
72791 4841K ACCEPT     0    --  br-mailcow br-mailcow  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.249         tcp dpt:6379
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.5           tcp dpt:8983
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.6           tcp dpt:3306
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:110
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:143
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:993
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:995
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:4190
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.250         tcp dpt:12345
    4   208 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.8           tcp dpt:80
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.8           tcp dpt:443
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:25
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:465
    0     0 ACCEPT     6    --  !br-mailcow br-mailcow  0.0.0.0/0            172.22.1.253         tcp dpt:587

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER-ISOLATION-STAGE-2  0    --  docker0 !docker0  0.0.0.0/0            0.0.0.0/0
  465 43555 DOCKER-ISOLATION-STAGE-2  0    --  br-mailcow !br-mailcow  0.0.0.0/0            0.0.0.0/0
 567K   37M RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       0    --  *      docker0  0.0.0.0/0            0.0.0.0/0
    0     0 DROP       0    --  *      br-mailcow  0.0.0.0/0            0.0.0.0/0
  465 43555 RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain DOCKER-USER (1 references)
 pkts bytes target     prot opt in     out     source               destination
 567K   37M RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Chain MAILCOW (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       6    --  !br-mailcow br-mailcow  0.0.0.0/0            0.0.0.0/0            /* mailcow isolation */

Logs of ip6tables -L -vn:

-/-

Logs of iptables -L -vn -t nat:

root@mail:/opt/mailcow-dockerized# iptables -L -vn -t nat
Chain PREROUTING (policy ACCEPT 73096 packets, 4867K bytes)
 pkts bytes target     prot opt in     out     source               destination
   25  1460 DOCKER     0    --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 910 packets, 62061 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DOCKER     0    --  *      *       0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL

Chain POSTROUTING (policy ACCEPT 73624 packets, 4899K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 MASQUERADE  0    --  *      !docker0  172.17.0.0/16        0.0.0.0/0
  243 19151 MASQUERADE  0    --  *      !br-mailcow  172.22.1.0/24        0.0.0.0/0
    0     0 MASQUERADE  6    --  *      *       172.22.1.249         172.22.1.249         tcp dpt:6379
    0     0 MASQUERADE  6    --  *      *       172.22.1.5           172.22.1.5           tcp dpt:8983
    0     0 MASQUERADE  6    --  *      *       172.22.1.6           172.22.1.6           tcp dpt:3306
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:110
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:143
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:993
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:995
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:4190
    0     0 MASQUERADE  6    --  *      *       172.22.1.250         172.22.1.250         tcp dpt:12345
    0     0 MASQUERADE  6    --  *      *       172.22.1.8           172.22.1.8           tcp dpt:80
    0     0 MASQUERADE  6    --  *      *       172.22.1.8           172.22.1.8           tcp dpt:443
    0     0 MASQUERADE  6    --  *      *       172.22.1.253         172.22.1.253         tcp dpt:25
    0     0 MASQUERADE  6    --  *      *       172.22.1.253         172.22.1.253         tcp dpt:465
    0     0 MASQUERADE  6    --  *      *       172.22.1.253         172.22.1.253         tcp dpt:587

Chain DOCKER (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     0    --  docker0 *       0.0.0.0/0            0.0.0.0/0
    0     0 RETURN     0    --  br-mailcow *       0.0.0.0/0            0.0.0.0/0
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:7654 to:172.22.1.249:6379
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:18983 to:172.22.1.5:8983
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:13306 to:172.22.1.6:3306
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:110 to:172.22.1.250:110
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:143 to:172.22.1.250:143
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:993 to:172.22.1.250:993
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:995 to:172.22.1.250:995
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:4190 to:172.22.1.250:4190
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            127.0.0.1            tcp dpt:19991 to:172.22.1.250:12345
    4   208 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80 to:172.22.1.8:80
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443 to:172.22.1.8:443
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:25 to:172.22.1.253:25
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:465 to:172.22.1.253:465
    0     0 DNAT       6    --  !br-mailcow *       0.0.0.0/0            0.0.0.0/0            tcp dpt:587 to:172.22.1.253:587

Logs of ip6tables -L -vn -t nat:

-/-

DNS check:

-/-
Kamero4K commented 3 months ago

PS : When i first started the Containers i got : php-fpm-mailcow-1 | Waiting for SQL... AFTER i stopped and started again i got : php-fpm-mailcow-1 | Could not get mysql-mailcow container id... trying again

DerLinkman commented 2 months ago

Yeah i recently added this message "Could not get mysql-mailcow container id... trying again" due to the DNS lookup issue but did not looked any deeper yet. And cannot, no time right now...

Have you set anything inside your resolv.conf?

Kamero4K commented 2 months ago

Yeah i recently added this message "Could not get mysql-mailcow container id... trying again" due to the DNS lookup issue but did not looked any deeper yet. And cannot, no time right now...

Have you set anything inside your resolv.conf?

nameserver 127.0.0.53 options edns0 trust-ad search fritz.box

Nothing special.. just this. But.. could it be because i have docker API open and having SSL requirement on it? Because i installed docker on my local linux pc without any API / SSL adjustment and mailcow spun up immediately

DerLinkman commented 2 months ago

Do you have ipv6 activated on your machine? Does it have a ipv6?

If not: Did you followed this guide: https://docs.mailcow.email/post_installation/firststeps-disable_ipv6 ?

Kamero4K commented 2 months ago

Do you have ipv6 activated on your machine? Does it have a ipv6?

If not: Did you followed this guide: https://docs.mailcow.email/post_installation/firststeps-disable_ipv6 ?

Im actually not sure.. i didn't do any steps to configure ipv6.. But i know for sure that i have a working static ipv4

DerLinkman commented 2 months ago

Closing this as Duplicate of https://github.com/mailcow/mailcow-dockerized/issues/5928