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

Ubuntu/mysql-server-8.0 builds fail - "Error: Unable to shut down server" due to zombie process #3224

Open
heapdavid opened this issue Jun 25, 2024 · 0 comments
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) differs-from-docker kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next. works-with-docker

Comments

@heapdavid
Copy link

Actual behavior
Hi, when using docker build the below Dockerfile builds and installs mysql-server-8.0 correctly. When using Kaniko it hangs and eventually errors out when trying to establish if the mysqld process has exited during post installation configuration

FROM docker.io/library/ubuntu:24.04

RUN apt update -y \
    && DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y mysql-server-8.0
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 631
Error: Unable to shut down server with process id 631
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1

Looks like the postinst script starts and then kills the mysqld process, and needs to detect its absence before continuing:

https://git.launchpad.net/ubuntu/+source/mysql-8.0/tree/debian/mysql-server-8.0.postinst#n46

mysqld becomes a zombie rather than exiting fully so the script fails

ps in the kaniko container before exit:

  631 mysql     0:00 mysqld --user=mysql --daemonize --socket=/tmp/tmp.sMzJEwPE5f/mysqld.sock --pid-file=/tmp/tmp.sMzJEwPE5f/mysqld.pid --skip-networking

ps in the kaniko container after exit:

  631 mysql     0:00 [mysqld]

ps on the host after exit:

     101  300396  0.2  0.0      0     0 ?        Z    13:56   0:00 [mysqld] <defunct>

Expected behavior
The mysqld process to exit cleanly as it does in docker (and podman) build

To Reproduce
Steps to reproduce the behavior:

  1. Use the Dockerfile provided to build a container

Additional Information

  • Dockerfile - see above - same error seen in all current ubuntu container versions from 20.04 onward
  • Build Context
    Running the debug container with: /kaniko/executor --ignore-var-run=false --no-push
  • Kaniko Image (fully qualified with digest):
    latest - sha256:c090be9d4042f64a1f44af5abfec6e778dc8f61bd301c54001485205fd1324e0

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added differs-from-docker works-with-docker area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next. labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) differs-from-docker kind/bug Something isn't working priority/p1 Basic need feature compatibility with docker build. we should be working on this next. works-with-docker
Projects
None yet
Development

No branches or pull requests

2 participants