Boto backend removes local cache if connection cannot be made

Bug #1266753 reported by Kurt Huwig
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned
duplicity (Ubuntu)
Fix Released
Medium
Louis Bouchard
Precise
Fix Released
Medium
Louis Bouchard
Quantal
Won't Fix
Medium
Louis Bouchard
Saucy
Fix Released
Medium
Louis Bouchard

Bug Description

N.B. This should not be released until after deja-dup - bug 1281066.

SRU Justification
[Impact]
 * When there is no connection to the S3 backend, the local cache files are deleted.

[Test Case]
 1. disable the connection to S3
 2. run a "collection-status" (basically I run 'duply X status')

[Regression Potential]
 * Already fixed in latest duplicity. Needs to be fixed in lockstep with deja-dup as it Breaks: deja-dup (<< 27.3.1-0ubuntu2 ).

--

When there is no connection to the S3 backend, the local cache files are deleted. To reproduce:

1. disable the connection to S3
2. run a "collection-status" (basically I run 'duply X status')

You'll get a bunch of these:

Deleting local /srv/duply-cache/duply_srv/duplicity-inc.20140106T010002Z.to.20140107T010002Z.manifest (not authoritative at backend).
Deleting local /srv/duply-cache/duply_srv/duplicity-new-signatures.20131211T124323Z.to.20131211T124519Z.sigtar.gz (not authoritative at backend).

This is fatal if you run it in a configuration using GPG and having only the public key for encryption as well as a separate signing key. Then you cannot backup any more, as the decrypted local cache has been deleted and the files on the S3 are encrypted.

Probably reason:

There is no check if the connection to the backend could be established

Workaround:

If you replace at

http://bazaar.launchpad.net/~duplicity-team/duplicity/0.6-series/view/head:/duplicity/backends/_boto_single.py#L270

the line

    return []

with

    return None

Then duplicity will crash instead of deleting the local files. Not the proper solution but at least you can do a backup when the connection comes back up.

Related branches

Revision history for this message
Kurt Huwig (k-huwig-f) wrote :
Louis Bouchard (louis)
Changed in duplicity:
status: New → Confirmed
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in duplicity:
status: Confirmed → Fix Committed
assignee: Louis Bouchard (louis-bouchard) → nobody
Revision history for this message
Kurt Huwig (k-huwig-f) wrote :

"Fix Committed"? Where can I find the fix?

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 1266753] Re: Boto backend removes local cache if connection cannot be made

In the trunk. You can get it with: bzr branch lp:duplicity

On Mon, Jan 13, 2014 at 8:26 AM, Kurt Huwig <email address hidden> wrote:

> "Fix Committed"? Where can I find the fix?
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1266753
>
> Title:
> Boto backend removes local cache if connection cannot be made
>
> Status in Duplicity - Bandwidth Efficient Encrypted Backup:
> Fix Committed
>
> Bug description:
> When there is no connection to the S3 backend, the local cache files
> are deleted. To reproduce:
>
> 1. disable the connection to S3
> 2. run a "collection-status" (basically I run 'duply X status')
>
> You'll get a bunch of these:
>
> Deleting local
> /srv/duply-cache/duply_srv/duplicity-inc.20140106T010002Z.to.20140107T010002Z.manifest
> (not authoritative at backend).
> Deleting local
> /srv/duply-cache/duply_srv/duplicity-new-signatures.20131211T124323Z.to.20131211T124519Z.sigtar.gz
> (not authoritative at backend).
>
> This is fatal if you run it in a configuration using GPG and having
> only the public key for encryption as well as a separate signing key.
> Then you cannot backup any more, as the decrypted local cache has been
> deleted and the files on the S3 are encrypted.
>
> Probably reason:
>
> There is no check if the connection to the backend could be
> established
>
> Workaround:
>
> If you replace at
>
> http://bazaar.launchpad.net/~duplicity-
>
> team/duplicity/0.6-series/view/head:/duplicity/backends/_boto_single.py#L270
>
> the line
>
> return []
>
> with
>
> return None
>
> Then duplicity will crash instead of deleting the local files. Not the
> proper solution but at least you can do a backup when the connection
> comes back up.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1266753/+subscriptions
>

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

Actually, I don't think so Ken. Trunk doesn't seem to have this patch applied. I've filed a branch to apply it.

