8.0.8/8.0.9 Seafile Server Container Periodically Fails

Hello,

I have been running seafile in a docker container for over a year with success. This was deployed in a Kubernetes cluster. Recently (starting with 8.0.8), the seafile server container started periodically restarting. Yesterday alone the container this happened 89 times! The frustrating part is that I do not know why this is happening, here are the logs from the seafile server container when the container restarts:

*** Shutting down /scripts/enterpoint.sh (PID 26)...
*** Shutting down runit daemon (PID 25)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Init system aborted.
*** Killing all processes...
*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 25
*** Running /scripts/enterpoint.sh...
2021-08-26 12:33:34 Nginx ready
2021-08-26 12:33:35 This is a idle script (infinite loop) to keep container running.
[08/26/2021 12:33:37][upgrade]: The container was recreated, running minor-upgrade.sh to fix the media symlinks
[08/26/2021 12:33:37][upgrade]: Running script /opt/seafile/seafile-pro-server-8.0.9/upgrade/minor-upgrade.sh

-------------------------------------------------------------
This script would do the minor upgrade for you.
Press [ENTER] to contiune
-------------------------------------------------------------


renaming the gunicorn.conf to gunicorn.conf.py ...

Done

------------------------------
migrating avatars ...


DONE
------------------------------


Moving the elasticsearch's configuration file ...

/bin/cp: '/opt/seafile/seafile-server-latest/pro/elasticsearch/config/jvm.options' and '/opt/seafile/seafile-pro-server-8.0.9/pro/elasticsearch/config/jvm.options' are the same file

updating seafile-server-latest symbolic link to /opt/seafile/seafile-pro-server-8.0.9 ...

DONE
------------------------------


** Message: 12:33:39.323: seafile-controller.c(932): loading seafdav config from  /opt/seafile/conf/seafdav.conf

2021-08-26 12:33:39 ../common/seaf-utils.c(409): Use database Mysql
2021-08-26 12:33:39 http-server.c(230): fileserver: worker_threads = 10
2021-08-26 12:33:39 http-server.c(243): fileserver: backlog = 32
2021-08-26 12:33:39 http-server.c(258): fileserver: fixed_block_size = 8388608
2021-08-26 12:33:39 http-server.c(273): fileserver: web_token_expire_time = 3600
2021-08-26 12:33:39 http-server.c(288): fileserver: max_indexing_threads = 1
2021-08-26 12:33:39 http-server.c(303): fileserver: max_index_processing_threads= 3
2021-08-26 12:33:39 http-server.c(325): fileserver: cluster_shared_temp_file_mode = 600
2021-08-26 12:33:39 http-server.c(403): fileserver: enable_async_indexing = 0
2021-08-26 12:33:39 http-server.c(415): fileserver: async_indexing_threshold = 700
2021-08-26 12:33:39 http-server.c(427): fileserver: fs_id_list_request_timeout = 300
2021-08-26 12:33:39 http-server.c(440): fileserver: max_sync_file_count = 100000
2021-08-26 12:33:39 ../common/license.c(718): License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users
License file /opt/seafile/seafile-license.txt does not exist, allow at most 3 trial users
Starting seafile server, please wait ...
** Message: 12:33:39.897: seafile-controller.c(932): loading seafdav config from        /opt/seafile/conf/seafdav.conf

Seafile server started

Done.

Starting seahub at port 8000 ...

Seahub is started

Done.

From the logs, I cannot figure out why this is happening. I also checked the controller.log, seahub.log, seafile.log, and seafevents.log logs but there does not seem to be any information there regarding the restart either.

Is there a way to enable additional logging or other places to look?

Help is greatly appreciated.
Ray

Can you paste the content of controller.log?

Thanks @daniel.pan for taking a look at this:

