Fixing BackupPC’s “Download Zip archive” restore option in Ubuntu Lucid

Update 2012-02-28: Consider upgrading to BackupPC 3.2.0 to resolve this.

We recently upgraded our BackupPC servers to BackupPC 3.1.0 on Ubuntu 10.04 Lucid Lynx. It’s working almost perfectly. However, the “Download ZIP archive” restore option no longer works. This is due to a bug in recent version of the Archive::Zip Perl module which generates corrupt ZIP archives.

Note to developers: when releasing new versions of your library, try to avoid breaking its core functionality.

If you try decompressing a corrupted file, you’ll see a message like this:

tyler@laptop:~$ unzip restore.zip
Archive:  restore.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of restore.zip or
        restore.zip.zip, and cannot find restore.zip.ZIP, period.

I posted a solution on the mailing list. I’ve since uploaded an older version (1.18-1) of this package to my repository, so the process is even more streamlined.

If you are using my repo:
apt-get install libarchive-zip-perl=1.18-1
echo "libarchive-zip-perl hold" | dpkg --set-selections

If you aren’t using my repo but want a quick fix:
wget http://www.tolaris.com/apt/pool/main/liba/libarchive-zip-perl/libarchive-zip-perl_1.18-1_all.deb
dpkg -i libarchive-zip-perl_1.18-1_all.deb
echo "libarchive-zip-perl hold" | dpkg --set-selections

Tags: , ,

  1. David Herring’s avatar

    I had exactly the same problem using Ubuntu 10.10 – and your solution worked fine. Thank you dave

    Reply

    1. Tyler Wagner’s avatar

      David,

      You might want to use BackupPC 3.2.0. The package for Ubuntu 10.04 is in my repo. If you feel like testing it on 10.10, let me know and I’ll add it to the 10.10 repo. It’s just the package from Debian with some changed dependencies in the .deb file (no code changes from the source package).

      Reply

    2. Mark’s avatar

      Thank you so much for posting this fix. I’m running Ubuntu 10.04.3 LTS and this has resolved the issue for me.

      Reply

      1. Tyler Wagner’s avatar

        Hi Mark,

        I’ve also got a package for BackupPC 3.2.0 in my repo, which fixes this problem as well as others. I’ve been using it for over a year; it’s stable and works well. I advise you to upgrade.

        Reply

      2. Dale Langham’s avatar

        (This comment has been imported from email – please ask questions as comments so others can benefit. -Tyler)

        Hi all,

        I downloaded the libarchive-zip-perl_1.18-1_all.deb manually then copied it up to the server, then followed the process below from a putty session:

        dpkg -i libarchive-zip-perl_1.18-1_all.deb
        echo “libarchive-zip-perl hold” | dpkg –set-selections

        //Rebooted server
        Reboot

        dpkg -s libarchive-zip-perl

        //Version Result
        Package: libarchive-zip-perl
        Status: hold ok installed
        Priority: optional
        Section: perl
        Installed-Size: 376
        Maintainer: Ubuntu Core Developers
        Architecture: all
        Version: 1.18-1
        Depends: perl (>= 5.6.0-16), libcompress-zlib-perl
        Description: Module for manipulation of ZIP archives
        The Archive::Zip module allows a Perl program to create, manipulate,
        read, and write Zip archive files.
        .
        Zip archives can be created, or you can read from existing zip files.
        Once created, they can be written to files, streams, or strings.
        .
        Members can be added, removed, extracted, replaced, rearranged, and
        enumerated. They can also be renamed or have their dates, comments,
        or other attributes queried or modified. Their data can be
        compressed or uncompressed as needed. Members can be created from
        members in existing Zip files, or from existing directories, files,
        or strings.
        Original-Maintainer: Ben Burton

        This tells me that I have downgraded to version: 1.18-1, but I am still getting corruption on a 10GB zip.

        Any ideas?

        Best regards
        Dale

        Reply

        1. Tyler Wagner’s avatar

          Hi Dale,

          Off hand, no. What distro are you using? What version of BackupPC, installed from what repo?

          Does a tar file work? Are you saving this ZIP to a filesystem that can handle large files?

          If you are running Ubuntu lucid, consider upgrading to BackupPC 3.2.0, and removing the hold on libarchive-zip-perl. Multiple people have packaged 3.2.0, including me, and they work fine. I use my own package in production at work.

          Reply

          1. Dale Langham’s avatar

            Hi Tyler,

            Many thanks for the prompt response.
            I am using Ubuntu Server 11.04 (64 bit), BackupPC is at version 3.2.0 and it was installed from the standard Ubuntu repo.
            TAR files work fine and the files are being downloaded to Windows 7 and has been tested on both 32 and 64 bit platforms, the issue only effects the zip option over about 8GB in size, I downgraded libarchive-zip-perl 1.30-3 => 1.18-1, but this has had no affect.
            Other than this, the system works great.

            Best regards
            Dale

            Reply

            1. Tyler Wagner’s avatar

              Hi Dale,

              Sorry, my post was unclear. It didn’t specify that this was written about BackupPC 3.1.0, which was what was originally packaged for lucid. BackupPC 3.2.0 does not suffer from the corrupt ZIP problem that 3.1.0 did. Downgrading libarchive-zip-perl won’t help you. I have updated this post to specify the version.

              I’m not sure that anyone has tested such large ZIP downloads. 8 GB is an unusual boundary. I suspect it’s some kind of resource limit. My advice is to ask the backuppc-users list, which I am on, for their opinions. If you find a solution, please include it here for others.

              Reply

              1. Dale Langham’s avatar

                Hi Tyler,

                That’s no problem, the actual file is 10GB but I can download a 5GB file with no problems.
                I will look into to it more and if I find the reason, I will be sure to let you all know.
                Again, many thanks for your time.

                Regards
                Dale

                Reply

              2. Trev Thorpe’s avatar

                Worked like a charm… thanks for the tip.

                Reply

Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.