Seafile docker dead on deployment

Hi all, looking for some help here.

I followed the instructions here for deploying the seafile docker containers: Seafile Server

Customized nothing besides the mysql path. Started the containers with docker-compose, visited the seahub address and get “502 bad gateway” instead of seahub.

I am also seeing an “access denied” mysql error which makes no sense, because again, I have customized nothing with these containers.

Are the containers considered production ready?

Here’s my logs. Thanks for the help!

Starting seafile-memcached … done
Starting seafile-mysql … done
Recreating seafile … done
Attaching to seafile-memcached, seafile-mysql, seafile
seafile-mysql | 2021-08-18 16:55:39+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.12+maria~focal started.
seafile-mysql | 2021-08-18 16:55:39+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
seafile-mysql | 2021-08-18 16:55:39+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.5.12+maria~focal started.
seafile-mysql | 2021-08-18 16:55:39 0 [Note] mysqld (mysqld 10.5.12-MariaDB-1:10.5.12+maria~focal) starting as process 1 …
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Uses event mutexes
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Number of pools: 1
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
seafile-mysql | 2021-08-18 16:55:39 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Using Linux native AIO
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Completed initialization of buffer pool
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: 128 rollback segments are active.
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Creating shared tablespace for temporary tables
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: 10.5.12 started; log sequence number 786395; transaction id 974
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
seafile-mysql | 2021-08-18 16:55:39 0 [Note] Plugin ‘FEEDBACK’ is disabled.
seafile-mysql | 2021-08-18 16:55:39 0 [Note] InnoDB: Buffer pool(s) load completed at 210818 16:55:39
seafile-mysql | 2021-08-18 16:55:39 0 [Note] Server socket created on IP: ‘::’.
seafile-mysql | 2021-08-18 16:55:39 0 [Warning] ‘proxies_priv’ entry ‘@% root@53f14a19d7d0’ ignored in --skip-name-resolve mode.
seafile-mysql | 2021-08-18 16:55:39 0 [Note] Reading of all Master_info entries succeeded
seafile-mysql | 2021-08-18 16:55:39 0 [Note] Added new Master_info ‘’ to hash table
seafile-mysql | 2021-08-18 16:55:39 0 [Note] mysqld: ready for connections.
seafile-mysql | Version: ‘10.5.12-MariaDB-1:10.5.12+maria~focal’ socket: ‘/run/mysqld/mysqld.sock’ port: 3306 mariadb.org binary distribution
seafile | *** Running /etc/my_init.d/01_create_data_links.sh…
seafile | *** Booting runit daemon…
seafile | *** Runit started as PID 16
seafile | *** Running /scripts/enterpoint.sh…
seafile | 2021-08-18 11:55:39 Waiting Nginx
seafile | 2021-08-18 11:55:40 Nginx ready
seafile | 2021-08-18 11:55:40 This is a idle script (infinite loop) to keep container running.
seafile-mysql | 2021-08-18 16:55:40 3 [Warning] Aborted connection 3 to db: ‘unconnected’ user: ‘root’ host: ‘172.19.0.4’ (Got an error reading communication packets)
seafile | Checking python on this machine …
seafile |
seafile-mysql | 2021-08-18 16:55:40 5 [Warning] Access denied for user ‘seafile’@‘172.19.0.4’ (using password: YES)
seafile |
seafile | verifying password of user root … done
seafile |
seafile | verifying password of user seafile …
seafile | Failed to connect to mysql server using user “seafile” and password “***”: Access denied for user ‘seafile’@‘172.19.0.4’ (using password: YES)
seafile |
seafile-mysql | 2021-08-18 16:55:40 4 [Warning] Aborted connection 4 to db: ‘unconnected’ user: ‘root’ host: ‘172.19.0.4’ (Got an error reading communication packets)
seafile | [2021-08-18 11:55:40] Now running setup-seafile-mysql.py in auto mode.
seafile | Traceback (most recent call last):
seafile | File “/scripts/start.py”, line 86, in
seafile | main()
seafile | File “/scripts/start.py”, line 56, in main
seafile | init_seafile_server()
seafile | File “/scripts/bootstrap.py”, line 145, in init_seafile_server
seafile | call(’{} auto -n seafile’.format(setup_script), env=env)
seafile | File “/scripts/utils.py”, line 70, in call
seafile | return subprocess.check_call(*a, **kw)
seafile | File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
seafile | raise CalledProcessError(retcode, cmd)
seafile | subprocess.CalledProcessError: Command ‘/opt/seafile/seafile-server-8.0.7/setup-seafile-mysql.sh auto -n seafile’ returned non-zero exit status 255.

