havardgulldahl / jottalib

A library to access files stored at jottacloud.com.
GNU General Public License v3.0
83 stars 19 forks source link

NotImplementedError using duplicity backend #123

Open georg90 opened 8 years ago

georg90 commented 8 years ago

I recently moved my server to a new machine. While the backup on my old system is running just fine (jottalib 0.4.2.1, duplicity 7.06, ubuntu14.04) on the new server with jottalib 0.5.1 and duplicity 7.06 (ubuntu 16.04) I'm getting NotImplementedErrors when starting a backup.

I compiled duplicity by myself using the backend.py from here https://raw.githubusercontent.com/havardgulldahl/jottalib/master/src/duplicity-backen5d.py

Any ideas why it's not working? Any good log files I can check?

As I was reading here this problem occurs using the 0.5.1 version, but why? Isn't this a jottalib issue if it's working fine with the older version?

How can install an older jottalib version - I keep gettig this error:

root@aries:/tmp/duplicity-0.7.06# pip install 'jottalib==0.4.2.post1'
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 448, in _prepare_file
    req_to_install, finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 387, in _check_skip_installed
    req_to_install.check_if_exists()
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 1011, in check_if_exists
    self.req.project_name
AttributeError: 'Requirement' object has no attribute 'project_name'
havardgulldahl commented 8 years ago

Hey @georg90, are you able to show us some logs of the error? Is there a backtrace?

georg90 commented 8 years ago

If you can tell me where the log files go? There is no output in syslog..

havardgulldahl commented 8 years ago

We need to see what error message duplicity spits out. Take a screen shot of your terminal with the duplicity message, for instance.

havardgulldahl commented 8 years ago

And run duplicity with the option -v4 to get more info. If that is not enough to show the cause of the NotImplementedError error message use -v9 to get everything from the debug log.

see http://duplicity.nongnu.org/duplicity.1.html

georg90 commented 8 years ago
[...]
Import von duplicity.backends.jottabackend Succeeded
[...]
Traceback (innermost last):
  File "/usr/local/lib/python2.7/dist-packages/duplicity/backend.py", line 369, in inner_retry
    return fn(self, *args)
  File "/usr/local/lib/python2.7/dist-packages/duplicity/backend.py", line 573, in list
    raise NotImplementedError()
 NotImplementedError
georg90 commented 8 years ago

I copied my /usr/local/lib/python2.7/dist-packages/duplicity/ folder from my old machine and now it's syncing.

But this isn't a fix..

havardgulldahl commented 8 years ago

OK. That explains it pretty well. Please upload your old files that work, along with the version of duplicity that you are running.

Pastebin and gist are good options for where to put the files

Edit: I see you've already told us your duplicity version. I guess duplicty plugins changed their format some time, and we need to write a plugin that works across all duplicity versions.

havardgulldahl commented 8 years ago

Can you please try with the amended https://raw.githubusercontent.com/havardgulldahl/jottalib/master/src/duplicity-backend.py

Thanks!

georg90 commented 8 years ago

Hi! For a couple days now Jottalib + Duplicity doesn't work anymore. I get an

--- Start running command BKP at 09:46:40.218 ---
UnsupportedBackendScheme: scheme not supported in url: jottacloud://owncloud_backup
09:46:40.609 Task 'BKP' failed with exit code '23'.

I used the file you provided above, doesn't change. Still using the same versions of duplicity & duply + ubuntu 16.04

georg90 commented 8 years ago

Error rising when using the backend:

Temporäres Verzeichnis /tmp/duplicity-KER6Wd-tempdir wird benutzt
Benutzerfehlerdetail: Traceback (most recent call last):
  File "/usr/local/bin/duplicity", line 1546, in <module>
    with_tempdir(main)
  File "/usr/local/bin/duplicity", line 1540, in with_tempdir
    fn()
  File "/usr/local/bin/duplicity", line 1375, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1116, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1005, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 204, in get_backend_object
    raise UnsupportedBackendScheme(url_string)
UnsupportedBackendScheme: scheme not supported in url: jottacloud://Test_Folder

UnsupportedBackendScheme: scheme not supported in url: jottacloud://Test_Folder
georg90 commented 8 years ago

Found the issue:

Duplicity is looking in the /usr/lib path, but if you compile duplicity manually, it adds the compiled files to /usr/local/lib..

A simple

ln -s /usr/local/lib/python2.7/dist-packages/duplicity/backends/jottabackend.py /usr/lib/python2.7/dist-packages/duplicity/backends/jottabackend.py

ln -s /usr/local/lib/python2.7/dist-packages/duplicity/backends/jottabackend.pyc /usr/lib/python2.7/dist-packages/duplicity/backends/jottabackend.pyc

fixes this.

How can this be avoided?