mega and duplicity

Bug #1394386 reported by spider0
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Error:

--- Start running command BKP at 23:32:10.507 ---
Reading globbing filelist /home/xbmc/.duply/xbmc/exclude
Attempt 1 failed: AttributeError: 'Mega' object has no attribute 'get_name_from_file'
Attempt 2 failed: AttributeError: 'Mega' object has no attribute 'get_name_from_file'
Attempt 3 failed: AttributeError: 'Mega' object has no attribute 'get_name_from_file'
Attempt 4 failed: AttributeError: 'Mega' object has no attribute 'get_name_from_file'
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1494, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1488, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1337, in main
    do_backup(action)
  File "/usr/bin/duplicity", line 1366, in do_backup
    sync_archive(decrypt)
  File "/usr/bin/duplicity", line 1099, in sync_archive
    remlist = globals.backend.list()
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 430, in list
    return map(tobytes, self._list())
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 331, in iterate
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/megabackend.py", line 115, in _list
    % (self.__get_node_name(self.folder), str(e)), raise_errors)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/megabackend.py", line 139, in __get_node_name
    return self.client.get_name_from_file({handle:files[handle]})
AttributeError: 'Mega' object has no attribute 'get_name_from_file'

Revision history for this message
spider0 (spider0) wrote :

I used duply.sh with duppicity and mega. When i run first full backup all working ok. But next backup incremental have a this error.

Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) wrote :

I can confirm this.

duplicity 0.7.01

mega.py==0.9.18

Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) wrote :

Also mega.py contains note:

Mega.py is now deprecated, please use the official SDK https://github.com/meganz/sdk2.

Revision history for this message
Lalo Martins (lalo.martins) wrote :

The backend should probably be rewritten to use the official SDK. Should we rename this bug, or write a new one which would then block this?

Revision history for this message
Tomas Vondra (tomas-v) wrote :

I've been trying duplicity for personal backups, and realized I have a Mega account that I'm not using. But I ran into exactly this issue :-(

The mega.py library is deprecated and thus unlikely to get fixed, and I didn't feel like writing a new client from scratch on top of the new Mega SDK. But there are existing clients/tools, like for example megatools (https://megatools.megous.com/), which seems to be well maintained and working.

After a bit of hacking (first time I looked into duplicity), I've been able to switch the Mega backend to megatools, and it seems to be working like a charm so far. I'm sure there are things to fix, but is calling command-line tools from the backend acceptable design? It's certainly better than the current broken backend, I guess.

How do I contribute to the project on launchpad.net? I'm not very familiar how that works on bzr/launchpad.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

For now, just attach your megabackend.py to this bug report and that should be all we need.

See below for "Add attachment or patch" button.

Revision history for this message
Tomas Vondra (tomas-v) wrote :

Attached is the hackish version of Mega backend.

There are a few rough edges (e.g. _makedir_recursive should be more careful and _put should not print errors that the remote file does not exist).

I'm not sure what to do with the copyright notices at the beginning - as the backend is pretty much a new implementation unrelated to both gdocs and the old megabackend code, I suppose the old notices should be removed replaced with a new one.

Revision history for this message
Tomas Vondra (tomas-v) wrote :

Another thing I should probably point out is that the backend now falls back to .megarc if the credentials are not specified in the target directly. That was a bit of an experiment to get rid of the credentials from the command line (so that it's not visible in 'top' for example).

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.7.12
Changed in duplicity:
milestone: 0.7.12 → 0.7.13
Changed in duplicity:
milestone: 0.7.13 → 0.7.14
Changed in duplicity:
milestone: 0.7.13.1 → 0.7.14
Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
status: New → In Progress
Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: In Progress → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
Revision history for this message
edso (ed.so) wrote :

Tomas,

could you please check the manpage, especially section REQUIREMENTS

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

and send an updated version or just state what needs to be updated and where in the manpage?

Ken: you forgot the manpage adjustments again! ;)

thanks.. ede/duply.net

Changed in duplicity:
status: Fix Released → Incomplete
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 1394386] Re: mega and duplicity

Will get a patch out soon.

On Wed, Sep 6, 2017 at 5:42 AM, edso <email address hidden> wrote:

> Tomas,
>
> could you please check the manpage, especially section REQUIREMENTS
>
> http://duplicity.nongnu.org/duplicity.1.html
>
> and send an updated version or just state what needs to be updated and
> where in the manpage?
>
> Ken: you forgot the manpage adjustments again! ;)
>
> thanks.. ede/duply.net
>
> ** Changed in: duplicity
> Status: Fix Released => Incomplete
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1394386
>
> Title:
> mega and duplicity
>
> Status in Duplicity:
> Incomplete
>
> Bug description:
> Error:
>
> --- Start running command BKP at 23:32:10.507 ---
> Reading globbing filelist /home/xbmc/.duply/xbmc/exclude
> Attempt 1 failed: AttributeError: 'Mega' object has no attribute
> 'get_name_from_file'
> Attempt 2 failed: AttributeError: 'Mega' object has no attribute
> 'get_name_from_file'
> Attempt 3 failed: AttributeError: 'Mega' object has no attribute
> 'get_name_from_file'
> Attempt 4 failed: AttributeError: 'Mega' object has no attribute
> 'get_name_from_file'
> Traceback (most recent call last):
> File "/usr/bin/duplicity", line 1494, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1488, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1337, in main
> do_backup(action)
> File "/usr/bin/duplicity", line 1366, in do_backup
> sync_archive(decrypt)
> File "/usr/bin/duplicity", line 1099, in sync_archive
> remlist = globals.backend.list()
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 430, in list
> return map(tobytes, self._list())
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 331, in iterate
> return fn(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/duplicity/backends/megabackend.py",
> line 115, in _list
> % (self.__get_node_name(self.folder), str(e)), raise_errors)
> File "/usr/lib/python2.7/dist-packages/duplicity/backends/megabackend.py",
> line 139, in __get_node_name
> return self.client.get_name_from_file({handle:files[handle]})
> AttributeError: 'Mega' object has no attribute 'get_name_from_file'
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1394386/+subscriptions
>

Changed in duplicity:
status: Incomplete → In Progress
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I've attached a patch to fix the command line issue and the man requirements.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I've attached a patch to fix the command line issue and the man requirements.

Changed in duplicity:
status: In Progress → Fix Committed
milestone: 0.7.14 → 0.7.15
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.