Failed to start seafile server

Hi there, thanks for your time!
I newly installed seafile on a router running Entware-ng (Entware has seafile-server in its repo). The router is an ARMv7 based Phicomm K3 (BCM4709 Cortex A9 1.4GHz, 512M RAM). The installation finished smoothly and I setup seafile-server according to its guide (I tried both the default port and customized port for the server). But when I was using the script to start the server, the seafile-server reports as follows:

[03/18/18 11:00:38] …/common/session.c(132): using config file /opt/share/seafile/conf/ccnet.conf
Starting seafile server, please wait …
Failed to start seafile server

I checked the logs, no much help either (the time tags were not generated at the same try, I purged the logs and started the server again, thus the time tags are much newer in logs. Actually, the message for failure came up quickly, about 10 sec or so):

Seafile logs:
[03/18/18 11:12:49] http-server.c(160): fileserver: worker_threads = 10
[03/18/18 11:12:49] http-server.c(175): fileserver: fixed_block_size = 8388608
[03/18/18 11:12:49] http-server.c(190): fileserver: web_token_expire_time = 3600
[03/18/18 11:12:49] http-server.c(205): fileserver: max_indexing_threads = 1
[03/18/2018 11:12:55 AM] …/common/mq-mgr.c(54): [mq client] mq cilent is started

Controller logs:
[03/18/18 11:12:47] seafile-controller.c(154): starting ccnet-server …
[03/18/18 11:12:47] seafile-controller.c(73): spawn_process: ccnet-server -F /opt/share/seafile/conf -c /opt/share/seafile/ccnet -f /opt/share/seafile/logs/ccnet.log -d -P /opt/var/run/seafile/
[03/18/18 11:12:47] seafile-controller.c(88): spawned ccnet-server, pid 5029
[03/18/18 11:12:48] seafile-controller.c(555): ccnet daemon connected.
[03/18/18 11:12:48] seafile-controller.c(186): starting seaf-server …
[03/18/18 11:12:48] seafile-controller.c(73): spawn_process: seaf-server -F /opt/share/seafile/conf -c /opt/share/seafile/ccnet -d /opt/share/seafile/ss -l /opt/share/seafile/logs/seafile.log -P /opt/var/run/seafile/
[03/18/18 11:12:48] seafile-controller.c(88): spawned seaf-server, pid 5038
[03/18/18 11:12:48] seafile-controller.c(528): seafdav not enabled.

ccnet logs:
[03/18/18 11:12:47] …/common/session.c(132): using config file /opt/share/seafile/conf/ccnet.conf
[03/18/18 11:12:48] …/common/session.c(484): Listen on /opt/share/seafile/ccnet/ccnet.sock for local clients
[03/18/18 11:12:48] …/common/session.c(290): Update pubinfo file
[03/18/18 11:12:48] …/common/session.c(398): Accepted a local client
[03/18/18 11:12:48] …/common/session.c(398): Accepted a local client
[03/18/18 11:12:49] …/common/session.c(398): Accepted a local client
[03/18/18 11:12:49] …/common/session.c(398): Accepted a local client

Hope I can get some useful advice here, thanks very much!

Looking at your logs for 11:12, it appears that seafile server not only started, but also accepted a client. So, is it still not working?

nope, no luck

Did you try to start it manually? If so, what error do you get from the command line? Also, does Seahub start successfully?

The message showed in the top of this post is what I got from starting the server manually (by executing ./ start). And the error messages are:

[03/18/18 11:00:38] …/common/session.c(132): using config file /opt/share/seafile/conf/ccnet.conf
Starting seafile server, please wait …
Failed to start seafile server

I also tried to start seahub, but it warns me that I should start seafile-server first, and reports the missing information of UTF.en-US (or something like that) in ENV.

Ok… Several things here… .It sounds like you are using an Asus router. I also use an Asus router, and I had trouble getting seafile to work on it 3 or 4 years ago. I finally opted to take a 10 year old computer and install Debian on it. Works like a charm.

  • First, Seafile is memory heavy. 512 MB is minimum. What else are you running on that router? You could be in a situation where there isn’t enough memory left to start it.

  • In order for Seafile to run on Entware-ng, swap must be enabled. I don’t remember how to do that, unfortunately. Maybe someone else reading this thread could provide info on how to do it.

  • The odd thing about your logs is it looks like a seafile instance is spawned and even gets a PID. This is leading me to think that it may be a memory issue… Of course, the swap issue could be an issue too.

  • What version of Seafile are you trying to run?

