Removing old backup chains fails over sftp

Bug #1861287 reported by Imanuel Bertrand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Setup:
duplicity 0.8.04
Python 3.7.5
Ubuntu 19.10, 5.3.0-26-generic

Problem:
Creating backups works fine over sftp (pexpect), removing old chains fails because the filename of the file that is to be deleted is determined incorrectly (as "b'filename'" instead of "filename").
A full log is attached (I aborted the execution after the error occured).

Relevant excerpt (last lines):

#################
Deleting backup chains at times:
Tue Dec 24 10:03:07 2019
Sat Jan 4 03:14:09 2020
Deleting complete signature chain Sat Jan 4 03:14:09 2020
Running 'sftp -oPort=10022 -oServerAliveInterval=15 -oServerAliveCountMax=2 [_USER_]@[_HOST_]'
State = sftp, Before = '[_USER_]@[_HOST_]'s'
State = sftp, Before = 'Connected to [_USER_]@[_HOST_].'
sftp command: 'cd "backup/var/www"'
State = sftp, Before = 'cd "backup/var/www"'
sftp command: 'rm "b'duplicity-new-signatures.20200103T031407Z.to.20200104T031409Z.sigtar.gpg'"'
State = sftp, Before = 'rm "b'duplicity-new-signatures.20200103T031407Z.to.20200104T031409Z.sigtar .gpg'"
Removing /backup/var/www/b'duplicity-new-signatures.20200103T031407Z.to.20200104T031409Z.sigtar.gpg''
Backtrace of previous error: Traceback (innermost last):
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 606, in _do_delete
    self.backend._delete(filename)
  File "/usr/lib/python3/dist-packages/duplicity/backends/ssh_pexpect_backend.py", line 299, in _delete
    self.run_sftp_command(commandline, commands)
  File "/usr/lib/python3/dist-packages/duplicity/backends/ssh_pexpect_backend.py", line 227, in run_sftp_command
    raise BackendException(u"Error running '%s': %s" % (commandline, msg))
 duplicity.errors.BackendException: Error running 'sftp -oPort=10022 -oServerAliveInterval=15 -oServerAliveCountMax=2 [_USER_]@[_HOST_]': Could not delete file in command='sftp -oPort=10022 -oServerAliveInterval=15 -oServerAliveCountMax=2 [_USER_]@[_HOST_]'

Attempt 1 failed. BackendException: Error running 'sftp -oPort=10022 -oServerAliveInterval=15 -oServerAliveCountMax=2 [_USER_]@[_HOST_]': Could not delete file in command='sftp -oPort=10022 -oServerAliveInterval=15 -oServerAliveCountMax=2 [_USER_]@[_HOST_]'
#################

Notice there is a weird character in the filename in the line right before 'Removing'. This character is not visible in the terminal output to me (on Windows, with SSH on Ubuntu in the Linux Subsystem). It is only visible in the log file (which is the output of the script tee'd to a file and then scp'd to local).

Neither user nor host or pass do contain any non-ASCII-characters.

Tags: delete
Revision history for this message
Imanuel Bertrand (desertweasel) wrote :
Changed in duplicity:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: none → 0.8.11
Changed in duplicity:
status: In Progress → Fix Committed
assignee: Kenneth Loafman (kenneth-loafman) → nobody
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.