Seafile Linux Client not syncing / downloading

I, i try to use seafile-cli (Linux) on 6.2.13 pro

I get this error when downloading or syncing libraries

 cd /opt/seafile-client/
root@cchum-epcc-client:/opt/seafile-client# seaf-cli download -l 303fb938-e9a9-41ce-8f3f-981286ddcf8a -s https://seafile.domain.fr -d /tmp/lib -u user@domain.fr -p XYZ
Starting to download ...
Library 303fb938-e9a9-41ce-8f3f-981286ddcf8a will be downloaded to /tmp/lib
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 459, in seaf_download
    email, random_key, enc_version, more_info)
  File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 112, in newfunc
    return fret(ret_str)
  File "/usr/lib/python2.7/dist-packages/pysearpc/client.py", line 25, in _fret_string
    raise SearpcError(dicts['err_msg'])
pysearpc.common.SearpcError: Argument can't be NULL

But i can create libraries.

Could you have a look, @daniel.pan ?

Regards

Currently, we can’t reproduce the problem. Does the problem occur to any library?

Can you provide us with more information in the following way:

Get token

$ curl -d “username=username&password=123456ServerAddr/api2/auth-token/

You will get:{"token":"**24fd3c026886e3121b2ca630805ed425c272cb96**"}

Get library download information

$ curl -H ‘Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96’ -H ‘Accept: application/json; indent=4’ ServerAddr/api2/repos/{repo-id}/download-info/

      {
                "repo_size": 702474,
                "repo_size_formatted":
                "magic": "",
                "encrypted": "",
                ...
                ...
                }  

Can you paste the file download information from your server?

HI,

i tried that on two different servers (same config)

I get

bash: ServerAddr/api2/auth-token/: No file
curl: no URL specified!