Changed in duplicity:
status: Fix Committed → In Progress
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Fix was committed in revision 951

Changed in duplicity:
status: In Progress → Fix Committed
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Blasted bzr idiocy. I applied the patch from Kurt, tried to commit, found out I was behind, so I merged in ede's changes. Those were older than the patch I had made, so bzr should have kept them (git would have).

That's the last time. We're swapping to git as soon as possible. bzr is broke!

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

lp:~mterry/duplicity/boto-list-fix merged in 952 to fix bzr idiocy.

Revision history for this message
Louis Bouchard (louis) wrote :

I will do the required SRU to precise

Changed in duplicity (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Louis Bouchard (louis-bouchard)
Chris J Arges (arges)
Changed in duplicity (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Raise an error instead of suppressing connection errors" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Louis Bouchard (louis)
Changed in duplicity (Ubuntu Precise):
status: Triaged → In Progress
Louis Bouchard (louis)
Changed in duplicity (Ubuntu):
status: Triaged → In Progress
Changed in duplicity:
milestone: none → 0.6.23
Changed in duplicity:
importance: Undecided → Medium
Changed in duplicity:
status: Fix Committed → Fix Released
Louis Bouchard (louis)
Changed in duplicity (Ubuntu Quantal):
status: New → In Progress
Changed in duplicity (Ubuntu Saucy):
status: New → In Progress
Changed in duplicity (Ubuntu Quantal):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in duplicity (Ubuntu Saucy):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in duplicity (Ubuntu Quantal):
importance: Undecided → Medium
Changed in duplicity (Ubuntu Saucy):
importance: Undecided → Medium
Revision history for this message
Louis Bouchard (louis) wrote :

The backport of this fix to precise, Raring, Saucy and Trusty has been submitted for SRU with other fixes in LP: #1266763

Chris J Arges (arges)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Kurt, or anyone else affected,

Accepted duplicity into saucy-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/duplicity/0.6.21-0ubuntu4.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in duplicity (Ubuntu Saucy):
status: In Progress → Fix Committed
tags: added: verification-needed
Louis Bouchard (louis)
tags: added: verification-done
removed: verification-needed
tags: added: verification-done-saucy
removed: verification-done
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Kurt, or anyone else affected,

Accepted duplicity into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/duplicity/0.6.18-0ubuntu3.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in duplicity (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Louis Bouchard (louis)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package duplicity - 0.6.18-0ubuntu3.5

---------------
duplicity (0.6.18-0ubuntu3.5) precise; urgency=low

  * debian/patches/14-lp946988-fix-gnupassphrase-error.dpatch
    - Backport upstream modification applied in LP: #946988 that fix
      a failure to resume a backup with "bad passphrase" when the proper
      passphrase is being used.

  * debian/patches/13-lp1266763-add-concurrency-locking.dpatch
    - Implement locking mechanism to avoid concurrent execution under the same
      cache directory. This functionality adds a dependency to python-lockfile
      Fixes LP: #1266763

  * debian/patches/12-lp1266753-exception-if-no-s3.dpatch
    - Add exception handling in the case where no S3 connection is
      available instead of silently deleting the local cache.
      Fixes LP: #1266753
 -- Louis Bouchard <email address hidden> Thu, 23 Jan 2014 10:16:32 +0100

Changed in duplicity (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for duplicity has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package duplicity - 0.6.21-0ubuntu4.2

---------------
duplicity (0.6.21-0ubuntu4.2) saucy; urgency=low

  * debian/patches/05-lp1266763-add-concurrency-locking.dpatch
    - Implement locking mechanism to avoid concurrent execution under the same
      cache directory. This functionality adds a dependency to python-lockfile
      Fixes LP: #1266763

  * debian/patches/04-lp1266753-exception-if-no-s3.dpatch
    - Add exception handling in the case where no S3 connection is
      available instead of silently deleting the local cache.
      Fixes LP: #1266753
 -- Louis Bouchard <email address hidden> Fri, 24 Jan 2014 13:44:06 +0100

Changed in duplicity (Ubuntu Saucy):
status: Fix Committed → Fix Released
Changed in duplicity (Ubuntu):
status: In Progress → Fix Released
Louis Bouchard (louis)
Changed in duplicity (Ubuntu Quantal):
status: In Progress → Won't Fix
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.