RotherOSS / otobo-docker

OTOBO Docker and Docker Compose files.
GNU General Public License v3.0
32 stars 16 forks source link

zombie [mysqladmin] processes in branch rel-10_1 #89

Closed Monviech closed 2 years ago

Monviech commented 2 years ago

Issue description

ISSUE: mysqladmin zombie processes are appearing minutely that aren't reaped. The parent process is mysqld.

Steps to reproduce the issue

  1. Install VM with Ubuntu Server 20.04.3 LTS
  2. cd /opt
  3. git clone https://github.com/RotherOSS/otobo-docker.git --branch rel-10.1 --single-branch
  4. sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  5. sudo chmod +x /usr/local/bin/docker-compose
  6. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  7. sudo apt-get update
  8. sudo apt-get install docker-ce docker-ce-cli containerd.io
  9. cp /opt/otobo-docker/.docker_compose_env_http /opt/otobo-docker/.env
  10. vi .env -> Set Database password
  11. docker-compose up -d
  12. Follow the Otobo Installer.pl until the end.
  13. Log into root@localhost
  14. zombie processes are appearing from now on
  15. docker-compose restart -> all zombie processes get sigterm, but they reappear shortly

What's the expected result?

What's the actual result?

Additional details / screenshots

otobo_zombie_01 t

Monviech commented 2 years ago

Temporary Fix:

Commenting out line 38 healthcheck: 39 test: mysqladmin -p${OTOBO_DB_ROOT_PASSWORD:?err} ping -h localhost in otobo-base.yml solves the problem with zombie processes. The healthcheck of the mariadb 10.5 container doesn't work properly somehow.

bschmalhofer commented 2 years ago

Good catch. I started up the OTOBO containers on my Ubuntu devel machine and looked for those zombie processes with ps aux | grep Z . But I did not see any. Then I tried running the health check command within the running db container.

mysql@9f936ffd28b9:/$ mysqladmin -h localhost ping
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'mysql'@'localhost' (using password: NO)'
mysql@9f936ffd28b9:/$ echo $?
0
mysql@9f936ffd28b9:/$ mysqladmin -h web ping
mysqladmin: connect to server at 'web' failed
error: 'Can't connect to MySQL server on 'web' (115)'
Check that mysqld is running and that the socket: '/run/mysqld/mysqld.sock' exists!
mysql@9f936ffd28b9:/$ echo $?
1
mysql@9f936ffd28b9:/$ mysqladmin -h db ping
mysqladmin: connect to server at 'db' failed
error: 'Access denied for user 'mysql'@'172.18.0.4' (using password: NO)'
mysql@9f936ffd28b9:/$ echo $?
0
mysql@9f936ffd28b9:/$ 

This looks sensible. The exit code is 0 when the command is called with a host where MariaDB is running and 1 where not. I left out the password as this does not make sense when the user is not passed.

The zombie processes can't really be the fault of the command anyways. The processes do exit as otherwise they wouldn't be zombies. Therefore it must be Docker or Docker Compose itself, who are not properly waiting on their child processed.

Another idea is that this could be some kind of timeout issue. When I call mysqladmin -h gibtsnicht ping then the process seems to hang. Maybe docker is giving up on reaping the child processes and when they eventually die they become zombies. Could you try:

healthcheck: test: mysqladmin -h db ping

in your otobo-base.yml file ?

Monviech commented 2 years ago

Changing the healthcheck to

healthcheck: test: mysqladmin -h db ping

in the otobo-base.yml file doesnt create zombies anymore.

The health of the db container is now healthy:

1134c474098d mariadb:10.5 "docker-entrypoint.s…" 2 minutes ago Up 2 minutes (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp otobo_db_1

bschmalhofer commented 2 years ago

Cool, so it looks like this is DNS-related where in some installations localhost is known and in other instances in unknown. I will adapt the health check. This will be released in OTOBO 10.1 and in the next patch level release of OTOBO 10.0 if there is one.

bschmalhofer commented 2 years ago

Merged the PR. A quick test showed health status of the service 'db'. No zombies were seen. Clsoing this issue.