Swift backend fails on string concatenation

Bug #1848166 reported by Colin Darie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

This is the same kind of bug as https://bugs.launchpad.net/duplicity/+bug/1843995 but with Swift backend.

Duplicity 0.8.05
Python 3.7.4
MacOS Mojave 10.14.6

$ duplicity -v9 --name debug-concatenate ./Astronomie swift:///tmp/backup-test
Utilisation du répertoire d’archive : /Users/colin/.cache/duplicity/debug-concatenate
Utilisation du nom de sauvegarde : debug-concatenate
Le binaire GPG est gpg, version (2, 2, 17)
Importation de duplicity.backends.adbackend Succeeded
Importation de duplicity.backends.azurebackend Succeeded
Importation de duplicity.backends.b2backend Succeeded
Importation de duplicity.backends.botobackend Succeeded
Importation de duplicity.backends.cfbackend Succeeded
Importation de duplicity.backends.dpbxbackend Succeeded
Importation de duplicity.backends.gdocsbackend Succeeded
Importation de duplicity.backends.giobackend Succeeded
Importation de duplicity.backends.hsibackend Succeeded
Importation de duplicity.backends.hubicbackend Succeeded
Importation de duplicity.backends.imapbackend Succeeded
Importation de duplicity.backends.jottacloudbackend Succeeded
Importation de duplicity.backends.lftpbackend Succeeded
Importation de duplicity.backends.localbackend Succeeded
Importation de duplicity.backends.mediafirebackend Succeeded
Importation de duplicity.backends.megabackend Succeeded
Importation de duplicity.backends.multibackend Succeeded
Importation de duplicity.backends.ncftpbackend Succeeded
Importation de duplicity.backends.onedrivebackend Succeeded
Importation de duplicity.backends.par2backend Succeeded
Importation de duplicity.backends.pcabackend Succeeded
Importation de duplicity.backends.pydrivebackend Succeeded
Importation de duplicity.backends.rsyncbackend Succeeded
Importation de duplicity.backends.ssh_paramiko_backend Succeeded
Importation de duplicity.backends.ssh_pexpect_backend Succeeded
Importation de duplicity.backends.swiftbackend Succeeded
Importation de duplicity.backends.sxbackend Succeeded
Importation de duplicity.backends.tahoebackend Succeeded
Importation de duplicity.backends.webdavbackend Succeeded
Action principale : inc
Acquiring lockfile b'/Users/colin/.cache/duplicity/debug-concatenate/lockfile'
================================================================================
duplicity $version ($reldate)
Args: /usr/local/bin/duplicity -v9 --name debug-concatenate ./Astronomie swift:///tmp/backup-test
Darwin MacBook-Pro-de-Colin.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64 i386
/usr/local/Cellar/duplicity/0.8.05_1/libexec/bin/python 3.7.4 (default, Sep 7 2019, 18:27:02)
[Clang 10.0.1 (clang-1001.0.46.4)]
================================================================================
Utilisation du dossier temporaire /var/folders/wj/x4c3pyns3gn1t8zjxptmz0l40000gn/T/duplicity-f1kgvb5c-tempdir
Enregistrement (mkstemp) du fichier temporaire /var/folders/wj/x4c3pyns3gn1t8zjxptmz0l40000gn/T/duplicity-f1kgvb5c-tempdir/mkstemp-vvd88d12-1
Il y a 29382950912 d’espace temporaire disponible, la sauvegarde va nécessiter environ 272629760.
0 fichier existe sur le serveur central
1 fichier existe dans le cache
Extraction des chaînes de sauvegarde depuis la liste des fichiers : []
Les métadonnées locales et distantes sont déjà synchronisées. Aucune synchronisation nécessaire.
Date de la dernière sauvegarde complète : aucune
État de la collection
-----------------
Connexion au serveur central : BackendWrapper
Dossier d’archive : /Users/colin/.cache/duplicity/debug-concatenate

