Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP-FPM v.1.92 fails on exec format error /docker-entrypoint.sh #6325

Open
5 tasks done
AndersStigsson opened this issue Feb 23, 2025 · 3 comments
Open
5 tasks done
Labels

Comments

@AndersStigsson
Copy link

AndersStigsson commented Feb 23, 2025

Contribution guidelines

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

  • ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
  • ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
  • ... I have understood that answers are voluntary and community-driven, and not commercial support.
  • ... I have verified that my issue has not been already answered in the past. I also checked previous issues.

Description

After updating to latest release (through update.sh), I couldn't access my mailcow anymore. 

Checking the logs, everything was waiting for php-fpm and php-fpm was failing with:
exec /docker-entrypoint.sh: exec format error.

Logs:

php-fpm-mailcow-1  | exec /docker-entrypoint.sh: exec format error
php-fpm-mailcow-1  | exec /docker-entrypoint.sh: exec format error
php-fpm-mailcow-1  | exec /docker-entrypoint.sh: exec format error

Steps to reproduce:

1. For me it happens as soon as I switch to v1.92 of php-fpm-mailcow.

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

Debian 12

Server/VM specifications:

8GB Memory, 2 Cores

Is Apparmor, SELinux or similar active?

no

Virtualization technology:

KVM (Proxmox)

Docker version:

27.5.1

docker-compose version or docker compose version:

v2.32.4

mailcow version:

2025-01a

Reverse proxy:

Traefik

Logs of git diff:

diff --git a/data/conf/dovecot/dovecot.conf b/data/conf/dovecot/dovecot.conf
index c230c3495..3a76a5212 100644
--- a/data/conf/dovecot/dovecot.conf
+++ b/data/conf/dovecot/dovecot.conf
@@ -165,7 +165,7 @@ service lmtp {
   }
   user = vmail
 }
