Command line client problem when adding library

Hello,

I managed to install command line client to Ubuntu 14.04.5 LTS and started it. But when trying to add library I get following error. What can be the problem, is it due to using https ? I tried client also on debian and got same error. Also tried other server using https.

$ seaf-cli sync -l "my_lib" -s "https://server:port" -d "folder" -u "user"
Enter password for user :
Traceback (most recent call last):
  File "/usr/bin/seaf-cli", line 832, in <module>
    main()
  File "/usr/bin/seaf-cli", line 828, in main
    args.func(args)
  File "/usr/bin/seaf-cli", line 533, in seaf_sync
    tmp = get_repo_download_info("%s/api2/repos/%s/download-info/" % (url, repo), token)
  File "/usr/bin/seaf-cli", line 232, in get_repo_download_info
    repo_info = urlopen(url, headers=headers)
  File "/usr/bin/seaf-cli", line 198, in urlopen
    resp = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: NOT FOUND

When giving wrong password the last line of the error is
“urllib2.HTTPError: HTTP Error 400: BAD REQUEST”

With wrong server address the error is
“urllib2.URLError: urlopen error [Errno 111] Connection refused”

You say that you are trying to “add” a library, but you are using the “sync” command.
Did you first create the library?
seaf-cli create -s seahub-server-url -n library-name -u username -p password -t description [-e library-password]

Thanks, your suggestion lead to fixing the problem. I didn’t realize the difference between library ID and name and was trying to put the name. After creating new library I got the ID, and with it I could download/sync. So far I only found one way to find the library ID is by listing libraries with cli-client.

1 Like