Backport-Request: Failure in Duply's pre-scripts are muted

Bug #1163905 reported by Kurt Huwig
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
duply (Ubuntu)
Triaged
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

duply does not check the return status of pre and post scripts and therefore returns 0 even if there was a problem in the pre/post scripts which returned an error.

This issue happens every time and is 100% reproducible

SRU Justification:
[Impact]

 * When using duply, errors on pre/post scripts are not caught and therefore succeed even if there were problems.

[Test Case]

 * Set up duply
 * Create a pre script containing simply 'exit 1' inside it.
 * Run 'duply srv pre'
 * See duply succeed and return 0

--- Start running command PRE at 12:58:29.630 ---
Running '/root/.duply/srv/pre' - FAILED (code 1)
--- Finished state OK at 12:58:29.638 - Runtime 00:00:00.008 ---
root@nas:~# echo $?
0

with the patch:

--- Start running command PRE at 13:02:03.643 ---
Running '/root/.duply/srv/pre' - FAILED (code 1)
13:02:03.652 Task 'PRE' failed with exit code '1'.
--- Finished state FAILED 'code 1' at 13:02:03.652 - Runtime 00:00:00.009 ---
root@nas:~# echo $?
1

[Regression Potential]

 * The patch is minimal and has been accepted/committed upstream.
 * This package has been tested on a virtual machine with the test case above and showed the right exit value. Minimal likelihood of regressions.

----
Status:

 * Patch is the same as:
 * http://sourceforge.net/tracker/index.php?func=detail&aid=3609075&group_id=217745&atid=1041147

Revision history for this message
Kurt Huwig (k-huwig-f) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Backport of the upstream fix" 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
Changed in duply (Ubuntu):
importance: Undecided → High
status: New → Triaged
Eduardo Damato (edamato)
description: updated
Changed in duply (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Eduardo Damato (edamato) wrote :
Revision history for this message
Eduardo Damato (edamato) wrote :
Revision history for this message
Michael Terry (mterry) wrote :

I uploaded your precise debdiff to Ubuntu. Now we wait for the SRU team to approve it. I didn't bother uploading the raring one, because we're in Final Freeze right now. In S, we can presumably just update to the next version of duply. I'll unsubscribe sponsors.

I had to make a few changes to your patch, Eduardo, that you might want to know about for future SRUs:
 * The convention for SRU versions is to use a minor number. So instead of -1ubuntu1, use -1ubuntu0.1
 * You should always make sure to mention the bug number in debian/changelog
 * When making the first Ubuntu edit to a Debian package, make sure to run 'update-maintainer' in the source tree
 * Your patch added the "return" line in the wrong spot

no longer affects: duply (Ubuntu Raring)
Revision history for this message
Michael Terry (mterry) wrote :

(That said, thanks so much for the patch! I didn't mean to sound unappreciative.)

Eduardo Damato (edamato)
description: updated
Revision history for this message
Eduardo Damato (edamato) wrote :

Thanks for the feedback. Helps me learn how to do it right :-)

how about this patch?

Revision history for this message
Brian Murray (brian-murray) wrote :

Eduardo the convention is to have the bug number at the end of the changelog:

diff -Nru duply-1.5.5.4/debian/changelog duply-1.5.5.4/debian/changelog
--- duply-1.5.5.4/debian/changelog 2011-10-18 07:42:30.000000000 +0000
+++ duply-1.5.5.4/debian/changelog 2013-04-22 16:22:35.000000000 +0000
@@ -1,3 +1,9 @@
+duply (1.5.5.4-1ubuntu0.1) precise; urgency=low
+
+ * Backport of pre/post script return code fix (LP: #1163905)
+
+ -- Eduardo Damato <email address hidden> Mon, 15 Apr 2013 13:34:59 +0000
+
 duply (1.5.5.4-1) unstable; urgency=medium

   * New upstream release.

Changed in duply (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Kurt, or anyone else affected,

Accepted duply into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/duply/1.5.5.4-1ubuntu0.1 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!

Revision history for this message
Eduardo Damato (edamato) wrote :

Verification done. Exit code is correct now.

root@precise:~/.duply/srv# duply srv pre
Start duply v1.5.5.4, time is 2013-05-22 13:10:25.
Using profile '/root/.duply/srv'.
Using installed duplicity version 0.6.18, python 2.7.3, gpg 1.4.11 (Home: ~/.gnupg), awk 'GNU Awk 3.1.8', bash '4.2.24(1)-release (x86_64-pc-linux-gnu)'.
Autoset found secret key of first GPG_KEY entry 'A0C57B6D' for signing.
Test - Encrypt to A0C57B6D & Sign with A0C57B6D (OK)
Test - Decrypt (OK)
Test - Compare (OK)
Cleanup - Delete '/tmp/duply.24091.1369228225_*'(OK)

--- Start running command PRE at 13:10:25.668 ---
Running '/root/.duply/srv/pre' - FAILED (code 1)
13:10:25.683 Task 'PRE' failed with exit code '1'.
--- Finished state FAILED 'code 1' at 13:10:25.683 - Runtime 00:00:00.014 ---
root@precise:~/.duply/srv# echo $?
1

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update 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 duply - 1.5.5.4-1ubuntu0.1

---------------
duply (1.5.5.4-1ubuntu0.1) precise; urgency=low

  * Backport of pre/post script return code fix (LP: #1163905)
 -- Eduardo Damato <email address hidden> Mon, 15 Apr 2013 13:34:59 +0000

Changed in duply (Ubuntu Precise):
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.