Mariadb constant error loop

Hi,

after some difficulties with portainer (basically a new install), I redeployed my seafile stack but the database server seems to be in a constant error loop.

Mariadb Container Log

2026-02-24 11:24:46 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2026-02-24 11:24:46 0 [Warning] mariadbd: io_uring_queue_init() failed with EPERM: sysctl kernel.io_uring_disabled has the value 2, or 1 and the user of the process is not a member of sysctl kernel.io_uring_group. (see man 2 io_uring_setup).
create_uring failed: falling back to libaio
2026-02-24 11:24:46 0 [Note] InnoDB: Using Linux native AIO
2026-02-24 11:24:46 0 [Note] InnoDB: innodb_buffer_pool_size_max=128m, innodb_buffer_pool_size=128m
2026-02-24 11:24:46 0 [Note] InnoDB: Completed initialization of buffer pool
2026-02-24 11:24:46 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2026-02-24 11:24:46 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=17055
2026-02-24 11:24:46 0 [Note] InnoDB: End of log at LSN=36381
2026-02-24 11:24:46 0 [Note] InnoDB: To recover: 2 pages
2026-02-24 11:24:46 0 [Note] InnoDB: 128 rollback segments are active.
2026-02-24 11:24:46 0 [Note] InnoDB: Removed temporary tablespace data file: “./ibtmp1”
2026-02-24 11:24:46 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12.000MiB. Physically writing the file full; Please wait …
2026-02-24 11:24:46 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12.000MiB.
2026-02-24 11:24:46 0 [Note] InnoDB: log sequence number 36381; transaction id 4
2026-02-24 11:24:46 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2026-02-24 11:24:46 0 [ERROR] Can’t open and lock privilege tables: Table ‘mysql.servers’ doesn’t exist
2026-02-24 11:24:46 0 [Warning] Can’t open and lock time zone table: Table ‘mysql.time_zone_leap_second’ doesn’t exist trying to live without them
2026-02-24 11:24:46 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table ‘mysql.gtid_slave_pos’ doesn’t exist
2026-02-24 11:24:46 0 [Note] mariadbd: ready for connections.
Version: ‘10.11.15-MariaDB-ubu2204’ socket: ‘/run/mysqld/mysqld.sock’ port: 0 mariadb-org binary distribution
2026-02-24 11:24:47+00:00 [Note] [Entrypoint]: Temporary server started.
2026-02-24 11:24:47+00:00 [Note] [Entrypoint]: Backing up system database to system_mysql_backup_10.11.13-MariaDB.sql.zst
Error: Couldn’t read status information for table general_log ()
mariadb-dump: Couldn’t execute ‘show create table general_log’: Table ‘mysql.general_log’ doesn’t exist (1146)
2026-02-24 11:24:47+00:00 [ERROR] [Entrypoint]: Unable backup system database for upgrade from 10.11.13-MariaDB.
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.15+maria~ubu2204 started.
2026-02-24 11:24:54+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.15+maria~ubu2204 started.
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: MariaDB healthcheck configuration file missing, assuming desirable
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: Starting temporary server
2026-02-24 11:24:54+00:00 [Note] [Entrypoint]: Waiting for server startup
2026-02-24 11:24:54 0 [Note] Starting MariaDB 10.11.15-MariaDB-ubu2204 source revision cb0d6dd835023a7162ace471cd047161f205dd58 server_uid iw69kuaTtimU6cJbfpbfypL1qs0= as process 58
2026-02-24 11:24:55 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2026-02-24 11:24:55 0 [Note] InnoDB: Number of transaction pools: 1
2026-02-24 11:24:55 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2026-02-24 11:24:55 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2026-02-24 11:24:55 0 [Warning] mariadbd: io_uring_queue_init() failed with EPERM: sysctl kernel.io_uring_disabled has the value 2, or 1 and the user of the process is not a member of sysctl kernel.io_uring_group. (see man 2 io_uring_setup).
create_uring failed: falling back to libaio
2026-02-24 11:24:55 0 [Note] InnoDB: Using Linux native AIO
2026-02-24 11:24:55 0 [Note] InnoDB: innodb_buffer_pool_size_max=128m, innodb_buffer_pool_size=128m
2026-02-24 11:24:55 0 [Note] InnoDB: Completed initialization of buffer pool
2026-02-24 11:24:55 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2026-02-24 11:24:55 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=17055
2026-02-24 11:24:55 0 [Note] InnoDB: End of log at LSN=36381
2026-02-24 11:24:55 0 [Note] InnoDB: To recover: 2 pages
2026-02-24 11:24:55 0 [Note] InnoDB: 128 rollback segments are active.
2026-02-24 11:24:55 0 [Note] InnoDB: Removed temporary tablespace data file: “./ibtmp1”
2026-02-24 11:24:55 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12.000MiB. Physically writing the file full; Please wait …
2026-02-24 11:24:55 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12.000MiB.
2026-02-24 11:24:55 0 [Note] InnoDB: log sequence number 36381; transaction id 4
2026-02-24 11:24:55 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2026-02-24 11:24:55 0 [ERROR] Can’t open and lock privilege tables: Table ‘mysql.servers’ doesn’t exist
2026-02-24 11:24:55 0 [Warning] Can’t open and lock time zone table: Table ‘mysql.time_zone_leap_second’ doesn’t exist trying to live without them
2026-02-24 11:24:55 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table ‘mysql.gtid_slave_pos’ doesn’t exist
2026-02-24 11:24:55 0 [Note] mariadbd: ready for connections.
Version: ‘10.11.15-MariaDB-ubu2204’ socket: ‘/run/mysqld/mysqld.sock’ port: 0 mariadb-org binary distribution
2026-02-24 11:24:55+00:00 [Note] [Entrypoint]: Temporary server started.
2026-02-24 11:24:55+00:00 [Note] [Entrypoint]: Backing up system database to system_mysql_backup_10.11.13-MariaDB.sql.zst
Error: Couldn’t read status information for table general_log ()
mariadb-dump: Couldn’t execute ‘show create table general_log’: Table ‘mysql.general_log’ doesn’t exist (1146)
2026-02-24 11:24:55+00:00 [ERROR] [Entrypoint]: Unable backup system database for upgrade from 10.11.13-MariaDB.
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.15+maria~ubu2204 started.
2026-02-24 11:25:09+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.15+maria~ubu2204 started.
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: MariaDB healthcheck configuration file missing, assuming desirable
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: Starting temporary server
2026-02-24 11:25:09+00:00 [Note] [Entrypoint]: Waiting for server startup
2026-02-24 11:25:09 0 [Note] Starting MariaDB 10.11.15-MariaDB-ubu2204 source revision cb0d6dd835023a7162ace471cd047161f205dd58 server_uid aE1oGXhkn5VxJGe5d+FmCXe3YDU= as process 58
2026-02-24 11:25:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2026-02-24 11:25:10 0 [Note] InnoDB: Number of transaction pools: 1
2026-02-24 11:25:10 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2026-02-24 11:25:10 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2026-02-24 11:25:10 0 [Warning] mariadbd: io_uring_queue_init() failed with EPERM: sysctl kernel.io_uring_disabled has the value 2, or 1 and the user of the process is not a member of sysctl kernel.io_uring_group. (see man 2 io_uring_setup).
create_uring failed: falling back to libaio
2026-02-24 11:25:10 0 [Note] InnoDB: Using Linux native AIO
2026-02-24 11:25:10 0 [Note] InnoDB: innodb_buffer_pool_size_max=128m, innodb_buffer_pool_size=128m
2026-02-24 11:25:10 0 [Note] InnoDB: Completed initialization of buffer pool
2026-02-24 11:25:10 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2026-02-24 11:25:10 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=17055
2026-02-24 11:25:10 0 [Note] InnoDB: End of log at LSN=36381
2026-02-24 11:25:10 0 [Note] InnoDB: To recover: 2 pages
2026-02-24 11:25:10 0 [Note] InnoDB: 128 rollback segments are active.
2026-02-24 11:25:10 0 [Note] InnoDB: Removed temporary tablespace data file: “./ibtmp1”
2026-02-24 11:25:10 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12.000MiB. Physically writing the file full; Please wait …
2026-02-24 11:25:10 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12.000MiB.
2026-02-24 11:25:10 0 [Note] InnoDB: log sequence number 36381; transaction id 4
2026-02-24 11:25:10 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2026-02-24 11:25:10 0 [ERROR] Can’t open and lock privilege tables: Table ‘mysql.servers’ doesn’t exist
2026-02-24 11:25:10 0 [Warning] Can’t open and lock time zone table: Table ‘mysql.time_zone_leap_second’ doesn’t exist trying to live without them
2026-02-24 11:25:10 1 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table ‘mysql.gtid_slave_pos’ doesn’t exist