The manual you used is outdated. I am not sure this is the cause of your problem, but it’s likely.

Please use the following

(The outdated manual should be taken offline. I agree.)

I am having problems with Docker too and followed the manual you have linked. There are other issues about the same thing (“docker SQL issues” and “fresh installation on debian 11 docker error from setup seafile mysql py see latest post”; sorry, cannot put links). I am using Ubuntu 21.04, not Debian 11.

For some reason the MySQL script fails the first time the container is ran, and if you re-try to manually run it, it acknowledges that previous databases/folders/resources have already been created, but doesn’t continue creating the remaining ones, so it is not possible to finish the database operations for the site to work. I even entered into the db container, ran “mysql-client”, dropped the databases, ran the script again, but it still fails every time).

Whatever I can do to help debugging this issue, plase let me know :slight_smile:

I cannot help you with the docker based deployment.

I know that the instructions for the manual installation work (using Debian 10 and Ubuntu 20.04): Installation with MySQL - Seafile Admin Manual

1 Like

For what it’s worth I bailed on the docker setup - it flat doesn’t work.

Grabbed a docker nginx (linuxserver.io SWAG) and docker mariadb, then installed seafile server from the .tar.gz. Working fine this way.

Docker initial setup works for me (using docker-compose), but I’m getting the same error after the containers has been removed and re-created. The only way to get back to a working state is to then backup the required mysql tables, remove the mysql container data, have it recreate from scratch and then manually repopulate the databases ccnet_db, seafile_db and seahub_db from backup. I’m sharing this approach here since it was a bit difficult to figure out and hope it might help others:

assumptions:

  • name of seafile docker container: seafile
  • name of seafile-mysql docker container: seafile-mysql
  • location of database folder for seafile-msyql located at ./db
  • ./db is mounted in seafile-mysql at location /var/lib/mysql
  • mysql root user, password: root, db_dev

in case any of those assumptions differ for you, adapt the commands below accordingly

step 1: backup databases

docker exec -it seafile-mysql mysqldump  -uroot --password=db_dev --opt  seahub_db > ./seahub_db.sql
docker exec -it seafile-mysql mysqldump  -uroot --password=db_dev --opt  seafile_db > ./seafile_db.sql
docker exec -it seafile-mysql mysqldump  -uroot --password=db_dev --opt  ccnet_db > ./ccnet_db.sql

step 2: stop seafile and mysql docker containers, move the database folder:

 docker stop seafile-mysql seafile
 mv db db.backup

step 3: start mysql and seafile docker containers again, ./db will be recreated

docker start seafile-mysql seafile

step 4: move the created backups to the mysql database folder and restore the databases

mv *.sql ./db/
docker exec -it seafile-mysql /bin/sh -c "mysql -uroot --password=db_dev seahub_db < /var/lib/mysql/seahub_db.sql"
docker exec -it seafile-mysql /bin/sh -c "mysql -uroot --password=db_dev seafile_db < /var/lib/mysql/seafile_db.sql"
docker exec -it seafile-mysql /bin/sh -c "mysql -uroot --password=db_dev ccnet_db < /var/lib/mysql/ccnet_db.sql"

in case you wish to revert above steps:

mv db db_new && mv db.backup db
1 Like