Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 303211

Summary: portage-2.1.7.16: crashed getbinpkg, verify digest failed
Product: Portage Development Reporter: Martin Korous <mortals>
Component: Binary packages supportAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: major CC: barzog, ikrabbe.ask, scarabeus
Priority: High Keywords: InVCS, REGRESSION
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.korous.net/pkg_size.html
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 307597    

Description Martin Korous 2010-02-02 13:17:29 UTC
On server I have built package with "emerge --buildpkg packagename"
On client I have try download and install with "emerge --getbinpkg --usepkg packagename"

I got some errors:
!!! Error fetching binhost package info from 'ftp://login:pass@10.0.0.31'
!!! [Errno ftp error] [Errno ftp error] 550 Can't change directory to Packages: No such file or directory

Howerver binary package is dowloaded but digest verify failed:
!!! Digest verification failed:
!!! /usr/portage/packages/All/traceroute-2.0.12.tbz2
!!! Reason: Filesize does not match recorded size
!!! Got: 65804
!!! Expected: 90679
File renamed to '/usr/portage/packages/All/traceroute-2.0.12.tbz2._checksum_failure_.ut9CCl'

Filesize and all checksums (md5,sha1) are correct:
md5sum on server is a1de4226602c46ddce4b0bc6b8f0ae36  /usr/portage/packages/All/traceroute-2.0.12.tbz2
md5sum on client is a1de4226602c46ddce4b0bc6b8f0ae36  /usr/portage/packages/All/traceroute-2.0.12.tbz2._checksum_failure_.ut9CCl

If I rename traceroute-2.0.12.tbz2._checksum_failure_.ut9CCl to traceroute-2.0.12.tbz2, emerge without --getbinpkg only with --usepkg is success.

Portage expected wrong filesize 90679, this number is in 
cat /var/db/pkg/net-analyzer/traceroute-2.0.12/SIZE 
90679

I think that wrong size is from file
/usr/lib/portage/pym/portage/dbapi/bintree.py
on line 1196:
digests["size"] = int(metadata["SIZE"])

maybe wrong metadata but I can`t find why.


Reproducible: Always

Steps to Reproduce:
I can reproduce this always but...
I can`t reproduce with packages from my overlay, only with packages from main portage tree, checked with traceroute, lftp, libffi.
And I can`t reproduce on my desktop with same version of portage (2.1.7.16) and python (2.6.4)
Actual Results:  
digest verification failed

Expected Results:  
success emerge
Comment 1 Zac Medico gentoo-dev 2010-02-02 19:02:11 UTC
(In reply to comment #0)
> I got some errors:
> !!! Error fetching binhost package info from 'ftp://login:pass@10.0.0.31'
> !!! [Errno ftp error] [Errno ftp error] 550 Can't change directory to Packages:
> No such file or directory

Let's start with this error, because this indicates that you have configuration problems. The PORTAGE_BINHOST uri should point to a director containing a file named 'Packages'. Since it seems like it doesn't, you need to fix that. If necessary, you can run `emaint --fix binhost` on the server in order to regenerate the $PKGDIR/Packages file.
Comment 2 Martin Korous 2010-02-03 00:34:23 UTC
hmm
in version 2.1.6 is change in PORTAGE_BINHOST:

For versions of portage less that 2.1.6, this variable should point to the 'All' directory on the host that creates the binary packages and not to the root of the PKGDIR.  Starting with portage 2.1.6, it should point to a directory containing a 'Packages' index file.  If ${PORTAGE_BINHOST}/Packages does not exist then portage will attempt to use the older protocol.

I didnt see this change in changelog
its only my stupid mistake, not bug
Comment 3 Zac Medico gentoo-dev 2010-02-03 01:38:02 UTC
Well, the behavior that you triggered isn't intended. I'll see if I can make it behave a little better.
Comment 4 Zac Medico gentoo-dev 2010-02-09 19:10:50 UTC
Reopening since we've got a duplicate now.
Comment 5 Zac Medico gentoo-dev 2010-02-09 19:11:20 UTC
*** Bug 303547 has been marked as a duplicate of this bug. ***
Comment 6 Oleg Gawriloff 2010-02-09 21:27:59 UTC
(In reply to comment #2)
> hmm
> in version 2.1.6 is change in PORTAGE_BINHOST:
> 
> For versions of portage less that 2.1.6, this variable should point to the
> 'All' directory on the host that creates the binary packages and not to the
> root of the PKGDIR.  Starting with portage 2.1.6, it should point to a
> directory containing a 'Packages' index file.  If ${PORTAGE_BINHOST}/Packages
> does not exist then portage will attempt to use the older protocol.
> 
> I didnt see this change in changelog
> its only my stupid mistake, not bug
> 

I've see. Changing from:
PORTAGE_BINHOST="ftp://binhost:*@falcon-cl2.telecom.by/packages/All" to
PORTAGE_BINHOST="ftp://binhost:*@falcon-cl2.telecom.by/packages/"
and all works as expected. This change MUST be noted after installing portage and may be in eselect news.

Comment 7 Zac Medico gentoo-dev 2010-02-10 00:53:32 UTC
There's a patch to fix the digest verification failure in svn r15333.

Also, the portage-2.1.7.x ebuilds now show this ewarn message when upgrading with $PORTAGE_BINHOST set:

 * If you have an old PORTAGE_BINHOST setting in /etc/make.conf then
 * you will encounter bug #303211. Therefore, please ensure that your
 * PORTAGE_BINHOST setting points to a remote directory containing
 * a $PKGDIR/Packages file which is created by >=portage-2.1.6. If
 * $PKGDIR/Packages does not exist on the server or it is incomplete,
 * you must run `emaint --fix binhost` on the server in order to
 * generate it. See `man make.conf` for more information about
 * PORTAGE_BINHOST.
Comment 8 Zac Medico gentoo-dev 2010-03-03 11:19:00 UTC
This is fixed in 2.1.8 and 2.2_rc64.
Comment 9 Ingo Krabbe 2010-10-09 06:34:16 UTC
*** Bug 339421 has been marked as a duplicate of this bug. ***