After stopping the stack I checked the db folder and the previous contents are now deleted. I have this folder backed up but did not export any .sql files from the container as per backing-up-database guide.

How can I redeploy the stack with the database intact?

If this is not possible, do i just start the stack, pause the database and use the FSCK tool from inside the seafile container?

Thanks in advance!

I don’t quite understand your question and situation.

If you want to fix your database, here are some suggestions:

The issue you are experiencing with MariaDB being in a “constant error loop” is primarily due to missing or corrupted system tables within the mysql database, which is crucial for MariaDB’s operation.

Here’s an analysis of the problem based on the provided logs and your description:

Core Issue:

The most critical errors in the log indicate that MariaDB cannot find or access its essential system tables:

  • [ERROR] Can’t open and lock privilege tables: Table ‘mysql.servers’ doesn’t exist
  • [Warning] Can’t open and lock time zone table: Table ‘mysql.time_zone_leap_second’ doesn’t exist
  • [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table ‘mysql.gtid_slave_pos’ doesn’t exist
  • mariadb-dump: Couldn’t execute ‘show create table general_log’: Table ‘mysql.general_log’ doesn’t exist (1146)
  • [ERROR] [Entrypoint]: Unable backup system database for upgrade from 10.11.13-MariaDB.

These errors explicitly state that core tables within the mysql schema are missing. This is usually the case when the MariaDB data directory is either uninitialized, severely corrupted, or has been wiped.

Cause:

Your statement “After stopping the stack I checked the db folder and the previous contents are now deleted” directly explains the root cause. When the db folder (which serves as MariaDB’s data directory) was cleared, all the database files, including the mysql system database, were removed.

The MariaDB container’s entrypoint script is then attempting to start and potentially upgrade from an older version (10.11.13 to 10.11.15). This process requires backing up the existing system database, but since the db folder is empty or corrupted, it fails to find these tables, leading to the “Unable backup system database for upgrade” error and the continuous restart loop.

The warnings about io_uring_queue_init() failed with EPERM are secondary; while they might indicate a sub-optimal I/O setup, they are not the cause of the database failing to start.

Summary of the issue:

The MariaDB container is failing to start because its data directory (db folder) has lost its contents, specifically the critical mysql system database tables. The container’s entrypoint script attempts an upgrade or initialization but cannot proceed without these fundamental tables, resulting in a continuous crash/restart loop.

Thank you for taking the time to reply.

Say the deletion of files happens on container startup, can I pause the container, manually copy the files into the directory and then resume it? After that I could download my data and then investigate further.

You can pause the container, and use seaf-fsck to export files.