haiwen/seafile-docker

seafile instance has stopped working... The data maybe is lost

avalarh opened this issue · 2 comments

I had a seafile instance for a few years, which was launched using the default example of docker compose. (with modified passwords/hostnames).
Suddenly it has stopped working and the debug message is unclear.
[10/07/20 19:04:04] ../common/session.c(148): using config file /opt/seafile/conf/ccnet.conf
[10/07/20 19:04:04] SQL error: 5 - database is locked
: CREATE TABLE IF NOT EXISTS Config (key TEXT PRIMARY KEY, value TEXT);
Starting seafile server, please wait ...

I've tried to recreate all the containers. Just left the data volume untouched. The error message is the same.
I could not find a way to debug it since everything is launched within one container.
The docker compose file is:
`version: '2.0'
services:
db:
image: mariadb:10.1
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=blahblah # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
networks:
- seafile-net

memcached:
image: memcached:1.5.6
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net

seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
ports:
- 80:80
- 443:443
volumes:
- /mnt/backup/files:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=blahblah # Requested, the value shuold be root's password of MySQL service.
- SEAFILE_ADMIN_EMAIL=blahblah@gmail.com # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=Not6foocGes' # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=true # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=files.blahblah.blah # Specifies your host name if https is enabled.
- VIRTUAL_HOST=files.blahblah.blah
- LETSENCRYPT_HOST=files.blahblah.blah
- LETSENCRYPT_EMAIL=blahblah@gmail.com
- VIRTUAL_PORT=443
- VIRTUAL_PROTO=https
depends_on:
- db
- memcached
networks:
- seafile-net

networks:
seafile-net:
volumes:
html:
db:`

I could not find a way to debug it since everything is launched within one container

As you are using docker compose, the different components are already using their own container.

The database is locked message is often caused by you are using SQLite as database. It is likely the config files that read by the seafile is wrong.

A possible fix is that you setup a new working Seafile docker instance, then migrate the old data to the new instance by following our backup/restore document.

I had the same problem. No SQLite database was used, the database was mysql. Since it was used as a backup instance I preferred just to reinstall everything after spending some time trying to fix it.
Need to say, that despite the seafile itself seemed to be wonderful software (if not the sudden collapse), the seafile-mc container is a huge mess with multiple daemons and scripts running in the same container.