I’m quite sure the ServerAddr url (https://mysserver.domain.fr) is good (it is used by seahub)

Is there any potential conflict between these two Apache rules ?

#WCGI
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
  ProxyPass / http://127.0.0.1:8000/
  ProxyPassReverse / http://127.0.0.1:8000/

#API
  <Location /api2>
        AuthType None
        Require all granted
        Allow from all
        satisfy any
  </Location>

Regards

Can you try to remove the config for api2?

I did and rebooted Apache

It has no effet on the linux client

curl -d “username=seafile@seafile.fr&password=pwd” https://test.seafile.fr/api2/auth-token
bash: https://test.seafile.fr/api2/auth-token: File ot found
curl: no URL specified!

Your quotes look weird in the output you are providing.

Please ensure you are using normal double quotes (the key to the left of Enter on a normal U.S. keyboard) and not copying/pasting from your browser into your terminal window. Your curl error has nothing to do with Seafile, curl itself is telling you your syntax is wrong.

Thanks :zipper_mouth_face:

I just pasted what was provided (typographic quotes)

I now use simple quotes as

curl -d "username=seafile@seafile.fr&password=pwd" https://test.seafile.fr/api2/auth-token

Seafile CLi stil gets an error Argument cant’ be NULL

But there is some output from CURL (following your advices in formatting the template provided by @sunyuzhao)

curl -H "Authorization: Token *****7b616dfff102a4975374fe329a308eddfa8" -H "Accept: application/json; indent=4" https://server.seafile.fr/api2/repos/***fb938-e9a9-41ce-8f3f-981286ddcf8a/download-info/

{
    "repo_size": 48736994,
    "repo_size_formatted": "46,5\u00a0Mo",
    "repo_id": "***fb938-e9a9-41ce-8f3f-981286ddcf8a",
    "magic": "",
    "encrypted": "",
    "repo_desc": "_Charte",
    "random_key": "",
    "relay_id": "***36de218c810cd4ad6cc7cfe2ad675e2b0eaa1",
    "enc_version": 0,
    "mtime_relative": "<time datetime=\"2018-03-26T10:13:54\" is=\"relative-time\" title=\"lun, 26 Mar 2018 10:13:54 +0000\" >2018-03-26</time>",
    "relay_addr": null,
    "token": "*****2eef857b9d446c8d30dcbff700cf4932ad6",
    "repo_version": 1,
    "head_commit_id": "***9803d0d145f18793cf8cf55b6533f4e8f5bbc",
    "relay_port": 10001,
    "mtime": 1522059234,
    "email": "user@seafile.fr",
    "repo_name": "_Charte"
}

Please provide the full output with the argument can’t be null error.

You will find it on top

Hi,

@sunyuzhao @daniel.pan, do you have any explanation about this bug ?

Regards,

Gautier

We can’t reproduce the problem on our server. Can you send me a test account to check on your server?

I’ve send you a test account. You can create a library and try to use seaf-cli (Debian 9 in our case).
Regards

Hi @gauburtin ,

The CLI client is not updated yet. So you still need to set SERVICE_URL in ccnet.conf to make the client work.

We will check whether we can update the CLI code to remove the dependency on the relay_address field.

Hi,

Thanks to your advice,

I have set in cc_net.conf

SERVICE_URL = https://* 

The https:// was missing…

The committing process for 1tb files began but hangs :

I get this error on seafile.log

[05/29/18 11:06:55] repo-mgr.c(2599): Adding remaining files for .
[05/29/18 11:07:03] sync-mgr.c(739): Repo 'BB - Archives' sync state transition from 'committing' to 'uploading'.
[05/29/18 11:07:03] http-tx-mgr.c(1153): Transfer repo '11adbb4f': ('normal', 'init') --> ('normal', 'check')
[05/29/18 11:07:03] Couldn't prepare query, error:1->'no such table: Certs'
        SELECT cert FROM Certs;
[05/29/18 11:07:03] http-tx-mgr.c(1153): Transfer repo '11adbb4f': ('normal', 'check') --> ('normal', 'commit')
[05/29/18 11:07:03] http-tx-mgr.c(1153): Transfer repo '11adbb4f': ('normal', 'commit') --> ('normal', 'fs')
[05/29/18 11:07:03] http-tx-mgr.c(1153): Transfer repo '11adbb4f': ('normal', 'fs') --> ('normal', 'data')
[05/29/18 11:07:03] Couldn't prepare query, error:1->'no such table: Certs'
        SELECT cert FROM Certs;
[05/29/18 11:07:03] Couldn't prepare query, error:1->'no such table: Certs'
        SELECT cert FROM Certs;
[05/29/18 11:07:03] Couldn't prepare query, error:1->'no such table: Certs'
        SELECT cert FROM Certs;
[05/29/18 11:07:03] Couldn't prepare query, error:1->'no such table: Certs'
        SELECT cert FROM Certs;

I also have many errors like this one :

[05/29/18 10:05:48] wt-monitor-linux.c(539): [wt mon] fail to add watch to /nfs/bacula/biblissima/files/Pool/#recycle/Exports_BAM/exports_20160926/departement_manuscrits/arabe_cote/Département des manuscrits/Arabe/@eaDir/FRBNFEAD000089880.xml: No space left on device.

And also related to non assci characters

[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_1965-02-16.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_1965-02-16_1.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_1965-02-16_2.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_ԅ۶.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_ԅ۶_1.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_ԅ۶_2.ZIP contains non-UTF8 characters, skip.
[05/29/18 10:05:51] repo-mgr.c(1161): File name ԅ۶_ԅ۶_3.ZIP contains non-UTF8 characters, skip.

Can i hope to sync all these files without losing data ?
Should i use the import feature instead ?

I can send you the entire log by mail.

Regards,

This error message is not related.

Can you check the storage usage on the machine? Normally for small files, files are uploaded in 100MB chunks, so there should not be much cache storage used. For a large file, it need to be indexed and broke into small blocks, and you need to have extra storage to cache the whole file.

For those files, you have to correct the encoding, both syncing client and seaf-import can’t handle them.

Hi Daniel,

Where do I have to check the storage usage : on the server or on the client ?

On the client, in which you run the CLI client.

I’m quite sure i had sufficient disk space on the client.

During the sync process, i did :

df -h (60% free space)

Do i have to check any particular volume or folder.

The total of files is 1Tb.

Please check the home folder of the user that running the client.

In /home/user/.ccnet/seafile.ini

/opt/seafile-client/seafile-data/

Then

ls -lsh /opt/seafile-client/seafile-data/

total 108K
4,0K -rw-r--r-- 1 root root 3,0K mai   30 10:52 branch.db
   0 -rw-r--r-- 1 root root    0 mai   29 09:54 certs.db
 16K -rw-r--r-- 1 root root  13K mai   29 10:05 clone.db
4,0K drwxr-xr-x 2 root root 4,0K mai   16 10:29 commits
4,0K -rw-r--r-- 1 root root 3,0K mai   30 10:50 config.db
4,0K drwxr-xr-x 5 root root 4,0K mai   16 10:29 deleted_store
8,0K -rw-r--r-- 1 root root 5,0K mai   16 10:29 filelocks.db
4,0K drwxr-xr-x 2 root root 4,0K mai   16 10:29 fs
4,0K drwxr-xr-x 2 root root 4,0K mai   30 10:52 index
 48K -rw-r--r-- 1 root root  43K mai   30 10:52 repo.db
4,0K drwxr-xr-x 5 root root 4,0K mai   16 10:29 storage
4,0K drwxr-xr-x 2 root root 4,0K mai   30 10:48 tmpfiles
4,0K -rw-r--r-- 1 root root 3,0K mai   16 10:29 transfer.db

There is sufficient space on / (60% free space)

I also have thousands of errors

[05/30/18 10:57:14] repo-mgr.c(5942): Failed to open dir /nfs/bacula/biblissima/files/backups/.logs: Error opening directory '/nfs/bacula/biblissima/files/backups/.logs': Too many open files.

I had to stop the sync

I also have errors related to files that does not exist in the folder

[05/30/18 10:52:20] repo-mgr.c(1420): Failed to stat /nfs/bacula/biblissima/files/Pool/cubicweb-mandragore/data/maquettes_html/plugins mirador/app-bundle.js: No such file or directory.

ls -lsh  /nfs/bacula/biblissima/files/Pool/cubicweb-mandragore/data/maquettes_html/

   0 drwxr-sr--   5 root root  256 nov.   2  2016 plugins mirador

The folder is empty.
Why SEAF-CLI is looking for a file in an empty folder :thinking: ?