0 chaîne secondaire de sauvegarde a été trouvée.
Aucune chaîne de sauvegarde avec les signatures actives n’a été trouvée
Aucun jeu orphelin ou incomplet de sauvegarde n’a été trouvé.
Aucune signature de sauvegarde trouvée, bascule vers une sauvegarde complète.
Utilisation du dossier temporaire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-_kaq_ynl-tempdir
Enregistrement (mktemp) du fichier temporaire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-_kaq_ynl-tempdir/mktemp-8yay6x3p-1
Utilisation du dossier temporaire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-xa33p62g-tempdir
Enregistrement (mktemp) du fichier temporaire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-xa33p62g-tempdir/mktemp-m0qxz2cf-1
AsyncScheduler: instanciation au niveau de concurrence 0
Enregistrement (mktemp) du fichier temporaire /var/folders/wj/x4c3pyns3gn1t8zjxptmz0l40000gn/T/duplicity-f1kgvb5c-tempdir/mktemp-pjkt84k3-2
Sélection Astronomie
Comparaison de . et None
Obtention du delta de (. dir) et None
A .
Selection: examining path Astronomie/Observations.md
Selection: + no selection functions found. Including
Sélection Astronomie/Observations.md
Comparaison de Observations.md et None
Obtention du delta de (Observations.md reg) et None
A Observations.md
Suppression du fichier temporaire toujours en mémoire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-_kaq_ynl-tempdir/mktemp-8yay6x3p-1
Suppression du fichier temporaire toujours en mémoire /Users/colin/.cache/duplicity/debug-concatenate/duplicity-xa33p62g-tempdir/mktemp-m0qxz2cf-1
AsyncScheduler: exécution synchronisée de la tâche (asynchronisme désactivé)
Écriture de duplicity-full.20191015T092616Z.vol1.difftar.gpg
Trace inverse de l'erreur précédente : Traceback (innermost last):
  File "/usr/local/Cellar/duplicity/0.8.05_1/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/local/Cellar/duplicity/0.8.05_1/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 531, in put
    self.__do_put(source_path, remote_filename)
  File "/usr/local/Cellar/duplicity/0.8.05_1/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 517, in __do_put
    self.backend._put(source_path, remote_filename)
  File "/usr/local/Cellar/duplicity/0.8.05_1/libexec/lib/python3.7/site-packages/duplicity/backends/swiftbackend.py", line 148, in _put
    self.conn.put_object(self.container, self.prefix + remote_filename,
 TypeError: can only concatenate str (not "bytes") to str

La tentative 1 a échoué. TypeError :can only concatenate str (not "bytes") to str

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

Please pull this fix and test it if you can.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.06
status: New → Fix Committed
Revision history for this message
Colin Darie (colinux) wrote :

The string concatenation itself seems to be fixed, however I have this error a few steps later :

Note : in my test I just updated the swiftclient.py file with the content of your patch https://bazaar.launchpad.net/~duplicity-team/duplicity/0.8-series/revision/1485

$ duplicity -v9 --name debug-concatenate ./Astronomie swift:///tmp/backup-test

[...]

Écriture de duplicity-full.20191028T114710Z.vol1.difftar.gpg

Trace inverse de l'erreur précédente : Traceback (innermost last):
  File "/usr/local/Cellar/duplicity/0.8.05_2/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/local/Cellar/duplicity/0.8.05_2/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 531, in put
    self.__do_put(source_path, remote_filename)
  File "/usr/local/Cellar/duplicity/0.8.05_2/libexec/lib/python3.7/site-packages/duplicity/backend.py", line 517, in __do_put
    self.backend._put(source_path, remote_filename)
  File "/usr/local/Cellar/duplicity/0.8.05_2/libexec/lib/python3.7/site-packages/duplicity/backends/swiftbackend.py", line 150, in _put
    file(util.fsdecode(source_path.name)))
 NameError: name 'file' is not defined

Here is the _put method defined in swiftclient.py :

def _put(self, source_path, remote_filename):
    self.conn.put_object(self.container,
                         self.prefix + util.fsdecode(remote_filename),
                         file(util.fsdecode(source_path.name)))

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

Fixed in rev 1490.

Revision history for this message
Colin Darie (colinux) wrote :

It's working, thanks !

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.