[SOLVED] Pid file /opt/seafile/pids/seafevents.pid does not exist [Was: 'Bad pidfile format: seafevents.pid']

Wonderful people in the Forum…

I am running seafile-pro-server_6.3.13 on a CentOS 7 - updated.

Seafile is working wonderfully, and there seems to be no real problem, but my controller.log keeps filling up with this:

[04/30/19 10:33:41] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success
[04/30/19 10:33:51] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[04/30/19 10:33:51] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success
[04/30/19 10:34:01] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[04/30/19 10:34:01] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success
[04/30/19 10:34:11] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[04/30/19 10:34:11] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success

I don’t seem to have any error messages in any other logs; related or not related to seafile.

The file is there, and has the right ownership, but it is empty:

[~]# ls -l /opt/seafile/pids
total 16
-rw-r–r–. 1 seafile seafile 6 Apr 30 08:56 ccnet.pid
-rw-r–r–. 1 seafile seafile 5 Apr 30 08:56 elasticsearch.pid
-rw-r–r–. 1 seafile seafile 0 Apr 30 08:19 seafevents.pid
-rw-r–r–. 1 seafile seafile 6 Apr 30 08:56 seaf-server.pid
-rw-r–r–. 1 seafile seafile 6 Apr 30 08:56 seahub.pid
[~]#

I tried to clean out the cache (following advice in the faq), but that didn’t change anything.

Has anyone else seen this?

Seafile Pro 6.3.12 on Scientific Linux 7:

-rw-r--r--. 1 seafile seafile 5 26. Mär 19:49 seafevents.pid

The PID belongs to the process

/usr/bin/python2.7 -m seafevents.main --config-file /home/seafile/conf/seafevents.conf --logfile /home/seafile/logs/seafevents.log -P /home/seafile/pids/seafevents.pid

Do your seafenvents.conf and seafevents.log file have the correct owner?

Thank you your response uosseafile. Unfortunately no - the logfile only holds a ton of these:

[~]# cat /var/log/seafile/seafevents.log
[2019-04-30 16:48:44,642] [INFO] audit is enabled
[2019-04-30 16:48:44,645] [INFO] [seafevents] database: mysql, name: seahub-db
[2019-04-30 16:48:44,702] [INFO] [seafevents] database: mysql, name: seafile-db
[2019-04-30 16:48:45,019] [INFO] [seafevents] database: mysql, name: seahub-db
[2019-04-30 16:48:45,070] [INFO] remove pidfile /opt/seafile/pids/seafevents.pid
[2019-04-30 16:48:51,382] [INFO] audit is enabled
[2019-04-30 16:48:51,383] [INFO] [seafevents] database: mysql, name: seahub-db
[2019-04-30 16:48:51,413] [INFO] [seafevents] database: mysql, name: seafile-db
[2019-04-30 16:48:51,544] [INFO] [seafevents] database: mysql, name: seahub-db
[2019-04-30 16:48:51,566] [INFO] remove pidfile /opt/seafile/pids/seafevents.pid
[2019-04-30 16:49:14,480] [INFO] audit is enabled
… (and it goes on…)

The config file gives me no clue either:

[DATABASE]
type = mysql
host = xxx.xxx.xxx.xxx
port = 3312
username = xxxxxxx
password = xxxxxxxxxxxxxxxxxxx
name = seahub-db

[AUDIT]
enabled = true

[STATISTICS]
enabled = true

[INDEX FILES]
enabled = true
interval = 10m

// If true, indexes the contents of office/pdf files while updating search index
// Note: If you change this option from “false” to “true”, then you need to clear the search index and update the index again. See the FAQ for details.
index_office_pdf = true

[OFFICE CONVERTER]
enabled = true
workers = 1

// how many pages are allowed to be previewed online. Default is 50 pages
max-pages = 50

// the max size of documents allowed to be previewed online, in MB. Default is 10 MB
// Previewing a large file (for example >30M) online is likely going to freeze the browser.
max-size = 10

[EVENTS PUBLISH]
// must be “true” to enable publish events messages
enabled = true
// message format: repo-update\t{{repo_id}}}\t{{commit_id}}
// Currently only support redis message queue
mq_type = redis

