Size mismatch when downloading package from aptly repo

483 views
Skip to first unread message

Frederic Van Espen

unread,
Mar 3, 2015, 4:35:09 AM3/3/15
to aptly-discuss
Hi,

I'm seeing a weird error when downloading a package from an aptly repo:
Failed to fetch
http://apt.escaux.com/apt/prod/pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb
Size mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?


I see this in the generated Packages file for the package in question:
Package: dpkg
Origin: debian
Version: 1.15.8.12escaux1
Installed-Size: 7216
Priority: required
Section: admin
Maintainer: Ubuntu Core Developers <ubuntu-dev...@lists.ubuntu.com>
Architecture: i386
Description: Debian package management system
This package provides the low-level infrastructure for handling the
installation and removal of Debian software packages.
.
For Debian package development tools, install dpkg-dev.
MD5sum: f76a632d3a3d5f8673de18707d4b6171
SHA1: 282583130f9b2e88abbbbda3ace96e9792f7dcbe
SHA256: e01f9d67dd4017c2d0c7fd3beb3689087366d3662e88ac153d94fcb4e064680d
Size: 1785856
Pre-Depends: libc6 (>= 2.11), coreutils (>= 5.93-1), lzma
Conflicts: apt (<< 0.7.7), aptitude (<< 0.4.7-1), dpkg-dev (<<
1.14.16), dpkg-iasearch (<< 0.11), sysvinit (<< 2.82-1)
Replaces: manpages-de (<= 0.4-3), manpages-pl (<= 20051117-1)
Source:
Filename: pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb
Homepage: http://wiki.debian.org/Teams/Dpkg
Breaks: emacs21 (<< 21.4a+1-5.7), emacs21-nox (<< 21.4a+1-5.7),
emacs22 (<= 22.2-0ubuntu2), emacs22-gtk (<= 22.2-0ubuntu2),
emacs22-nox (<= 22.2-0ubuntu2), jed (<< 1:0.99.18+dfsg.1-13),
jed-extra (<= 2.5.3-2), konqueror (<= 4:4.2.96-1), pinfo (<<
0.6.9-3.1), tkinfo (<< 2.8-3.1), xemacs21-support (<< 21.4.22-2), xjed
(<< 1:0.99.18+dfsg.1-13)
Bugs: debbugs://bugs.debian.org
Suggests: apt
Essential: yes
Original-Maintainer: Dpkg Developers <debia...@lists.debian.org>

The size of the file according to the spec is 1785856. However, when I
look at the real file:
aptly@apt:/var/lib/aptly/public/prod$ ls -l
pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb
-rw-rw-rw- 2 aptly apt 2497076 Mar 3 08:55
pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb

Anyone got an idea how this happened and how I can recover from it?
Let me know if you need more information!

Cheers,

Frederic

Andrey Smirnov

unread,
Mar 3, 2015, 4:45:26 AM3/3/15
to Frederic Van Espen, aptly-discuss
Hi Frederic!

How have you added this package? Did it come from mirror? Manually to local repo? Have you used -force-overwrite while publishing?

On Tue, Mar 3, 2015 at 12:35 PM Frederic Van Espen <frede...@gmail.com> wrote:
Hi,

I'm seeing a weird error when downloading a package from an aptly repo:
Failed to fetch
http://apt.escaux.com/apt/prod/pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb
 Size mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?


I see this in the generated Packages file for the package in question:
Package: dpkg
Origin: debian
Version: 1.15.8.12escaux1
Installed-Size: 7216
Priority: required
Section: admin
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
--
You received this message because you are subscribed to the Google Groups "aptly-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aptly-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frederic Van Espen

unread,
Mar 3, 2015, 8:49:06 AM3/3/15
to Andrey Smirnov, aptly-discuss
Andrey,

On Tue, Mar 3, 2015 at 11:21 AM, Andrey Smirnov
<smirnov...@gmail.com> wrote:
> Frederic,
>
> -force-overwrite is most probably the reason for the error message you see.
>
> I would not recommend using it unless you're really sure you need that.

We use force-overwrite only for the development repo's because these
are really testing packages and we should overwrite them when we add a
new build of the same version. Development repo's are also only
published in the dev prefix.

> Most probably you have conflicting packages (same name, version, arch, but
> different files) dpkg_1.15.8.12escaux1_i386. Such packages are handled
> successfully by aptly, but problem is that if you publish them to the same
> prefix, they end up using the same filename in pool/ directory (e.g.
> pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb). If you publish two
> snapshots with conflicting packages like that, they would try to use the
> same path to store package file and aptly would complain about that. With
> -force-overwrite you would have one of the package files at that path, and
> you would have two Packages indexes referencing the same path, one of which
> would be wrong (like in your first message).

In this specific case of the dpkg package, I am fairly certain we only
have one package available (actually, this is my first attempt to
really start using aptly for our production hosts). I just today added
the dpkg package to the development repo (which adds it with
-force-overwrite, but there was nothing to overwrite), with the dev
prefix. Then I moved the package to the production repo with aptly
move. Then created a snapshot of the production repo and published it
in the prod prefix (without -force-overwrite).

Anyway, I did find the cause, and it was not aptly :-) We have a
daemon that looks for new files in a certain directory with inotify
and then adds those files. That daemon was adding the files even
before they were completely written. (watching the IN_CREATE event
instead of IN_CLOSE_WRITE).

Cheers,

Frederic

> On Tue, Mar 3, 2015 at 1:01 PM Frederic Van Espen <frede...@gmail.com>
> wrote:
>>
>> On Tue, Mar 3, 2015 at 10:45 AM, Andrey Smirnov
>> <smirnov...@gmail.com> wrote:
>> > Hi Frederic!
>>
>> Hello Andrey :-)
>>
>> > How have you added this package? Did it come from mirror? Manually to
>> > local
>> > repo? Have you used -force-overwrite while publishing?
>>
>> It is a package that was manually built and added to a local repo. It
>> was added to a development repo like this:
>> aptly repo -force-replace add baseline2-dev
>> /var/lib/aptly/incoming/baseline2-dev/dpkg_1.15.8.12escaux1_i386.deb
>>
>> Then a snapshot was created and published
>> aptly snapshot create baseline2-dev-20150303085519 from repo baseline2-dev
>> aptly publish -force-overwrite switch baseline2-dev dev
>> baseline2-dev-20150303085519
>>
>> Afterwards the package was moved to a "prod" repo:
>> aptly repo move baseline2-dev baseline2 'dpkg (= 1.15.8.12escaux1)'
>>
>> Then again a snapshot was created and published from the non-dev repo
>> and published in the same way as above, but with a prod prefix and
>> without force-overwrite:
>> aptly snapshot create baseline2-20150303090053 from repo baseline2
>> aptly publish switch baseline2 prod baseline2-20150303090053
>>
>>
>> Cheers,
>>
>> Frederic
Reply all
Reply to author
Forward
0 new messages