util.ignore_missing() does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
High
|
Unassigned | ||
duplicity (Ubuntu) |
Fix Released
|
High
|
Michael Terry | ||
Precise |
Fix Released
|
High
|
Louis Bouchard | ||
Quantal |
Fix Released
|
High
|
Louis Bouchard | ||
Raring |
Fix Released
|
High
|
Louis Bouchard |
Bug Description
SRU justification :
Without this fix, there is a potential for crash during execution of duplicity
Impact :
Renders duplicity potentially unusable dues to spurious crashes
Fix :
Backport upstream fix for this problem merged in
https:/
Test Case :
A session must be run within the python debugger to systematically reproduce the context.
1) Run a duplicity session as outlined in comment #8 inside the debugger
2) break at duplicity/path:568 instead of 567
3) When the program breaks, manually remove the file that ends in "...manifest.gpg"
4) continue execution
Without the fix, duplicity will crash with the outlined backtrace. With the fix, duplicity will terminate normally.
Regression :
Minimal as the modification changes exception handling only for a function only used twice to delete files/directories (path.py & tempdir.py)
Description of the problem :
Duplicity can potentially crash while attempting to delete a file that no longer exists.
Original description
duplicity version: 0.6.18-0ubuntu3
python version: 2.7.3
Distro: ubuntu precise 12.04
target file system: ftp
I happen to encounter failed backups with tracebacks like this:
Traceback (most recent call last):
File "/usr/bin/
with_
File "/usr/bin/
fn()
File "/usr/bin/
full_
File "/usr/bin/
sig_
File "/usr/lib/
globals.
File "/usr/lib/
source_
File "/usr/lib/
util.
File "/usr/lib/
fn(filename)
OSError: [Errno 2] No such file or directory: '/BACKUP/
Now running test code like
#!/usr/bin/env python
#
# Do what util.ignore_
# fails to achieve
import os
import sys
import errno
if __name__ == "__main__":
try:
except Exception:
# "type" is a reserved keyword, replaced with "mytype"
if isinstance(mytype, OSError) and value[0] == errno.ENOENT:
will always raise the exception and not ignore it, because isinstance(mytype, OSError) is always False.
What I expect ignore_missing to look like is:
def ignore_missing(fn, filename):
"""
Execute fn on filename. Ignore ENOENT errors, otherwise raise exception.
@param fn: callable
@param filename: string
"""
try:
except OSError, ex:
if ex.errno == errno.ENOENT:
pass
else:
raise
else:
raise
Related branches
- duplicity-team: Pending requested
-
Diff: 17 lines (+4/-5)1 file modifiedduplicity/util.py (+4/-5)
Changed in duplicity: | |
status: | New → In Progress |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
affects: | duplicity → duplicity (Ubuntu) |
Changed in duplicity (Ubuntu): | |
importance: | Undecided → High |
Changed in duplicity (Ubuntu Precise): | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
Changed in duplicity (Ubuntu Quantal): | |
status: | New → Triaged |
Changed in duplicity (Ubuntu Raring): | |
status: | New → Triaged |
Changed in duplicity: | |
status: | New → Confirmed |
Changed in duplicity (Ubuntu): | |
status: | In Progress → Triaged |
Changed in duplicity (Ubuntu Precise): | |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
Changed in duplicity (Ubuntu Quantal): | |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
Changed in duplicity (Ubuntu Raring): | |
assignee: | nobody → Louis Bouchard (louis-bouchard) |
Changed in duplicity (Ubuntu Precise): | |
importance: | Undecided → High |
Changed in duplicity (Ubuntu Quantal): | |
importance: | Undecided → High |
Changed in duplicity (Ubuntu Raring): | |
importance: | Undecided → High |
Changed in duplicity (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | Louis Bouchard (louis-bouchard) → Michael Terry (mterry) |
Changed in duplicity: | |
milestone: | none → 0.6.23 |
importance: | Undecided → Medium |
status: | Confirmed → Fix Committed |
importance: | Medium → High |
Changed in duplicity (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in duplicity (Ubuntu Quantal): | |
status: | Triaged → In Progress |
Changed in duplicity (Ubuntu Raring): | |
status: | Triaged → In Progress |
tags: |
added: verification-done removed: verification-needed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Added patch