Backups broken when "ssh_args" are set

Bug #1309710 reported by Steve Beattie
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
rsnapshot (Debian)
Fix Released
Unknown
rsnapshot (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Unassigned

Bug Description

[Impact/Test Case]

In ubuntu 14.04 LTS, rsnapshot 1.3.1-4 is broken when 'ssh_args' are set in the rsnapshot configuration file. For example, I set ssh_args to '-p 22022', which causes my rsnapshot backup to fail with he following error:

  rsync: Failed to exec /usr/bin/ssh -p 22022: No such file or directory (2)
  rsync error: error in IPC code (code 14) at pipe.c(85) [Receiver=3.1.0]

This worked in saucy's 1.3.1-3 rsnapshot; the newer version has changed the way rsync is invoked from rsnapshot, passing an array to perl's system() function (which is not interpreted by a shell before being exec()ed) rather than a constructed single string, which is interpreted by a shell, and thus requires the arguments passed to rsync's -rsh argument to be quoted so as to be gathered into a single argument by the shell.

[Regression Potential]
Fix identified here:
https://github.com/DrHyde/rsnapshot/pull/1

(This was also reported in debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717451)

Revision history for this message
Andreas Olsson (andol) wrote :

Setting as confirmed, based on content of Debian bug.

Changed in rsnapshot (Ubuntu):
status: New → Confirmed
Revision history for this message
Steve Beattie (sbeattie) wrote :

The patch in the debian git tree at http://anonscm.debian.org/gitweb/?p=collab-maint/rsnapshot.git;a=blob;f=debian/patches/14_rsync_rsh_quoting.diff;h=d554a82d556f0bc5f9a4707eda66ebeb4caa48d8;hb=f22cb49a8d76c0856f9a6f66ab17fe436b298f2a solves the issue for me. I've tested ssh with args, ssh without args, and no ssh involved, and rsnapshot functions correctly.

I've uploaded a version of the rsnapshot package for testing to my personal ppa at https://launchpad.net/~sbeattie/+archive/ppa .

Revision history for this message
Steve Beattie (sbeattie) wrote :

Attached is an rsnapshot debdiff for a trusty SRU.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "rsnapshot_1.3.1-4ubuntu1.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

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

tags: added: patch
Changed in rsnapshot (Debian):
status: Unknown → New
Revision history for this message
Andreas Hohenegger (hohenegger) wrote :

I found that the same version ignores excludes from the configuration file like

exclude '/home/[a-z]*/.cache/'

Can this have the same origin or should I create a new report.
The version from https://launchpad.net/~sbeattie/+archive/ppa does not seem to fix it.

Revision history for this message
Steve Beattie (sbeattie) wrote :

Andreas: sorry, that's a different issue, you should create a new bug report for that. Thanks!

Revision history for this message
hede (michael-heide) wrote :

It seems the following is also related:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721043

(I fixed it with reverting that patch)

Revision history for this message
Lupe Christoph (lupe) wrote :

To describe the fix explicitly for impatient people like me:

Change line 3459 in /usr/bin/rsnapshot, remove the two escaped quotes (\"). The result should be this:

push( @rsync_long_args_stack, "--rsh=$config_vars{'cmd_ssh'} $ssh_args" );

Revision history for this message
Nahom Asmelash (reg-launchpad-1) wrote :

We can confirm this!

We came to the same result as Lupe Christoph!

@Lupe you beat us by 19 Hours.

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

Thanks, Steve! I've uploaded to both utopic and trusty.

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

This bug was fixed in the package rsnapshot - 1.3.1-4ubuntu1

---------------
rsnapshot (1.3.1-4ubuntu1) utopic; urgency=medium

  * debian/patches/14_rsync_rsh_quoting.diff: remove quoting on the
    --rsh arguments to rsync due to the different way rsync is invoked
    via system() in 1.3.1-4 (LP: #1309710)
 -- Steve Beattie <email address hidden> Fri, 18 Apr 2014 12:26:43 -0700

Changed in rsnapshot (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote :

Hi Steve, can you please include the SRU template in this bug before it gets accepted into -proposed thanks!

Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Steve, or anyone else affected,

Accepted rsnapshot into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/rsnapshot/1.3.1-4ubuntu0.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!

description: updated
Changed in rsnapshot (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Peter Kieser (pfak) wrote :

Package 1.3.1-4ubuntu0.1 on trusty-proposed fixes the bug.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Steve Beattie (sbeattie) wrote :

I've also verified that the fix in trusty-proposed fixes the bug. I've also tested the package with configurations that don't set ssh_args to confirm that they still continue to work. Thanks!

Revision history for this message
Jeromy (jeromykeloway) wrote :

Thanks for fixing.

How long will it take to move this fix into trusty-updates? Because I don't want to activate trusty-proposed on my system :)

Revision history for this message
Chris Halse Rogers (raof) wrote :

Like this:

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

This bug was fixed in the package rsnapshot - 1.3.1-4ubuntu0.1

---------------
rsnapshot (1.3.1-4ubuntu0.1) trusty; urgency=medium

  * debian/patches/14_rsync_rsh_quoting.diff: remove quoting on the
    --rsh arguments to rsync due to the different way rsync is invoked
    via system() in 1.3.1-4 (LP: #1309710)
 -- Steve Beattie <email address hidden> Fri, 18 Apr 2014 12:26:43 -0700

Changed in rsnapshot (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for rsnapshot 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.

Changed in rsnapshot (Debian):
status: New → Fix Committed
Revision history for this message
Andreas Hilboll (andreas-h) wrote :

I'm still running into problems with rsnapshot (1.3.1-4ubuntu0.1):

I have

    ssh_args -p 22 -i /path/to/my/.ssh/id_rsa_rsnapshot

Then a backup entry like this

    backup <email address hidden>:/etc/ srv1/ exclude_file=/path/to/rsnapshot_prv.exclude,+rsync_short_args=-z

leads to the error

   rsync: -a -z: unknown option
   rsync error: syntax or usage error (code 1) at main.c(1572) [client=3.1.0]
   ERROR: /usr/bin/rsync returned 1 while processing <email address hidden>:/etc/

The executed rsync command was

   /usr/bin/rsync -a -z --delete --numeric-ids --relative --delete-excluded --exclude-from=/path/to/rsnapshot_prv.exclude --rsh=/usr/bin/ssh -p 22 -i /path/to/my/.ssh/id_rsa_rsnapshot <email address hidden>:/etc /backup/rsnapshot/.sync/srv1/

Without the "+rsync_short_args=-z", everything works fine.

Revision history for this message
Andreas Hilboll (andreas-h) wrote :

I should say that I can get my config to work again when I replace "+rsync_short_args=-z" by "+rsync_long_args=--compress", so this is not critical for me personally. However, the "+rsync_short_args=-z" DID work on Saucy, and I had to spend the last hour trying to figure out why my old config didn't work any more on Trusty.

Changed in rsnapshot (Debian):
status: Fix Committed → New
Changed in rsnapshot (Debian):
status: New → Fix Released
Changed in rsnapshot (Debian):
status: Fix Released → New
Changed in rsnapshot (Debian):
status: New → 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.