mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Update Docker Image mysql 8.0.37

Open guioliveiradevops opened this issue 1 year ago • 7 comments

We use MySQL with Docker compose natively, and this morning all our environments that used the 8.0.37 image started to have problems.

Initially we thought our data was corrupt, as the error was this:

2024-05-10T10:53:12.117548210Z 2024-05-10T10:53:12.115741Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.37) starting as process 1
2024-05-10T10:53:12.119773190Z 2024-05-10T10:53:12.119706Z 0 [Warning] [MY-010001] [Server] Can't create thread to handle bootstrap (errno: 1)
2024-05-10T10:53:12.119780200Z 2024-05-10T10:53:12.119738Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-05-10T10:53:12.119783150Z 2024-05-10T10:53:12.119744Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-10T10:53:12.120094961Z 2024-05-10T10:53:12.120041Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.37)  MySQL Community Server - GPL.

And also when starting a new MySQL without any data, the following error appears:

2024-05-10T10:55:10.763707498Z 2024-05-10T10:55:10.761923Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.37) initializing of server in progress as process 80
2024-05-10T10:55:10.763710838Z 2024-05-10T10:55:10.763561Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2024-05-10T10:55:10.763713338Z 2024-05-10T10:55:10.763567Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2024-05-10T10:55:10.764046169Z 2024-05-10T10:55:10.763621Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-10T10:55:10.764059339Z 2024-05-10T10:55:10.763764Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.37)  MySQL Community Server - GPL.

Apparently, all because of this update: image

This created a very serious problem for us, as we thought the data was corrupt.

If this helps anyone with the same problem, we had to update to 8.1 and we were successful.

guioliveiradevops avatar May 10 '24 10:05 guioliveiradevops

Sounds similar to #1056 and thus might be #1055

tianon avatar May 10 '24 17:05 tianon

2024-05-10T10:53:12.119773190Z 2024-05-10T10:53:12.119706Z 0 [Warning] [MY-010001] [Server] Can't create thread to handle bootstrap (errno: 1)

That sounds like libseccomp; try with --security-opt seccomp=unconfined. If it works, then Docker, runc, and libseccomp need to be updated on the host.

https://github.com/docker-library/python/issues/837#issuecomment-1599640563

yosifkit avatar May 10 '24 17:05 yosifkit

We use MySQL with Docker compose natively, and this morning all our environments that used the 8.0.37 image started to have problems. ... This created a very serious problem for us, as we thought the data was corrupt.

If this helps anyone with the same problem, we had to update to 8.1 and we were successful.

Thanks for sharing! I have the same issue with mysql:8.0.36-debian image as well. Update to mysql:8.0.37-debian did not help. If you say that 8.1 solved your issue, I would be very happy to test it, but I need mysql:8.1-debian which unfortunately is missing at this moment. Is there any chance to have it available soon?

anatol06 avatar May 10 '24 19:05 anatol06

8.1 was the first "innovation" release and is no longer updated (it was superseded by 8.2 and then 8.3 and now 8.4). After 8.0 we stopped publishing Debian based images and only publish Oracle Linux based images since it is more supported by MySQL upstream releases.

Edit: 8.0 is still an active release and the images will continue to be built (on Debian and Oracle Linux) until its end of life.

yosifkit avatar May 10 '24 20:05 yosifkit

I have the same issue ,when i upgrade my docker from 19.03.9 to 26.1.4,it had been solved.

zzhaaa123 avatar Aug 05 '24 09:08 zzhaaa123

--security-opt seccomp=unconfined

try what with seccomp? docker compose does not have that flag

KansaiTraining avatar Sep 13 '24 07:09 KansaiTraining

I resolved all issues by switching to the Bitnami MySQL container images across all my servers.

anatol06 avatar Sep 13 '24 08:09 anatol06

--security-opt seccomp=unconfined

try what with seccomp? docker compose does not have that flag

https://docs.docker.com/reference/compose-file/services/#security_opt

tianon avatar Sep 13 '24 17:09 tianon

worked after adding --security-opt seccomp=unconfined as per below

version: "3"

services:
  # ... other services

  mysql:
    image: mysql:8.0-debian
    container_name: mysql
    cap_add:
      - SYS_NICE
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=GreaterPassword1245
      - MYSQL_USER=dynamike
      - MYSQL_PASSWORD=GreaterPassword1245
    volumes:
      - mysql:/var/lib/mysql:Z
    networks:
      - network
    # --- ADD SECURITY OPTION HERE ---
    security_opt:
      - seccomp=unconfined
    # --- END ADDITION ---

  # ... other services ...

volumes:
  mysql:

networks:
  network:

busyboy77 avatar Apr 23 '25 11:04 busyboy77