Backup Failed - AttributeError: 'str' object has no attribute 'decode'

Asked by James Carroll on 2020-07-09

Installed and configured deja-dup today with automatic backup of /home/james folder to /home/backup/deja-dup. Recevied the following error:

"Backup Failed"

Failed with an unknown error.

Traceback (innermost last):
  File "/usr/bin/duplicity", line 106, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 92, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1525, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1175, in ProcessCommandLine
    globals.backend = backend.get_backend(args[0])
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 225, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 211, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 82, in __init__
    ensure_dbus()
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 37, in ensure_dbus
    output = p.communicate()[0].decode("utf8", errors="replace")
 AttributeError: 'str' object has no attribute 'decode'

Question information

Language:
English Edit question
Status:
Answered
For:
Déjà Dup Edit question
Assignee:
No assignee Edit question
Last query:
2020-07-09
Last reply:
2020-07-11
Michael Terry (mterry) said : #1

Which version of deja-dup / what distro are you on?

Looks like you're hitting a code path where dbus wasn't available to deja-dup. Which seems... unlikely. It must have gotten very confused.

Does it work when you manually back up?

James Carroll (jcarroll) said : #2

Michael,

Thank you so much for your personal attention to my issue.

$ deja-dup --version
*deja-dup 40.7*

$ uname -a
Linux greenmaple 5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC
2020 x86_64 x86_64 x86_64 GNU/Linux
*Lubuntu 20.04 LTS*

My original attempt was running deja-dup with sudo, and I included the
/home/ directory for each user on the system.

After sending the error message, I tried a new backup configuration,
running deja-dup without sudo, and selecting only the /home/james
directory. It seems to be running fine now, "Scanning... Creating the
first backup. This may take a while."

What is the recommended way to use deja-dup to backup files from multiple
users?

On Thu, Jul 9, 2020 at 4:15 PM Michael Terry <
<email address hidden>> wrote:

> Your question #691764 on Déjà Dup changed:
> https://answers.launchpad.net/deja-dup/+question/691764
>
> Status: Open => Needs information
>
> Michael Terry requested more information:
> Which version of deja-dup / what distro are you on?
>
> Looks like you're hitting a code path where dbus wasn't available to
> deja-dup. Which seems... unlikely. It must have gotten very confused.
>
> Does it work when you manually back up?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/deja-dup/+question/691764
>
> You received this question notification because you asked the question.
>

Michael Terry (mterry) said : #3

Ah yeah. Running as root is not a super supported method, because it's impossible for root to integrate well in your session (can't connect to user dbus session for things like notifications, saved passwords, or user mounts; can't launch as root for automatic backups; etc).

You have two main decent options:
1. Give your user access to all home folders (via a group maybe?)
2. Run duplicity manually as a system cron job, and avoid deja-dup.

Can you help with this problem?

Provide an answer of your own, or ask James Carroll for more information if necessary.

To post a message you must log in.