I just checked my installation. I’m on ver 6.2.4, and seaf-server is using 1.1 GB of memory.

Thank you for your fast reply!

I’m running seafile-server 6.2.2. I succesfully enabled swap (I checked it using command free) with the capacity of 512M before running the seafile-server.

I don’t know much about the platform as much as I do about the linux platform, but you can try the “top” command in the terminal and look for “seaf-server” to check if it is indeed running and how much memory it’s consuming. You can also try “free -m” to see how much memory is currently in use and how much free memory you have.

Thank you!

I used “top” to check the thread of “seafile” or something similar to see if the server was running, but it didn’t appear in the list. I checked the memory using “free”, I had only 30M or so free memory left. But I had 512M of free swap left. I guess the seafile server might need large free memory rather than swap?

Even though you have a large swap file, pretty much any program is going to require some free memory in order to operate properly. Also, even with a large swap file, programs can time out if they are trying to run a major portion of their code from a swap file, because swap files are typically slower to run.

I’m going to have to say that your problem is certainly related to lack of memory. With 6.2.4, my seaf-server is using 1.1 GB virtual, 25 MB of physical memory, and 5.2 MB of shared memory.

So, I’m thinking that’s your problem. I’m running Debian 8 with Seafile on a 10 year old computer I had sitting around the house. I have little or no issues with it and it runs solid, 24/7.

Thank you very much! I will try to reduce the memory use of other programs, and enlarge the swap.

Based on the size my 6.2 is taking, you will need more than 1.1 gig of total memory to pull it off. Also, keep in mind, that although the physical memory usage is 25 MB, that’s while it’s idle. It probably requires more physical memory in order to start and also operate correctly.

Also, although I’ve never done it, doing a custom build may help. I’ve also noticed that there is code on Github specifically for Entware-ng, but I think you have to package it yourself. Either way, I still think you’ll need more memory in order to pull it off.

Thank you! I will try to reduce the memory usage by reinstalling a lite-version of the firmware, which would only use no more than 200M memory at starting up. And try to enlarge the swap file to 2 giga. I mainly use seafile for file sync, and am not sensitive to file exchanging performance much.

File exchanging performance is almost always dependent upon network speed and hard drive speed. Internally, my file transfer speeds via wire are usually around 70-80 MB/s (ie, roughly 700-800 Mb/s), which is about the top speed of the hard drive in my seafile server. And that’s on a 10 year old computer. :wink: I’m on a Gigabit network, so my bottleneck happens to be the hard drive in my server.

That sounds great! I want to use the router as a file sync server because it’s always on and won’t consume much more power thus save my electric bill.:wink:

Got ya… Let me know if it works, and then we can post the solution in the original thread. Good luck!

sure! thanks!

Still not working…after adjusting the memory and swap size.

Here’s the information:

run seafile server: /opt/etc/init.d/S66seafile { start | stop | restart }
run seahub server: /opt/etc/init.d/S67seahub { start | stop | restart }

If the server is behind a firewall, remember to open these tcp ports:

port of seafile fileserver: 8082
port of seahub: 8000

When problems occur, refer to

for more information.

[K3 /tmp/media/nand/opt]# free
total used free shared buffers
Mem: 514508 244816 269692 0 19424
Swap: 1048572 0 1048572
Total: 1563080 244816 1318264
[K3 /tmp/media/nand/opt]# /opt/etc/init.d/S66seafile start

[03/19/18 19:51:01] …/common/session.c(132): using config file /opt/share/seafile/conf/ccnet.conf
Starting seafile server, please wait …
Failed to start seafile server

After some work, I found this:

Exact the same problem

Seafile does’nt use much of a swap. Seafile has its own folder called httptemp and tempfiles. My Seafile Intallation needs a bit more 1,2Gib for seaf-server, 0.3Gib for ccnet-server, and some for MariaDB. If you have more than 1 user and you’re using SQLite, you should change to MariaDB/MySQL for less mem usage.