Problem with Linux seafile-client ("Can't connect to daemon")

Hello everybody!

I’m using seafile (6.2.5) on a Linux server for a few months now. Everything was working without problems all the time. But today my server crashed and I had to reboot it. Before rebooting I also did a system upgrade (Ubuntu).Now the linux command line client does not work anymore.

This is the situation:

  • seafile-server and seahub are up and running.
  • I can use the webinterface to access seahub (http://myserver:8000)
  • On a Windows box I have installed the seafile-GUI-client. It is connected to the server. Files are synchronized without problem.

When I try to use seaf-cli (on the same linux box the server is running on) I get the following exception:

    $ seaf-cli list-remote -s http://myserver:8000 -u myuser -p mypassword
    Traceback (most recent call last):
      File "/usr/bin/seaf-cli", line 845, in <module>
        main()
      File "/usr/bin/seaf-cli", line 841, in main
        args.func(args)
      File "/usr/bin/seaf-cli", line 365, in seaf_list_remote
        token = get_token(url, username, password, conf_dir)
      File "/usr/bin/seaf-cli", line 222, in get_token
        device_id = get_peer_id(conf_dir)
      File "/usr/bin/seaf-cli", line 217, in get_peer_id
        info = ccnet_rpc.get_session_info()
      File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 110, in newfunc
        ret_str = self.call_remote_func_sync(fcall_str)
      File "/usr/lib/python2.7/dist-packages/ccnet/rpc.py", line 71, in call_remote_func_sync
        client = self.pool.get_client()
      File "/usr/lib/python2.7/dist-packages/ccnet/pool.py", line 29, in get_client
        client = self._create_client()
      File "/usr/lib/python2.7/dist-packages/ccnet/pool.py", line 21, in _create_client
        client.connect_daemon()
      File "/usr/lib/python2.7/dist-packages/ccnet/client.py", line 128, in connect_daemon
        return self.connect_daemon_with_pipe()
      File "/usr/lib/python2.7/dist-packages/ccnet/client.py", line 110, in connect_daemon_with_pipe
        raise NetworkError("Can't connect to daemon")
    ccnet.errors.NetworkError: Can't connect to daemon

What can I do to solve this?

tfa

What caused the server crash?

I don’t know the exact reason. A partition remounted as readonly. I had to do a fsck which solved a few problems.

It’s possible that you have a failing hard drive. Did you run a surface scan on it, or just a file system scan? Also, did you run seaf-fsck on the repositories after the crash, or did you just run fsck on the hard disk… Or both?

I’ve just run seaf-fsck. No problems found. I did not test the hard drive itself, just the FS.

I would try testing the hard drive as well before continuing. A partition remounting as read only is strange behavior. It’s possible that some dependencies were damaged, but the repo itself is ok.

OK. I tested the HDD with Smartmontools. No warnings were detected. Then I checked the Linux installation with debsums. Also everything is ok here.
Is there a way to figure out why the client can’t connect to daemon?

What I’ll do is take a look at the Python script to see if I can see anything apparent. The error it is raising is a network error, which is unusual considering you can connect and sync. I’ll check and see what the code is trying to do that throws that error.

I dug into the code. It’s failing when it tries to use ccnet.sock to establish the connection via a 64 bit pipe. Check to make certain that ccnet.sock exists, that it has permissions for the user you are running it as, and check the contents of that file.

Thank you for your advice.I found “ccnet.sock” as a named socked in /srv/seafile/ccnet.
The socket has full access rights for user “seafile”. If I call “seaf-cli status” under this user, I still get the error.

seafile@lando:/srv/seafile/ccnet$ ll
total 20
drwx------ 3 seafile seafile 4096 Apr  4 17:59 ./
drwxr-xr-x 9 seafile seafile 4096 Apr  3 19:13 ../
srwx------ 1 seafile seafile    0 Apr  4 17:59 ccnet.sock=
drwxr-xr-x 2 seafile seafile 4096 Mar  4 14:06 misc/
-rw-rw-r-- 1 seafile seafile 1675 Mar  4 13:59 mykey.peer
-rw-rw-r-- 1 seafile seafile   25 Mar  4 13:59 seafile.ini
seafile@lando:/srv/seafile/ccnet$ seaf-cli status
Traceback (most recent call last):
  File "/usr/bin/seaf-cli", line 845, in <module>
    main()
  File "/usr/bin/seaf-cli", line 841, in main
    args.func(args)
  File "/usr/bin/seaf-cli", line 642, in seaf_status
    tasks = seafile_rpc.get_clone_tasks()
  File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 110, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/usr/lib/python2.7/dist-packages/ccnet/rpc.py", line 71, in call_remote_func_sync
    client = self.pool.get_client()
  File "/usr/lib/python2.7/dist-packages/ccnet/pool.py", line 29, in get_client
    client = self._create_client()
  File "/usr/lib/python2.7/dist-packages/ccnet/pool.py", line 21, in _create_client
    client.connect_daemon()
  File "/usr/lib/python2.7/dist-packages/ccnet/client.py", line 128, in connect_daemon
    return self.connect_daemon_with_pipe()
  File "/usr/lib/python2.7/dist-packages/ccnet/client.py", line 110, in connect_daemon_with_pipe
    raise NetworkError("Can't connect to daemon")
ccnet.errors.NetworkError: Can't connect to daemon
seafile@lando:/srv/seafile/ccnet$

When you first installed the Seafile client, you created a settings folder for it. In the manual, it suggests “seafile-client”. Can you take a look at that folder and see what files are in there, and post any config files here? The fact that you can’t even run a status with seaf-cli tells me that it’s either pointing to the wrong folder, or a depency is missing.

Thank you for help. I think I know what happend. After installing seafile under my normal user I created a new “seafile”-user for running the server. This was probably wrong. When I find the time I will reinstall the whole thing from scratch.

1 Like