-listen = *,[::]
+listen = *
 ssl_cert = </etc/ssl/mail/cert.pem
 ssl_key = </etc/ssl/mail/key.pem
 userdb {
diff --git a/data/conf/phpfpm/php-fpm.d/pools.conf b/data/conf/phpfpm/php-fpm.d/pools.conf
index 605e686c1..d6df12438 100644
--- a/data/conf/phpfpm/php-fpm.d/pools.conf
+++ b/data/conf/phpfpm/php-fpm.d/pools.conf
@@ -6,7 +6,7 @@ pm.max_children = 15
 pm.start_servers = 2
 pm.min_spare_servers = 2
 pm.max_spare_servers = 4
-listen = [::]:9001
+listen = 9001
 access.log = /proc/self/fd/2
 clear_env = no
 catch_workers_output = yes
@@ -21,7 +21,7 @@ pm.max_children = 50
 pm.start_servers = 10
 pm.min_spare_servers = 10
 pm.max_spare_servers = 15
-listen = [::]:9002
+listen = 9002
 access.log = /proc/self/fd/2
 clear_env = no
 catch_workers_output = yes
diff --git a/data/conf/postfix/main.cf b/data/conf/postfix/main.cf
index 6721204cb..752297b57 100644
--- a/data/conf/postfix/main.cf
+++ b/data/conf/postfix/main.cf
@@ -175,3 +175,36 @@ lmtp_destination_recipient_limit=1

 # DO NOT EDIT ANYTHING BELOW #
 # Overrides #
+
+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
+  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
+
+# User Overrides
+myhostname = mx.mydomain.com
+smtp_address_preference = ipv4
+inet_protocols = ipv4
diff --git a/data/conf/unbound/unbound.conf b/data/conf/unbound/unbound.conf
index 27110c049..90c16ee0f 100644
--- a/data/conf/unbound/unbound.conf
+++ b/data/conf/unbound/unbound.conf
@@ -4,7 +4,7 @@ server:
   interface: ::0
   logfile: /dev/console
   do-ip4: yes
-  do-ip6: yes
+  do-ip6: no
   do-udp: yes
   do-tcp: yes
   do-daemonize: no
diff --git a/docker-compose.yml b/docker-compose.yml
index 421610bac..b5e0c8cbd 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -635,12 +635,12 @@ networks:
     driver: bridge
     driver_opts:
       com.docker.network.bridge.name: br-mailcow
-    enable_ipv6: true
+    enable_ipv6: false
     ipam:
       driver: default
       config:
         - subnet: ${IPV4_NETWORK:-172.22.1}.0/24
-        - subnet: ${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64}
+          #- subnet: ${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64}

 volumes:
   vmail-vol-1:



docker-compose.override.yml

  ipv6nat-mailcow:
      image: bash:latest
      restart: "no"
      entrypoint: ["echo", "ipv6nat disabled in compose.override.yml"]

Logs of iptables -L -vn:

Not network related

Logs of ip6tables -L -vn:

Not network related

Logs of iptables -L -vn -t nat:

Not network related

Logs of ip6tables -L -vn -t nat:

Not network related

DNS check:

172.64.155.249
104.18.32.7
@DerLinkman
Copy link
Member

Hm exec format error usually means the internal container is trying to do something which is not compatible with that architecture. As you wrote you use x86.

Normally docker is downloading the correct image. Can you do a docker image inspect mailcow/phpfpm:1.92 and validate it is saying "Architecture": "amd64" inside the output?

@AndersStigsson
Copy link
Author

Hm exec format error usually means the internal container is trying to do something which is not compatible with that architecture. As you wrote you use x86.

Normally docker is downloading the correct image. Can you do a docker image inspect mailcow/phpfpm:1.92 and validate it is saying "Architecture": "amd64" inside the output?

It does say "Architecture": "amd64". Here's the entire output of it in case it could help:

"Docker image inspect" output

[
    {
        "Id": "sha256:145e65df75198683a5cc98633f23acbc93f4ba505c13c55afeec2d706194c072",
        "RepoTags": [
            "mailcow/phpfpm:1.92"
        ],
        "RepoDigests": [
            "mailcow/phpfpm@sha256:47c0fd3ba4136d887c61271243f9606a3c23d0d1e090ae8d322289dd59585867"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-12-09T11:35:24.962427665Z",
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "9000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PHPIZE_DEPS=autoconf \t\tdpkg-dev dpkg \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkgconf \t\tre2c",
                "PHP_INI_DIR=/usr/local/etc/php",
                "PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64",
                "PHP_LDFLAGS=-Wl,-O1 -pie",
                "GPG_KEYS=39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC",
                "PHP_VERSION=8.2.26",
                "PHP_URL=https://www.php.net/distributions/php-8.2.26.tar.xz",
                "PHP_ASC_URL=https://www.php.net/distributions/php-8.2.26.tar.xz.asc",
                "PHP_SHA256=54747400cb4874288ad41a785e6147e2ff546cceeeb55c23c00c771ac125c6ef"
            ],
            "Cmd": [
                "php-fpm"
            ],
            "ArgsEscaped": true,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/var/www/html",
            "Entrypoint": [
                "/docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "maintainer": "= The Infrastructure Company GmbH <[email protected]>"
            },
            "StopSignal": "SIGQUIT"
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 306814308,
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/bc70cd53304fa95a4b1068d88ea54fdaac2e22601a3dbe76ca88d044916373ce/diff:/var/lib/docker/overlay2/c136cdfa016ee8a1513fcb4472438a84b979cf99b7acf64d74d2e1896dde4fcc/diff:/var/lib/docker/overlay2/53b19e7ad848c631f1ab645b6191282cd6845669c6def4f2f8addda360489c71/diff:/var/lib/docker/overlay2/974cb462744778ca8fd7b305e13c55070518fb04e03b8c2688197bd9ae4f6a4f/diff:/var/lib/docker/overlay2/806344d128c93d873e7658209705b52db61aa08600354922e2f2715a3b07f0c9/diff:/var/lib/docker/overlay2/c3054fcc82051708a16b8ec477432980cd1fdf586b822a7c477aff901beb0c27/diff:/var/lib/docker/overlay2/983ef141a80b96f0e99f0384f42e18b4ad1da04274210049110372224ca297cf/diff:/var/lib/docker/overlay2/7b6dfcf130ade098e9a7bda7392b9d251f4e7fa5435998c46b925c192f2c1079/diff:/var/lib/docker/overlay2/d44795fb7a0de5f18d46ac7b8360c7c78ccd1843f613a868ae127cc83c689455/diff:/var/lib/docker/overlay2/eca7abb36921a108acac44d2b0ecc64186d20f53c97409b930608ab278cc9538/diff:/var/lib/docker/overlay2/d22d2238a2b07acbbc67f9423a3e3f927c94b53a2a7c091ffced74c8ab250e7a/diff:/var/lib/docker/overlay2/9f8cc2a14ecd194a8ff05b31bfe8473f936f41acce387a202a235199138e8061/diff",
                "MergedDir": "/var/lib/docker/overlay2/1b23b5aece43fa3edf350d9c97c4130b350c5d2e44aed71c4b305a7bc48d5941/merged",
                "UpperDir": "/var/lib/docker/overlay2/1b23b5aece43fa3edf350d9c97c4130b350c5d2e44aed71c4b305a7bc48d5941/diff",
                "WorkDir": "/var/lib/docker/overlay2/1b23b5aece43fa3edf350d9c97c4130b350c5d2e44aed71c4b305a7bc48d5941/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:75654b8eeebd3beae97271a102f57cdeb794cc91e442648544963a7e951e9558",
                "sha256:87a245429bbbe69b934c2f5cf86975c35edbb68e7b7149c70279826c103f2de4",
                "sha256:4990699c2e214b09b949c8986787974907e1b0a4ac804666e1bf61b88e996e67",
                "sha256:e3a2b0791076e23139e439812d7e963c8bb41996a21eaf66ea91434acc869c37",
                "sha256:b7446d448c79b74698fd59c196da1ccbcfac3acc9e64dcbbba038702a152ac53",
                "sha256:c8eee6c2906f7ba16300e413ae8314ab4400e0a706215c38c3af01e01c9b71e2",
                "sha256:a741793b1afabcb3524eaae9491dcd9255295dde5db5d20c4169a62543db582e",
                "sha256:de35f51613a8eacd24b4dc22cb5e7580f9f3ff67f646ff788b3c841cb8e6d61b",
                "sha256:edfd9acd6bac123e9aba3f12288ac3094d3b4ed6ec0b557221d2229030c9075f",
                "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
                "sha256:04c6b62303043142c6b6a6cf8c77a397ea28ebfaf04ce82fbb9089869d1bc5e8",
                "sha256:74a48c0eb90b3e4e5c3882da301809633baea436d1a6b899b5156df22450f9a2",
                "sha256:4fd26f9ed1de3b4f94ab070532db34727b1ca6aefdd2e7ae3bba545f063c9fa3"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

@AndersStigsson
Copy link
Author

AndersStigsson commented Feb 25, 2025

The issue does not seem to relate to the actual docker-entrypoint.sh. Apologies that I haven't tested this before, but I just copied the newest docker-entrypoint.sh into my php-fpm v1.91 and restarted the container and it still works as expected.

This does however not solve the initial problem that I'm currently stuck at running v1.91, but at least I can now access the mailcow UI which was impossible when running v1.91 with the old entrypoint-file and everything else up to date with the latest.

Added the following at the top to make sure that it was the new file running.

echo "NEW FILE"
php-fpm-mailcow-1  | NEW FILE
php-fpm-mailcow-1  | Uptime: 166401  Threads: 11  Questions: 228581  Slow queries: 0  Opens: 73  Open tables: 64  Queries per second avg: 1.373
php-fpm-mailcow-1  | Could not get mysql-mailcow container id... trying again
php-fpm-mailcow-1  | MySQL @ e0581b059787d6d5162a9ea4749db18af29c01e080e71801bee4d7e8a8dbbcc8
php-fpm-mailcow-1  | SQL upgrade iteration #1
php-fpm-mailcow-1  | MySQL is up-to-date - debug output:
php-fpm-mailcow-1  | { "type": "success", "msg": "mysql_upgrade: already upgraded", "text": "This installation of MariaDB is already upgraded to 10.5.13-MariaDB.\nThere is no need to run mysql_upgrade again for 10.5.28-MariaDB.\nYou can use --force if you still want to run mysql_upgrade\n" }
php-fpm-mailcow-1  | We are master, preparing...
php-fpm-mailcow-1  | Running DB init...
php-fpm-mailcow-1  | Fixed _sogo_static_view
php-fpm-mailcow-1  | Cleaned up memcached
php-fpm-mailcow-1  | Rebuilding domain map in Redis...
php-fpm-mailcow-1  | find: /web/templates/cache/*: No such file or directory
php-fpm-mailcow-1  | [25-Feb-2025 17:57:03] NOTICE: fpm is running, pid 1
php-fpm-mailcow-1  | [25-Feb-2025 17:57:03] NOTICE: ready to handle connections
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:34 +0100 "HEAD /forwardinghosts.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:39 +0100 "GET /forwardinghosts.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:40 +0100 "GET /index.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:40 +0100 "GET /resource.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:40 +0100 "GET /resource.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:57:41 +0100 "GET /json_api.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:58:17 +0100 "HEAD /forwardinghosts.php" 200
php-fpm-mailcow-1  | 172.22.1.10 -  25/Feb/2025:17:58:22 +0100 "GET /forwardinghosts.php" 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants