deja-dup cannot start a backup

  • Done
  • quality assurance status badge
Details
2 participants
  • Efraim Flashner
  • Vivien Kraus
Owner
unassigned
Submitted by
Vivien Kraus
Severity
normal
V
V
Vivien Kraus wrote on 11 Oct 2021 02:18
(address . bug-guix@gnu.org)
972e7ff5cd1202adc30350515fb777fbdb38037b.camel@planete-kraus.eu
Dear guix,

After configuring deja-dup for either SSH storage or local file
storage, I try to start the backup, but I get a popup saying:

BackendException: Could not initialize backend: No module named 'gi'

To me, it looks like a python error, but I could not find any
substantial amount of python code in deja-dup, and I could not find any
python file importing gi in the duplicity package.

Best regards,

Vivien
V
V
Vivien Kraus wrote on 14 Oct 2021 18:43
Re: bug#51127: Acknowledgement (deja-dup cannot start a backup)
(address . 51127@debbugs.gnu.org)
357e17f6cfd3ba3199a2925178815843d67190bd.camel@planete-kraus.eu
So, I figured out the Gio backends for duplicity need a few tweaks.

You can test it by creating a stupid backup (backup any dir in /tmp).
Now it works :)

What do you think?

Vivien
From 429fdb8003a0f39a23749d15c02e2bfca9e96f15 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:30:09 +0200
Subject: [PATCH 3/3] gnu: deja-dup: let deja-dup find duplicity

* gnome.scm (deja-dup): wrap deja-dup to set PATH
---
gnu/packages/gnome.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 17fb2e0146..1adb22773e 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1773,7 +1773,14 @@ (define-public deja-dup
(lambda _
(substitute* "data/post-install.sh"
(("gtk-update-icon-cache") "true"))
- #t)))))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Add duplicity to the search path
+ (wrap-program (string-append (assoc-ref outputs "out")
+ "/bin/deja-dup")
+ `("PATH" ":" prefix
+ (,(format #f "~a/bin" (assoc-ref inputs "duplicity"))))))))))
(inputs
`(("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
("duplicity" ,duplicity)
--
2.33.0
From 6e8a3455fc6d1a65debcf0b9c7e83d8832ce9671 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 18:18:56 +0200
Subject: [PATCH 2/3] gnu: duplicity: depend on dbus

* gnu/packages/backup.scm (duplicity): add dbus ad an input
---
gnu/packages/backup.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 407f6b7212..d1a718eab3 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -119,6 +119,7 @@ (define-public duplicity
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
+ ("dbus" ,dbus) ; dbus-launch (Gio backend)
("gnupg" ,gnupg) ; gpg executable needed
("util-linux" ,util-linux))) ; for setsid
(arguments
@@ -130,7 +131,11 @@ (define-public duplicity
(substitute* "duplicity/gpginterface.py"
(("self.call = u'gpg'")
(string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
-
+ (substitute* "duplicity/backends/giobackend.py"
+ (("subprocess.Popen\\(\\[u'dbus-launch'\\]")
+ (string-append "subprocess.Popen([u'"
+ (assoc-ref inputs "dbus")
+ "/bin/dbus-launch']")))
(substitute* '("testing/functional/__init__.py"
"testing/overrides/bin/lftp")
(("/bin/sh") (which "sh")))
--
2.33.0
From 14576b7216b7810168dcda328048417bbb9fa9cd Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:18:29 +0200
Subject: [PATCH 1/3] gnu: duplicity: depend on pygobject

* gnu/packages/backup.scm (duplicity): add missing input.
---
gnu/packages/backup.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index a3f98c95f9..407f6b7212 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -114,7 +114,8 @@ (define-public duplicity
("mock" ,python-mock)))
(propagated-inputs
`(("lockfile" ,python-lockfile)
- ("urllib3" ,python-urllib3)))
+ ("urllib3" ,python-urllib3)
+ ("pygobject" ,python-pygobject)))
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
--
2.33.0
V
V
Vivien Kraus wrote on 14 Oct 2021 18:56
(address . 51127@debbugs.gnu.org)
72e09b06e67e51fd8a7df050e19af8fafce15ff0.camel@planete-kraus.eu
Le jeudi 14 octobre 2021 à 18:43 +0200, Vivien Kraus a écrit :
Toggle quote (5 lines)
> So, I figured out the Gio backends for duplicity need a few tweaks.
>
> You can test it by creating a stupid backup (backup any dir in /tmp).
> Now it works :)

Sorry, I forgot to run guix lint, and it said that I needed bash-
minimal as an input for wrapped programs.

Toggle quote (3 lines)
> What do you think?
>
> Vivien
From 5eb63be36f0173eb5b177e57dcf11616c01d8a07 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:30:09 +0200
Subject: [PATCH 3/3] gnu: deja-dup: let deja-dup find duplicity

* gnome.scm (deja-dup): wrap deja-dup to set PATH
---
gnu/packages/gnome.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 17fb2e0146..a0af7b3777 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1773,7 +1773,14 @@ (define-public deja-dup
(lambda _
(substitute* "data/post-install.sh"
(("gtk-update-icon-cache") "true"))
- #t)))))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Add duplicity to the search path
+ (wrap-program (string-append (assoc-ref outputs "out")
+ "/bin/deja-dup")
+ `("PATH" ":" prefix
+ (,(format #f "~a/bin" (assoc-ref inputs "duplicity"))))))))))
(inputs
`(("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
("duplicity" ,duplicity)
@@ -1785,7 +1792,8 @@ (define-public deja-dup
("libgpg-error" ,libgpg-error)
("libsecret" ,libsecret)
("libsoup" ,libsoup)
- ("packagekit" ,packagekit)))
+ ("packagekit" ,packagekit)
+ ("bash-minimal" ,bash-minimal)))
(native-inputs
`(("appstream-glib" ,appstream-glib)
("desktop-file-utils" ,desktop-file-utils)
--
2.33.0
From 6e8a3455fc6d1a65debcf0b9c7e83d8832ce9671 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 18:18:56 +0200
Subject: [PATCH 2/3] gnu: duplicity: depend on dbus

* gnu/packages/backup.scm (duplicity): add dbus ad an input
---
gnu/packages/backup.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 407f6b7212..d1a718eab3 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -119,6 +119,7 @@ (define-public duplicity
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
+ ("dbus" ,dbus) ; dbus-launch (Gio backend)
("gnupg" ,gnupg) ; gpg executable needed
("util-linux" ,util-linux))) ; for setsid
(arguments
@@ -130,7 +131,11 @@ (define-public duplicity
(substitute* "duplicity/gpginterface.py"
(("self.call = u'gpg'")
(string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
-
+ (substitute* "duplicity/backends/giobackend.py"
+ (("subprocess.Popen\\(\\[u'dbus-launch'\\]")
+ (string-append "subprocess.Popen([u'"
+ (assoc-ref inputs "dbus")
+ "/bin/dbus-launch']")))
(substitute* '("testing/functional/__init__.py"
"testing/overrides/bin/lftp")
(("/bin/sh") (which "sh")))
--
2.33.0
From 14576b7216b7810168dcda328048417bbb9fa9cd Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:18:29 +0200
Subject: [PATCH 1/3] gnu: duplicity: depend on pygobject

* gnu/packages/backup.scm (duplicity): add missing input.
---
gnu/packages/backup.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index a3f98c95f9..407f6b7212 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -114,7 +114,8 @@ (define-public duplicity
("mock" ,python-mock)))
(propagated-inputs
`(("lockfile" ,python-lockfile)
- ("urllib3" ,python-urllib3)))
+ ("urllib3" ,python-urllib3)
+ ("pygobject" ,python-pygobject)))
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
--
2.33.0
V
V
Vivien Kraus wrote on 16 Oct 2021 18:12
(address . 51127@debbugs.gnu.org)
982f417393bdf1d46a14c14f926472cfbcefdc70.camel@planete-kraus.eu
Le jeudi 14 octobre 2021 à 18:56 +0200, Vivien Kraus a écrit :
Toggle quote (7 lines)
> Le jeudi 14 octobre 2021 à 18:43 +0200, Vivien Kraus a écrit :
> > So, I figured out the Gio backends for duplicity need a few tweaks.
> >
> > You can test it by creating a stupid backup (backup any dir in
> > /tmp).
> > Now it works :)

And now with cooler ChangeLog commit messages!
Toggle quote (4 lines)
>
> > What do you think?
> >
> > Vivien
From 39d4726859760ae84f2c82d6d3f811ed092bd373 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:30:09 +0200
Subject: [PATCH 3/3] gnu: deja-dup: let deja-dup find duplicity

* gnome.scm (deja-dup)[phases]:
Wrap deja-dup to include duplicity in PATH.
---
gnu/packages/gnome.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 20c0be8d9d..3a3219f07a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1773,7 +1773,14 @@ (define-public deja-dup
(lambda _
(substitute* "data/post-install.sh"
(("gtk-update-icon-cache") "true"))
- #t)))))
+ #t))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Add duplicity to the search path
+ (wrap-program (string-append (assoc-ref outputs "out")
+ "/bin/deja-dup")
+ `("PATH" ":" prefix
+ (,(format #f "~a/bin" (assoc-ref inputs "duplicity"))))))))))
(inputs
`(("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
("duplicity" ,duplicity)
--
2.33.1
From c7325a5dfbc56e76e92017cb93914a8ed4545c35 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 18:18:56 +0200
Subject: [PATCH 2/3] gnu: duplicity: depend on dbus

* gnu/packages/backup.scm (duplicity)[inputs]:
Add dbus as an input.

* gnu/packages/backup.scm (duplicity)[phases]:
Substitute the dbus-launch program name.
---
gnu/packages/backup.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 407f6b7212..d1a718eab3 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -119,6 +119,7 @@ (define-public duplicity
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
+ ("dbus" ,dbus) ; dbus-launch (Gio backend)
("gnupg" ,gnupg) ; gpg executable needed
("util-linux" ,util-linux))) ; for setsid
(arguments
@@ -130,7 +131,11 @@ (define-public duplicity
(substitute* "duplicity/gpginterface.py"
(("self.call = u'gpg'")
(string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
-
+ (substitute* "duplicity/backends/giobackend.py"
+ (("subprocess.Popen\\(\\[u'dbus-launch'\\]")
+ (string-append "subprocess.Popen([u'"
+ (assoc-ref inputs "dbus")
+ "/bin/dbus-launch']")))
(substitute* '("testing/functional/__init__.py"
"testing/overrides/bin/lftp")
(("/bin/sh") (which "sh")))
--
2.33.1
From ecaf5368c3d82045d500e0fdb4f1ee45dfbcf185 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Thu, 14 Oct 2021 17:18:29 +0200
Subject: [PATCH 1/3] gnu: duplicity: depend on pygobject

* gnu/packages/backup.scm (duplicity)[propagated-inputs]:
Add missing input.
---
gnu/packages/backup.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index a3f98c95f9..407f6b7212 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -114,7 +114,8 @@ (define-public duplicity
("mock" ,python-mock)))
(propagated-inputs
`(("lockfile" ,python-lockfile)
- ("urllib3" ,python-urllib3)))
+ ("urllib3" ,python-urllib3)
+ ("pygobject" ,python-pygobject)))
(inputs
`(("librsync" ,librsync)
("lftp" ,lftp)
--
2.33.1
E
E
Efraim Flashner wrote on 17 Oct 2021 20:54
(name . Vivien Kraus)(address . vivien@planete-kraus.eu)(address . 51127-done@debbugs.gnu.org)
YWxxTJFoDzy9IBDH@3900XT
Thanks! Patches pushed.

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmFscUwACgkQQarn3Mo9
g1HELA/+LhHU56EDvGqrBCgKDJmTPs5Z/9XcPDCmTbi7mwpVkxJmcHK81X+6kAkH
HG1lRJd+laDrof7XoSrnSzu+pItBSuVIe9Wtf1I9DNd7lHXm85WkqtyM/m5X7MXW
+QlEby7NXMFnF4m1VQjz1bEI9PXhVvoUrT7/ttdkNAOtjrgccS1LTLFzk1K3BnV8
Svq7X/4sP7e+yO3xUc6F5fEU2zTXfGUoPFDpGFhWih9VnIKB75WIqXoySZh/cz+d
E6lZmHHlmGW0zFpl0q3NG3wdO5IzRxlni+7FUvzGxjUfU5SYUjnS7KdkzuV+7oOa
TTNqhPR8Sj61Lrvoa3OcnUFmujk6DocdvnIpvPNUtVF3Ysnusq/A10OHKCQBy6jw
5lzjA1ezZN2wElX2d2QsDjO9OHhJ22EF9G8KIfkYVDtrhrWuYEQXZGYKYB7yYWy1
bPgKb3AmCRKWqsgZFnz/z29fEzXaHodz9nvkW5B+cEvL35d7R8MDU/1qQPtrqxtU
IJGH129JTkFWFbeADSlr6WeSRdUltxPIT0xX3MkzRY5SSqjU45Q7Yk5VBKb7uM5F
nW8Dz9G2akxOfVwCeyQ0er6M+k5m2iUXiMDDkg3eOb51R4sj5Op9uax81+PKt/O+
ODc/Pch5T4W3bOynA4PbRGk3d7DvETe5DtROVtz1mPNM4M1oT4Y=
=h9JQ
-----END PGP SIGNATURE-----


Closed
?