2021-08-26 12:27:08 seafile-controller.c(205): starting seaf-server ...
2021-08-26 12:27:08 seafile-controller.c(96): spawn_process: seaf-server -F /opt/seafile/conf -c /opt/seafile/ccnet -d /opt/seafile/seafile-data -l /opt/seafile/logs/seafile.log -P /opt/seafile/pids/seaf-server.pid -p /opt/seafile/seafile-pro-server-8.0.9/runtime -f -L /opt/seafile
2021-08-26 12:27:08 seafile-controller.c(130): spawned seaf-server, pid 99
2021-08-26 12:27:18 seafile-controller.c(554): pid file /opt/seafile/pids/seafevents.pid does not exist
2021-08-26 12:27:18 seafile-controller.c(585): seafevents need restart...
2021-08-26 12:27:18 seafile-controller.c(96): spawn_process: /usr/bin/python3 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
2021-08-26 12:27:18 seafile-controller.c(130): spawned /usr/bin/python3, pid 152
2021-08-26 12:27:19 seafile-controller.c(472): local elasticserach server will not be started
2021-08-26 12:32:34 seafile-controller.c(619): shutting down all services ...
2021-08-26 12:33:39 seafile-controller.c(205): starting seaf-server ...
2021-08-26 12:33:39 seafile-controller.c(96): spawn_process: seaf-server -F /opt/seafile/conf -c /opt/seafile/ccnet -d /opt/seafile/seafile-data -l /opt/seafile/logs/seafile.log -P /opt/seafile/pids/seaf-server.pid -p /opt/seafile/seafile-pro-server-8.0.9/runtime -f -L /opt/seafile
2021-08-26 12:33:39 seafile-controller.c(130): spawned seaf-server, pid 98
2021-08-26 12:33:49 seafile-controller.c(554): pid file /opt/seafile/pids/seafevents.pid does not exist
2021-08-26 12:33:49 seafile-controller.c(585): seafevents need restart...
2021-08-26 12:33:49 seafile-controller.c(96): spawn_process: /usr/bin/python3 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
2021-08-26 12:33:49 seafile-controller.c(130): spawned /usr/bin/python3, pid 151
2021-08-26 12:33:50 seafile-controller.c(472): local elasticserach server will not be started
2021-08-26 20:52:18 seafile-controller.c(619): shutting down all services ...
2021-08-26 20:53:38 seafile-controller.c(205): starting seaf-server ...
2021-08-26 20:53:38 seafile-controller.c(96): spawn_process: seaf-server -F /opt/seafile/conf -c /opt/seafile/ccnet -d /opt/seafile/seafile-data -l /opt/seafile/logs/seafile.log -P /opt/seafile/pids/seaf-server.pid -p /opt/seafile/seafile-pro-server-8.0.9/runtime -f -L /opt/seafile
2021-08-26 20:53:38 seafile-controller.c(130): spawned seaf-server, pid 100
2021-08-26 20:53:48 seafile-controller.c(554): pid file /opt/seafile/pids/seafevents.pid does not exist
2021-08-26 20:53:48 seafile-controller.c(585): seafevents need restart...
2021-08-26 20:53:48 seafile-controller.c(96): spawn_process: /usr/bin/python3 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
2021-08-26 20:53:48 seafile-controller.c(130): spawned /usr/bin/python3, pid 152
2021-08-26 20:53:49 seafile-controller.c(472): local elasticserach server will not be started
2021-08-26 21:16:33 seafile-controller.c(619): shutting down all services ...

Let me know if there is anything else I can provide.
Ray

From the log

2021-08-26 21:16:33 seafile-controller.c(619): shutting down all services ...

SeafileController has received a SIGTERM signal and shut down all services. It can only be caused by Docker environment, not Seafile docker image itself. Though I don’t know the exact cause.

1 Like

Thank you @daniel.pan you validated my suspicion….unfortunately. :slightly_smiling_face:

I’ll update this post if/when I can resolve my issue in case others have a similar problem.

Looks like the issue was the underlying network experiencing intermittent failures. My Liveness and Readiness probes were more “strictly” configured for the seafile server compared to my other containers.

Thanks again Daniel Pan

2 Likes