Backup fails with message: 'Failed to execute child process "duplicity" (No such file or directory)' or 'No module named gi.repository': missing deja-dup-backend-gvfs, duplicity, and/or python-gi packages

Bug #1641423 reported by Steve
82
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Déjà Dup
Fix Released
High
Unassigned
deja-dup (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Ubantu 16.04

Cant find out version of backup but it was loaded with distro 16.04 and all software is up to date so it should be latest

I dont know how to get the information
 in 3 & 4

from the error maessage:
Failed to execute child process "duplicity" (No such file or directory)
It looks like a required file is missing

I tried removing backup and reinstalling but it still fails with the same error

Tags: xenial yakkety
Revision history for this message
Vej (vej) wrote :

Hello Steve,

Déjà Dup relies on duplicity, as a backend.
It seems to me that duplicity might not be installed on your Ubuntu. Can you provide the output of "dpkg -l deja-dup duplicity" from a terminal to check this?

Best Regards

Vej

Disclaimer: I'm just a user like you and neither a developer nor maintainer of Déjà Dup.

Vej (vej)
Changed in deja-dup:
status: New → Incomplete
Revision history for this message
Steve (steve.123) wrote :

Thanks for your help Vej
I have managed to install duplicity and the problem has gone away (at least for now)

Vej (vej)
Changed in deja-dup:
status: Incomplete → Triaged
importance: Undecided → High
Revision history for this message
Vej (vej) wrote :

I could verify this on a fresh virtual machine with Ubuntu 16.04.1.

See following excerpt from apt-cache show deja-dup shows that we do not depend on duplicity
Package: deja-dup
Priority: optional
[...]
Version: 34.2-0ubuntu1
Depends: libatk1.0-0 (>= 1.12.4), libc6 (>= 2.4), libdbusmenu-glib4 (>= 0.4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.37.3), libgtk-3-0 (>= 3.16.2), libnautilus-extension1a (>= 1:2.91), libnotify4 (>= 0.7.0), libpackagekit-glib2-16 (>= 0.8.10), libpango-1.0-0 (>= 1.14.0), libpeas-1.0-0 (>= 1.0.0), libsecret-1-0 (>= 0.7), libunity-control-center1 (>= 14.04.0), libunity9 (>= 3.4.6), dconf-gsettings-backend | gsettings-backend, adwaita-icon-theme
Recommends: policykit-1
Suggests: deja-dup-backend-cloudfiles, deja-dup-backend-gvfs, deja-dup-backend-s3, duplicity (>= 0.6.23)

I think duplicity should be a dependency of deja-dup, to make it very hard to install deja-dup without duplicity. I'm still wondering why and when duplicity has been excluded from my installation of 16.04.1-desktop-i386.

Will set to "Critical", because it prevents new users of 16.04 from using the software at all.

Changed in deja-dup:
importance: High → Critical
Revision history for this message
Michael Terry (mterry) wrote :

Hrm. So we intentionally dropped duplicity from the dependency list in order to help drop Python2 from the Ubuntu image. I added code to notice this case and prompt installation of duplicity.

So somehow that code is going awry... I need to test and see if I can see the same behavior.

Revision history for this message
Vej (vej) wrote :

@4 Oh, I see. I directly started via terminal, so I never reached that point.

So here is an in software workaround: Open deja-dup (Backups) and install duplicity by clicking on "Install..."

@Steve did you executed deja-dup via command-line as well or used the graphical interface instead?

I vote for a hint in the error message in case someone installs and executes directly via terminal. Something like >>Failed to execute child process "duplicity" (No such file or directory)
Try "apt install duplicity"<<

Changed in deja-dup:
importance: Critical → High
Revision history for this message
Vej (vej) wrote :

Dropped to High because of existing in-program workaround

Revision history for this message
Steve (steve.123) wrote :

I thought I had managed to install duplicity via the terminal and solved the problem
but I am now getting:

BackendException: Could not initialise backend: No module named gi.repository

when I run the GUI

When I enter
 deja-dup
on the teminal I get

Usage:
  deja-dup [OPTION…]
  deja-dup --backup
  deja-dup --restore [FILES…]
  deja-dup --restore-missing DIRECTORY

Déjà Dup is a simple backup tool. It hides the complexity of backing up
the Right Way (encrypted, off-site, and regular) and uses duplicity as
the backend.

Help Options:
  -h, --help Show help options
  --help-all Show all help options
  --help-gtk Show GTK+ Options

Application Options:
  --version Show version
  --restore Restore given files
  --backup Immediately start a backup
  --restore-missing Restore deleted files
  --display=DISPLAY X display to use

  But anything I try after that (from the terminal) just gives me syntax error messages
eg
deja-dup (backup)
bash: syntax error near unexpected token `backup'

Im very new to linex and I havent used a command line entry sinnce abuot 1982 and then it was on ICL so im struggling a bit. Thanks for your help but I think I will just wait until its fixed.

Revision history for this message
Vej (vej) wrote :

Hello Steve,

can you show the already requested output of "dpkg -l deja-dup duplicity" from the terminal please?

Thanks

Vej

Revision history for this message
Steve (steve.123) wrote :

sry veg
what happens is:

dpkg -l deja-dup duplicity
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii deja-dup 34.2-0ubuntu i386 Back up your files
ii duplicity 0.7.06-2ubun i386 encrypted bandwidth-efficient bac

I have no idea what it means though

Revision history for this message
Vej (vej) wrote :

Hello Steve,

thank you for the output.
It tells us, that deja-dup and duplicity are both installed (ii) and have the right versions.

Next I want to ask you to provide the output of "DEJA_DUP_DEBUG=1 deja-dup --backup | tail -n 1000 > /tmp/deja-dup.log" and "gsettings list-recursively org.gnome.DejaDup > /tmp/deja-dup.gsettings" (point 3 and 4 mentioned by you in the beginning). You can copy and paste them to the terminal and execute by pressing enter. After that you find the files deja-dup.log and deja-dup.gsettings in your temporary folder (/tmp). Please change any incriminating file names or details and upload the files here.

Thanking you in anticipation

Vej

Revision history for this message
Steve (steve.123) wrote :

What happened was

 DEJA_DUP_DEBUG=1 deja-dup --backup | tail -n 1000 > /tmp/deja-dup.log" and "gsettings list-recursively org.gnome.DejaDup > /tmp/deja-dup.gsettings
tail: cannot open 'list-recursively' for reading: No such file or directory
tail: cannot open 'org.gnome.DejaDup' for reading: No such file or directory

The GUI also tried to launch but failed again with the message

BackendException: Could not initialise backend: No module named gi.repository

Revision history for this message
Steve (steve.123) wrote :

Veg
I have managed to find the files you mentioned but they appear to be empty

Revision history for this message
Michael Terry (mterry) wrote :

Try making sure deja-dup-backend-gvfs is installed. That should be installed by the GUI when you first open Deja Dup preferences and click the Install button. But I think Deja Dup is confused in your case.

Revision history for this message
Vej (vej) wrote :

Hello Steve,

please execute one command at a time:

1. Open the Terminal
2. Paste: DEJA_DUP_DEBUG=1 deja-dup --backup | tail -n 1000 > /tmp/deja-dup.log
3. Press Enter
4. Wait for execution to finish
5. Paste: gsettings list-recursively org.gnome.DejaDup > /tmp/deja-dup.gsettings
6. Press Enter again
7. Wait for execution to finish
8. See if the both files in /tmp contain anything

Best

Vej

Revision history for this message
Naël (nathanael-naeri) wrote :

@Steve, Vej:

The "No module named gi.repository" reported by Steve in comments 7 and 11 was found in other bug reports to mean that the package python-gi was not installed. Just like duplicity itself, python-gi can be installed as a dependency of the package deja-dup-backend-gvfs, that Michael mentions in comment 13 is installed when one first opens the GUI (deja-dup-preferences) and clicks the Install button.

Steve, you need to find out if this package deja-dup-backend-gvfs is installed, for instance by entering the following command in a terminal (press enter at the end):

  apt-cache policy deja-dup-backend-gvfs

If it says "Installed: (none)", install it with the following command (again press enter to run):

  sudo apt-get install deja-dup-backend-gvfs

If that doesn't solve your backup troubles, we may find why by inspecting the two files Vej tells you to create in comments 10 and 14.

Revision history for this message
Naël (nathanael-naeri) wrote :

@Michael:

> I added code to notice this case and prompt installation of duplicity

This code was not triggered in my case: I was setting up Déjà-Dup from the command line for a non-privileged user (I'm the privileged user on his machine). The first backup failed with "Failed to execute child process "duplicity" (No such file or directory)", which prompted me to investigate and install deja-dup-backend-gvfs.

Like Vej in comment 5 I vote for a hint in the error message - perhaps a hint that deja-dup-backend-gvfs must be installed? Coming from a previous release of Ubuntu, I really didn't expect this backend package to no longer be installed by default (along with its duplicity dependency) (but I agree dropping python2.7 is important).

Revision history for this message
Steve (steve.123) wrote :

Well it looks like the backend-gvfs mentioned in 16 is installed I get

apt-cache policy deja-dup-backend-gvfs
deja-dup-backend-gvfs:
  Installed: 34.2-0ubuntu1
  Candidate: 34.2-0ubuntu1
  Version table:
 *** 34.2-0ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
        100 /var/lib/dpkg/status

Right now when I run deja-dup it "runs" but it just runs a backup and then closes.
I have no control over the gui at all except to start it running.

Revision history for this message
Vej (vej) wrote :

Hello again.

I just found out, that my productive machine is running deja-dup with the following configuration:

dpkg -l deja-dup duplicity deja-dup-backend-gvfs
[...]
ii deja-dup 34.2-0ubuntu1
un deja-dup-backend-gvfs <none>
ii duplicity 0.7.06-2ubuntu2

Although I clicked the "Install" link in the GUI after setting up the machine and everything works fine on that machine. Maybe we install something different with this link?

Revision history for this message
Naël (nathanael-naeri) wrote :

@Steve:

Great! Unless something went wrong during installation and you were left with half-installed packages or broken dependencies (a rare happenstance that you can rule out with the command "sudo apt-get check" if you wish), then your system has both duplicity and python-gi and things should be running smooth. In particular, the gi.repository python module should be present and you shouldn't have any error about it not being found any longer.

> Right now when I run deja-dup it "runs" but it just runs a backup and
> then closes.

If by "running deja-dup" you mean starting a backup, either by running "deja-dup --backup" on the command line, or by clicking the "Back Up Now" button in the "System Settings > Backup" GUI (that GUI is called deja-dup-preferences and can be called from the command line by running "deja-dup-preferences", incidentally), then what you report is normal operation: the backup is started and its progress window closes automatically at the end if it is successful.

If by "running deja-dup" you mean opening its "System Settings > Backup" GUI (deja-dup-preferences), then you're describing another issue. That GUI is not supposed to close right away when you open it.

> I have no control over the gui at all except to start it running.

Same here: if you mean you can't setup Déjà Dup using its GUI (adding includes and excludes, setting up the backup location and frequency...), then you're describing a different problem. For such an issue I think you should open a new bug report since the current bug report is about missing the duplicity package.

Feel free to attach screenshots of your problem, or the files requested by Vej in comments 10 and 14, with the "Add attachment or patch" link below.

Revision history for this message
Naël (nathanael-naeri) wrote :

@Vej:

This is an unusual setup and I find it difficult to explain. What about python-gi, is it installed?

deja-dup-backend-gvfs should have been installed either as a recommended dependency of deja-dup (prior to deja-dup package version 34.1-1ubuntu3), or on-demand when you click the button in the GUI (starting with deja-dup package version 34.1-1ubuntu3).

Did you perhaps install deja-dup prior to version 34.1-1ubuntu3 without installing its Recommends? Using dpkg or --without-recommends in aptitude or --no-install-recommends in apt-get, perhaps? And then clicked the button in the GUI? That's the only logical explanation I can think of (besides a bug). Or are you using Debian?

Full details below if you want to investigate more.

-----

Looking at Déjà Dup's codebase, it appears that packagekit is used to install duplicity on-demand if it is needed. The code for that was introduced by Déjà Dup's developer in revision 1548 for version 34.1:

  http://bazaar.launchpad.net/~deja-dup-hackers/deja-dup/34/revision/1548

It also appears that duplicity and deja-dup-backend-gvfs are listed as Recommends. But Debian and Ubuntu treat recommended packages as dependencies by default. So duplicity and deja-dup-backend-gvfs should be present from the start in any normal installation, meaning that the code for on-demand installation of duplicity would not be triggered.

That situation is not what we observe, because further modifications have been introduced at packaging time by the maintainers of the deja-dup Debian and Ubuntu packages. Looking at the changes for the Ubuntu source package we learn that:

In revision 46, package version 34.1-0ubuntu1:
duplicity was dropped to a Suggests for deja-dup, to help get python2 off of the default Ubuntu image (suggested packages are not installed by default, contrary to recommended packages)

  http://bazaar.launchpad.net/~ubuntu-desktop/deja-dup/ubuntu/revision/46

In revision 47, package version 34.1-1ubuntu1:
python-gi was added as a Depends for deja-dup-backend-gvfs

  http://bazaar.launchpad.net/~ubuntu-desktop/deja-dup/ubuntu/revision/47

In revision 49, package version 34.1-1ubuntu2:
code was introduced to install python-gi on-demand, and python-gi was therefore dropped to a Suggests for deja-dup-backend-gvfs

  http://bazaar.launchpad.net/~ubuntu-desktop/deja-dup/ubuntu/revision/49

In revision 50, package version 34.1-1ubuntu3:
code was modified to install deja-dup-backend-gvfs on-demand instead of python-gi, which was therefore upgraded back to a Depends for deja-dup-backend-gvfs, which in turn was dropped from a Recommends to a Suggests for deja-dup (also it was changed to depend on duplicity too)

  http://bazaar.launchpad.net/~ubuntu-desktop/deja-dup/ubuntu/revision/50

See also changelog on http://packages.ubuntu.com/source/xenial/deja-dup

This is how we end up today with Déjà Dup's codebase including code for on-demand install of duplicity and Déjà Dup's Ubuntu package including code for on-demand install of deja-dup-backend-gvfs, which depends on duplicity and python-gi.

Revision history for this message
Vej (vej) wrote :

@Nathanael

Thanks for your comment. I did not installed anything myself regarding Deja Dup. I made a fresh installation and clicked the Button in the GUI. Although I kept the old Home partition from 14.04. So it might be a problem related to this? Although the setup there is working so that is not the problem.

Regarding the problem: I made an installation of 14.04 (on hardware not inside of a virtual machine), set up a backup on an external hard drive, installed 16.04 while keeping the home partition and found out, that a backup is triggered by plugging in the hard drive, which results in the mentioned error. So it is *not* necessary, to use the command line to trigger this.

We (or better Michael) should add the check to the code, which triggers the Backup, if the location comes available. I do not figured out, which location this is, because I am busy with bug #918489.

Best

Vej

Revision history for this message
Naël (nathanael-naeri) wrote :

@Vej:

Thanks for the precisions. I still can't figure out how you ended up with duplicity installed and deja-dup-backend-gvfs not installed, this should not have happened, judging from my understanding of the code and of the situation you report. And a 16.04 install overwriting a 14.04 install doesn't change anything about that.

As for a backup starting when you plug in your hard drive on your 16.04 system, that is normal: the configuration for that backup was saved in the dconf database in your $HOME when you were using 14.04, and you preserved /home.

And as for that backup resulting in a "Failed to execute child process "duplicity" (No such file or directory)" error, that again was normal: your fresh 16.06 system did not include duplicity since its version of Déjà Dup was 34.1+. As you report, opening deja-dup-preferences (the GUI) and clicking the appropriate button solved that issue.

What is not normal is Déjà Dup even trying to start a backup when duplicity is not present, instead of prompting the user to open deja-dup-preferences and request the installation of the missing software.

Revision history for this message
Johannah Sprinz (neothethird) wrote :

Had the same issue on a plain install of 16.10 today. Simply installing duplicity fixed it.

Revision history for this message
Vej (vej) wrote :

Marked downstream project as affected, because of duplicates.

Changed in deja-dup (Ubuntu):
status: New → Confirmed
Vej (vej)
tags: added: xenial
Changed in deja-dup (Ubuntu):
importance: Undecided → High
Vej (vej)
tags: added: yakkety
Revision history for this message
Barry Martin (barry-martin-3-c) wrote :

What corrected for me was Seth's post in https://bugs.launchpad.net/deja-dup/+bug/1606449 of:

    sudo apt install duplicity
    sudo apt install python-gi

Immediately works, though it appeared my system only needed to install duplicity and python-pi was already at the newest version and did not install.

The issue appeared on my laptop; I don't recall an issue with any desktops here. (Don't know if that piece of trivia helps track down the problem source.)

Naël (nathanael-naeri)
summary: - Back up failed with message: Failed to execute child process "duplicity"
- (No such file or directory)
+ Backup fails with message: 'Failed to execute child process "duplicity"
+ (No such file or directory)' or 'No module named gi.repository': missing
+ deja-dup-backend-gvfs, duplicity, and/or python-gi packages
Revision history for this message
Daddy Dave (haile-david) wrote :

Manually installing duplicity worked for me.

   sudo apt-get install duplicity

Revision history for this message
Daddy Dave (haile-david) wrote :

Whoops - forgot to add that I'm using Ubuntu 17.04.

Manually installing duplicity worked for me.

Revision history for this message
Michael Terry (mterry) wrote :

Support for on-demand installation was recently improved. If you trigger a restore or backup before going to the settings Overview page, we'll prompt to install the packages before you can continue.

Changed in deja-dup:
status: Triaged → Fix Released
Changed in deja-dup (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

I installed 17.04 fresh, using an existing user (/home). Backup fails as per this bug. If I launch the GUI, The Overview tells me to click on the Install button, but the two Install buttons are greyed out.

Revision history for this message
Michael Terry (mterry) wrote :

Yeah this was improved in 17.10. This bug still affects 17.04.

As a workaround, run apt install deja-dup-backend-gvfs and this should be fixed for ya.

Revision history for this message
vkapas (vkapas) wrote :

Bug marked is fixing but still reproduced in 16.04 with last updates.

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.