[REDIS]
// redis use the 0 database and “repo_update” channel
server = xxx.xxx.xxx.xxx
port = 6379
password = xxxxxxxxxxxxxxxxxx
[SEAHUB EMAIL]
enabled = true

// interval of sending Seahub email. Can be s(seconds), m(minutes), h(hours), d(days)
interval = 30m

Oh - I didn’t answer your question:

Yes, seafenvents.conf and seafevents.log file have the correct owner.
I have tested this by giving them both 777 (short - as a test). No difference.

Try the following steps to see if the problem solved:

  1. Stop Seafile
  2. Remove seafevents.pid manually
  3. Start Seafile

I tried that:

Starting seafile without the file, the file never shows up in the …/pids/ directory, and the controller.log goes:

[05/01/19 08:55:16] seafile-controller.c(592): pid file /opt/seafile/pids/seafevents.pid does not exist
[05/01/19 08:55:16] seafile-controller.c(623): seafevents need restart…
[05/01/19 08:55:16] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
[05/01/19 08:55:16] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 26691
[05/01/19 08:55:26] seafile-controller.c(592): pid file /opt/seafile/pids/seafevents.pid does not exist
[05/01/19 08:55:26] seafile-controller.c(623): seafevents need restart…
[05/01/19 08:55:26] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
[05/01/19 08:55:26] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 26703
[05/01/19 08:55:36] seafile-controller.c(592): pid file /opt/seafile/pids/seafevents.pid does not exist
[05/01/19 08:55:36] seafile-controller.c(623): seafevents need restart…
[05/01/19 08:55:36] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m seafevents.main --config-file /opt/seafile/conf/seafevents.conf --logfile /opt/seafile/logs/seafevents.log -P /opt/seafile/pids/seafevents.pid
[05/01/19 08:55:36] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 26715

Stopping services and creating the file manually (empty - and with the correct owner) the controll log goes:

[05/01/19 08:49:33] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[05/01/19 08:49:33] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success
[05/01/19 08:49:43] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[05/01/19 08:49:43] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success
[05/01/19 08:49:53] seafile-controller.c(132): bad pidfile format: /opt/seafile/pids/seafevents.pid
[05/01/19 08:49:53] seafile-controller.c(595): failed to read pidfile /opt/seafile/pids/seafevents.pid: Success

I think the second scenario is understandable. The process should create the file, and if the file is there, then it can not read it. The first scenario is the one I have troubles with. Why is the file not created? The directory, the config and the log files all seems to have the correct ownership (as suggested by uosseafile).

I found an unresolved entry at github about exactly that. But it’s old and there was no conclusion:

So in your case, seafevents repeatedly crashes too. But there are too many different reasons for it:

  1. You enabled a feature but seafevents failed to load a Python library for that feature.
  2. Seafevents failed to connect to database/redis.

It is better to remove/disable features in seafevents.conf using a minimum configuration. If a minimum config can work. You then add back features.

3 Likes

Thanks for the brilliant suggestion daniel.pan. This feels like progress.

It is indeed [EVENTS PUBLISH] that triggers the symptom. When that is false, there are no messages, and the .pid file is created.

Redis seems to be up, and auth seems to be working:

[~]# redis-cli -h 127.0.0.1 -a password -p 6379 ping
PONG

What else can I check in this context? How do I check if the process can actually write to redis?

You need to install redis python client library as in the document.

1 Like

Thank you daniel.pan. That resolved the issue.

It took me a while to figure out which package to install: ‘python2-redis.noarch’

This is not listed in your documentation, but I guess, that if you are more of a redis guru than I am, then you should have known.

After installing ‘python2-redis.noarch’, the .pid file is created by the process, and there are no ‘Bad pidfile’ messages in the log.

Thanks again

2 Likes

what command you used to install python2-redis.noarch on ubuntu ?

I did not install it on ubuntu. i installed it on CentOS with:
‘yum install python2-redis’

I hope it helps.

i have python 2 install and redis too.

i can get result pong if i run “redis-cli -h 127.0.0.1 -a password -p 6379 ping”

and for “redis-server --version” i get following output
Redis server v=3.0.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=7785291a3d2152db

Also my main issue is i’m not able to open any doc file after upgrading from 6.3 to 7.0.14. PDF and image files open as before but doc file is not opening