Upgrading from 11 to 12: unable to connect to database?

Hello, I followed the Docker upgrade instructions (Upgrade Seafile Docker - Seafile Admin Manual), but my database container is unable to start successfully.

Using the fresh .env and seafile-server.yml files, I changed only the fields the instructions mention and double-checked they’re consistent with my existing installation.

Whether it’s related to this issue or not, I also don’t understand how Caddy factors into version 12, or whether it’s even necessary if I’m using my own reverse proxy (which I am).

Docker logs:

2025-06-18 21:18:59+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.8+maria~ubu2204 started.

2025-06-18 21:18:59+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB

2025-06-18 21:18:59+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2025-06-18 21:18:59+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.8+maria~ubu2204 started.

2025-06-18 21:18:59+00:00 [Note] [Entrypoint]: MariaDB upgrade not required

2025-06-18 21:18:59 0 [Note] Starting MariaDB 10.11.8-MariaDB-ubu2204 source revision 3a069644682e336e445039e48baae9693f9a08ee as process 1

2025-06-18 21:19:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.11

2025-06-18 21:19:00 0 [Note] InnoDB: Number of transaction pools: 1

2025-06-18 21:19:00 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions

2025-06-18 21:19:00 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1

2025-06-18 21:19:00 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF

2025-06-18 21:19:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB

2025-06-18 21:19:00 0 [Note] InnoDB: Completed initialization of buffer pool

2025-06-18 21:19:00 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)

2025-06-18 21:19:00 0 [Note] InnoDB: End of log at LSN=736860410

2025-06-18 21:19:00 0 [Note] InnoDB: 128 rollback segments are active.

2025-06-18 21:19:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...

2025-06-18 21:19:00 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.

2025-06-18 21:19:00 0 [Note] InnoDB: log sequence number 736860410; transaction id 2200778

2025-06-18 21:19:00 0 [Note] Plugin 'FEEDBACK' is disabled.

2025-06-18 21:19:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool

2025-06-18 21:19:00 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.

2025-06-18 21:19:00 0 [Note] Server socket created on IP: '0.0.0.0'.

2025-06-18 21:19:00 0 [Note] Server socket created on IP: '::'.

2025-06-18 21:19:00 0 [Note] mariadbd: ready for connections.

Version: '10.11.8-MariaDB-ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

2025-06-18 21:19:00 0 [Note] InnoDB: Buffer pool(s) load completed at 250618 21:19:00

2025-06-18 21:19:04 3 [Warning] Access denied for user 'root'@'::1' (using password: NO)

2025-06-18 21:19:09 4 [Warning] Access denied for user 'root'@'::1' (using password: NO)

2025-06-18 21:19:14 5 [Warning] Access denied for user 'root'@'::1' (using password: NO)

.env content:

COMPOSE_FILE='seafile-server.yml,caddy.yml,seadoc.yml'
COMPOSE_PATH_SEPARATOR=','


SEAFILE_IMAGE=seafileltd/seafile-mc:12.0-latest
SEAFILE_DB_IMAGE=mariadb:10.11
SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9-alpine

SEAFILE_VOLUME=/Seafile/shared
SEAFILE_MYSQL_VOLUME=/Seafile/mysql
SEAFILE_CADDY_VOLUME=/Seafile/caddy

SEAFILE_MYSQL_DB_HOST=db
INIT_SEAFILE_MYSQL_ROOT_PASSWORD=[redacted]
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=[redacted]

TIME_ZONE=Canada/Eastern

JWT_PRIVATE_KEY=[redacted]

SEAFILE_SERVER_HOSTNAME=[redacted]
SEAFILE_SERVER_PROTOCOL=http

INIT_SEAFILE_ADMIN_EMAIL=[redacted]
INIT_SEAFILE_ADMIN_PASSWORD=[redacted]


SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUME=/opt/seadoc-data

ENABLE_SEADOC=true


NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest
NOTIFICATION_SERVER_VOLUME=/opt/notification-data

seafile-server.yml content:

services:
  db:
    image: ${SEAFILE_DB_IMAGE:-mariadb:10.11}
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
      - MYSQL_LOG_CONSOLE=true
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - "${SEAFILE_MYSQL_VOLUME:-/opt/seafile-mysql/db}:/var/lib/mysql"
    networks:
      - seafile-net
    healthcheck:
      test:
        [
          "CMD",
          "/usr/local/bin/healthcheck.sh",
          "--connect",
          "--mariadbupgrade",
          "--innodb_initialized",
        ]
      interval: 20s
      start_period: 30s
      timeout: 5s
      retries: 10

  memcached:
    image: ${SEAFILE_MEMCACHED_IMAGE:-memcached:1.6.29}
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  seafile:
    image: ${SEAFILE_IMAGE:-seafileltd/seafile-mc:12.0-latest}
    container_name: seafile
    # ports:
    #   - "80:80"
    volumes:
      - ${SEAFILE_VOLUME:-/opt/seafile-data}:/shared
    environment:
      - DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
      - DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
      - DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
      - DB_ROOT_PASSWD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
      - DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
      - SEAFILE_MYSQL_DB_CCNET_DB_NAME=${SEAFILE_MYSQL_DB_CCNET_DB_NAME:-ccnet_db}
      - SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=${SEAFILE_MYSQL_DB_SEAFILE_DB_NAME:-seafile_db}
      - SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=${SEAFILE_MYSQL_DB_SEAHUB_DB_NAME:-seahub_db}
      - TIME_ZONE=${TIME_ZONE:-Etc/UTC}
      - INIT_SEAFILE_ADMIN_EMAIL=${INIT_SEAFILE_ADMIN_EMAIL:-me@example.com}
      - INIT_SEAFILE_ADMIN_PASSWORD=${INIT_SEAFILE_ADMIN_PASSWORD:-asecret}
      - SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
      - SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
      - SITE_ROOT=${SITE_ROOT:-/}
      - NON_ROOT=${NON_ROOT:-false}
      - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
      - SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false}
      - ENABLE_SEADOC=${ENABLE_SEADOC:-true}
      - SEADOC_SERVER_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}/sdoc-server
    labels:
      caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
      caddy.reverse_proxy: "{{upstreams 80}}"
    depends_on:
      db:
        condition: service_healthy
      memcached:
        condition: service_started
    networks:
      - seafile-net

networks:
  seafile-net:
    name: seafile-net

Update:

Apparently the permissions for .my-healthcheck.cnf were wrong (I don’t know why), so I updated them with the following command:

docker exec seafile-mysql chmod 600 /var/lib/mysql/.my-healthcheck.cnf

This stopped the “access denied” errors, but then I received this error:

flock: 9: Bad file descriptor
healthcheck mariadbupgrade failed

…which forced me to remove all the health check and depends_on syntax from the compose file. Docker complained about the container having no health check enabled, but it still started.

It -appears- to be working…the web UI loads, my clients connect, and I was able to upload and download files.

But I’m a little bit concerned about unintended consequences of disabling the health check/depends_on.

I’d still appreciate any guidance, if possible.