Database Fails To Start After Docker Upgrade

I'm using Docker Containers to manage a reverse proxy (jc21/nginx-proxy-manager) connected to a MariaDB database for the data.

I was having some issues with slow running containers on my NAS and foolishly decided to upgrade my containers to see if that improved things.

I'm afraid I can't tell you which versions I've moved from or 2, but this snippet from my image list may help you identify things:

REPOSITORY TAG IMAGE ID CREATED SIZE

mariadb latest 7bace6f58537 6 days ago 366MB (the new image)
mariadb <none> 51ca0cc3bcac 16 months ago 393MB (the old image)

I can't get the database to start - Here is an excerpt from my logs which repeat in a loop:

{"log":"2022-10-11 19:12:14+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+mariaubu2204 started.\n","stream":"stdout","time":"2022-10-11T19:12:14.299118Z"}
{"log":"2022-10-11 19:12:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'\n","stream":"stdout","time":"2022-10-11T19:12:18.196154Z"}
{"log":"2022-10-11 19:12:18+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.9.3+mariaubu2204 started.\n","stream":"stdout","time":"2022-10-11T19:12:18.215102Z"}
{"log":"2022-10-11 19:12:18+00:00 [Note] [Entrypoint]: MariaDB upgrade information missing, assuming required\n","stream":"stdout","time":"2022-10-11T19:12:18.632479Z"}
{"log":"2022-10-11 19:12:18+00:00 [Note] [Entrypoint]: Starting temporary server\n","stream":"stdout","time":"2022-10-11T19:12:18.635028Z"}
{"log":"2022-10-11 19:12:18+00:00 [Note] [Entrypoint]: Waiting for server startup\n","stream":"stdout","time":"2022-10-11T19:12:18.643818Z"}
{"log":"2022-10-11 19:12:18 0 [Note] mariadbd (server 10.9.3-MariaDB-1:10.9.3+mariaubu2204) starting as process 50 ...\n","stream":"stderr","time":"2022-10-11T19:12:18.690111Z"}
{"log":"2022-10-11 19:12:23 0 [Note] InnoDB: Compressed tables use zlib 1.2.11\n","stream":"stderr","time":"2022-10-11T19:12:23.852701Z"}
{"log":"2022-10-11 19:12:23 0 [Note] InnoDB: Number of transaction pools: 1\n","stream":"stderr","time":"2022-10-11T19:12:23.857098Z"}
{"log":"2022-10-11 19:12:23 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions\n","stream":"stderr","time":"2022-10-11T19:12:23.85742Z"}
{"log":"2022-10-11 19:12:23 0 [Warning] mariadbd: io_uring_queue_init() failed with ENOSYS: check seccomp filters, and the kernel version (newer than 5.1 required)\n","stream":"stderr","time":"2022-10-11T19:12:23.995985Z"}
{"log":"2022-10-11 19:12:23 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF\n","stream":"stderr","time":"2022-10-11T19:12:23.996307Z"}
{"log":"2022-10-11 19:12:23 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB\n","stream":"stderr","time":"2022-10-11T19:12:23.999034Z"}
{"log":"2022-10-11 19:12:24 0 [Note] InnoDB: Completed initialization of buffer pool\n","stream":"stderr","time":"2022-10-11T19:12:24.003406Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] InnoDB: File ./ib_logfile0 was not found\n","stream":"stderr","time":"2022-10-11T19:12:24.107739Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error\n","stream":"stderr","time":"2022-10-11T19:12:24.107839Z"}
{"log":"2022-10-11 19:12:24 0 [Note] InnoDB: Starting shutdown...\n","stream":"stderr","time":"2022-10-11T19:12:24.107864Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] Plugin 'InnoDB' init function returned error.\n","stream":"stderr","time":"2022-10-11T19:12:24.31149Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.\n","stream":"stderr","time":"2022-10-11T19:12:24.31159Z"}
{"log":"2022-10-11 19:12:24 0 [Note] Plugin 'FEEDBACK' is disabled.\n","stream":"stderr","time":"2022-10-11T19:12:24.31182Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] Unknown/unsupported storage engine: InnoDB\n","stream":"stderr","time":"2022-10-11T19:12:24.31213Z"}
{"log":"2022-10-11 19:12:24 0 [ERROR] Aborting\n","stream":"stderr","time":"2022-10-11T19:12:24.312159Z"}

Relevant lines from docker-compose.yml

version: '3'

db1:
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'xx'
MYSQL_DATABASE: 'xx'
MYSQL_USER: 'xx'
MYSQL_PASSWORD: 'xx'
MARIADB_AUTO_UPGRADE: 'true'
volumes:
- ./data/mysql:/var/lib/mysql

Would anyone have any suggestions on how to fix this.

Answer Answered by Daniel Black in this comment.

A docker inspect 51ca0cc3bcac should have ENV MARIADB_VERSION=... which shows the old version.

Yes, move ib_logfile0 back and don't touch it. The existence of these forms of bad advices on multiple forums as resulted in many corrupt database.

Its likely that the upgrade wants a clean shutdown in which case start up the previous version and shut it down cleanly. Ensure compose doesn't get impatient and kill it off during the shutdown.

After the clean shutdown is performed, try the new version again.

Slow running containers is likely to be a different problem. Increased --innodb-buffer-pool-size=512M as an argument or kernel related (I can tell your on an old kernel due to ENOSYS for uring).

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.