Error:Seahub failed to start. with DB connection errors

Usually seafile fails to properly start on a system reboot. Most of the time I either re-start the stack and tell it to pull the containers, or manually access the console for the seafile container, cd to seafile-server-latest and then ./seahub.sh start

Today, none of that works.

Please understand “I don’t know what I don’t know” and if you need additional information please ask (And show how to provide) I am just some guy that started running this without fully understanding it.

Here is the information in the container logs (I assume thats the logs you need:

Error:Seahub failed to start.

Please try to run "./seahub.sh start" again

Traceback (most recent call last):

  File "/scripts/start.py", line 94, in <module>

    main()

  File "/scripts/start.py", line 80, in main

    call('{} start'.format(get_script('seahub.sh')))

  File "/scripts/utils.py", line 70, in call

    return subprocess.check_call(*a, **kw)

  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-11.0.13/seahub.sh start' returned non-zero exit status 1.


      

I get this unhelpful but when trying to run it in the container:

Error:Seahub failed to start.

Please try to run "./seahub.sh start" again

Traceback (most recent call last):

  File "/scripts/start.py", line 94, in <module>

    main()

  File "/scripts/start.py", line 80, in main

    call('{} start'.format(get_script('seahub.sh')))

  File "/scripts/utils.py", line 70, in call

    return subprocess.check_call(*a, **kw)

  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-11.0.13/seahub.sh start' returned non-zero exit status 1.


      

Errors on the DB:

2025-10-16 21:40:12 0 [Note] InnoDB: Buffer pool(s) load completed at 251016 21:40:12

2025-10-16 21:40:17 6 [Warning] Aborted connection 6 to db: 'seahub_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 4 [Warning] Aborted connection 4 to db: 'seafile_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 5 [Warning] Aborted connection 5 to db: 'ccnet_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 11 [Warning] Aborted connection 11 to db: 'seahub_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 9 [Warning] Aborted connection 9 to db: 'seahub_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 8 [Warning] Aborted connection 8 to db: 'seafile_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 7 [Warning] Aborted connection 7 to db: 'seafile_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:33 10 [Warning] Aborted connection 10 to db: 'seahub_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

2025-10-16 21:42:38 16 [Warning] Aborted connection 16 to db: 'seahub_db' user: 'seafile' host: '172.18.0.4' (Got an error reading communication packets)

And finally, at one point my stack in portaner was requested.. (Sensentive information removed)

services:
  db:
    image: mariadb:10.11
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - /poolof6s/MainFS/SubMain/config2/seafile:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.6.18
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
          
  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    ports:
      - "8088:80"
#     - "443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /poolof6s/MainFS/SubMain/CustomerBackups/seafile:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=  # Requested, the value should be root's password of MySQL service.
      - TIME_ZONE=America/Toronto  # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL= # Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=    # Specifies Seafile admin password, default is 'asecret'.
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=none.none.com # Specifies your host name if https is enabled.
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

Lil help? (Or if you need mroe info, feel free to ask, I will provide)

I also tried to look at the log in the container. Maybe I don’t know what log I need. but I deleted seahub.log (After backup) seahub was started from the console, and it re-created a 0 byte file. Did the same after starting the container again.

You can also modify conf/gunicorn.conf , change daemon = True to daemon = False , then run ./seahub.sh again. If there are missing Python dependencies, the error will be reported in the terminal.

It seems to have started the server.

root@ae54a22a17eb:/opt/seafile/seafile-server-latest# ./seahub.sh start

Starting seahub at port 8000 ...
[2025-10-17 11:39:59 -0400] [18408] [INFO] Starting gunicorn 20.1.0
[2025-10-17 11:39:59 -0400] [18408] [INFO] Listening at: http://127.0.0.1:8000 (18408)
[2025-10-17 11:39:59 -0400] [18408] [INFO] Using worker: sync
[2025-10-17 11:39:59 -0400] [18410] [INFO] Booting worker with pid: 18410
[2025-10-17 11:39:59 -0400] [18411] [INFO] Booting worker with pid: 18411
[2025-10-17 11:39:59 -0400] [18412] [INFO] Booting worker with pid: 18412
[2025-10-17 11:39:59 -0400] [18413] [INFO] Booting worker with pid: 18413
[2025-10-17 11:40:00 -0400] [18414] [INFO] Booting worker with pid: 18414

I don’t get a return to the bash, it just sits there, but I am able to get into the web interface, and the programs that connect to it work.

I then changed it from false back to true, and it started no problem.

I do not suspect that was the actual resolution (please correct me if I am wrong) buy why does this keep happening? It won’t start, usually I just need to start it manually. This time I had to wait a whole day and start it manually, and its all good. (Again, unless I misunderstand, and switching to false, and back to true was a resolution)

It is likely a random problem caused by the Seafile container starting before the database service is ready.
You can upgrade Seafile to version 12.0 or 13.0. In these later versions, we have enhanced the YAML files to prevent such issues.