zsync fails with "aborted" when target file is redirected

Bug #661308 reported by Kemel Zaidan aka Legendario
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
zsync (Debian)
Fix Released
Unknown
zsync (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Maverick by Arnaud Soyez

Bug Description

Binary package hint: zsync

I just can't use zsync to download maverick netbook image. Here are the terminal output:

zsync http://releases.ubuntu.com/maverick/ubuntu-10.10-netbook-i386.iso.zsync
#################### 100.0% 254.6 kBps DONE

reading seed file ubuntu-10.10-netbook-i386.iso.part: ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************Read ubuntu-10.10-netbook-i386.iso.part. Target 0.2% complete. *
downloading from http://releases.ubuntu.com/maverick/ubuntu-10.10-netbook-i386.iso:
-------------------- 0.2% 0.0 kBps aborted

failed to retrieve from ubuntu-10.10-netbook-i386.iso
Aborting, download available in ubuntu-10.10-netbook-i386.iso.part
verifying download...

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: zsync 0.6.1-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
Uname: Linux 2.6.35-22-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Fri Oct 15 12:44:51 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 LANGUAGE=pt_BR:pt:en
 LANG=pt_BR.utf8
 SHELL=/bin/bash
SourcePackage: zsync

Revision history for this message
Kemel Zaidan aka Legendario (kemelzaidan) wrote :
Revision history for this message
Arnaud Soyez (weboide) wrote :

I am getting the exact same error using zsync 0.6.1-1ubuntu1:

-------------------- 0.2% 0.0 kBps aborted
failed to retrieve from ubuntu-10.10-netbook-i386.iso

Changed in zsync (Ubuntu):
status: New → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote :

The problem seems to have to do with the HTTP redirect used on the server.

Older versions of zsync did not support redirects at all, but 0.6.1 is supposed to handle this properly.

As a workaround, I did this:

$ wget http://releases.ubuntu.co/10.10/ubuntu-10.10-netbook-i386.iso.zsync
[...]
$ wget --spider http://releases.ubuntu.com/10.10/ubuntu-10.10-netbook-i386.iso
Spider mode enabled. Check if remote file exists.
--2010-10-17 10:50:02-- http://releases.ubuntu.com/10.10/ubuntu-10.10-netbook-i386.iso
Resolving releases.ubuntu.com... 91.189.88.32, 2620:0:dc0:1800:214:4fff:fe7d:1b9, 2001:6b0:e:2018::1337, ...
Connecting to releases.ubuntu.com|91.189.88.32|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://d35x5jwfquk1wr.cloudfront.net/ubuntu-10.10-netbook-i386.iso [following]

Note the URL in the Location: header, then do:

$ zsync -u http://d35x5jwfquk1wr.cloudfront.net/ ubuntu-10.10-netbook-i386.iso.zsync

This tells zsync to download directly from the CDN server rather than trying to handle the redirect.

Changed in zsync (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Matt Zimmerman (mdz) wrote :

Some information on zsync and redirects can be found on http://zsync.moria.org.uk/server-issues

Revision history for this message
Matt Zimmerman (mdz) wrote :

The attached patch seems to fix the problem. I've tested it lightly with a few different cases (with and without redirects) and didn't find any regressions.

The root cause seems to be that when reconnecting due to a redirect, zsync forgets to discard the data remaining in the buffer from the previous connection.

summary: - zsync fails to download Maverick netbook image
+ zsync fails when target file is redirected
summary: - zsync fails when target file is redirected
+ zsync fails with "aborted" when target file is redirected
Changed in zsync (Debian):
status: Unknown → Confirmed
tags: added: patch
Revision history for this message
Arnaud Soyez (weboide) wrote :

Matt's patch fixes the bug very well!
Attached is a debdiff against 0.6.1-1ubuntu1

  * Installed quilt patch system
  * Added new patch:
    - 00-clear-buffer-when-http-redirect.patch:
      + Clear buffer when following HTTP redirection (LP: #661308)

 debian/README.source | 5 +++++
 debian/patches/00-clear-buffer-when-http-redirect.patch | 11 +++++++++++
 debian/patches/series | 1 +
 zsync-0.6.1/debian/changelog | 9 +++++++++
 zsync-0.6.1/debian/control | 2 +-
 zsync-0.6.1/debian/rules | 6 ++++--
 6 files changed, 31 insertions(+), 3 deletions(-)

Revision history for this message
Colin Phipps (cph-moria) wrote :

This was fixed in zsync 0.6.2 .

Changed in zsync (Debian):
status: Confirmed → Fix Released
Revision history for this message
Paul White (paulw2u) wrote :

Ubuntu changelog checked
Fixed in zsync 0.6.2-1 on 2012-05-31

Changed in zsync (Ubuntu):
status: Triaged → 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.