I have a central server I build binary packages for all the rest of my machines. All my machines point to this machine for their portage tree and where to get their binary packages. I always use emerge -qGK to get packages so machines don't try and build any packages but instead use the central server. It seems like since portage 2.0.51 and greater this emerge command fails at least 50% of the time with the following traceback: client openldap # emerge -aqGK fl-kernel-gentoo These are the packages that I would merge, in order: Fetching binary packages info... Location has moved: http://server.example.com/binaries/ cache miss: 'x' --- cache hit: 'o' xTraceback (most recent call last): File "/usr/bin/emerge", line 2899, in ? mydepgraph=depgraph(myaction,myopts) File "/usr/bin/emerge", line 866, in __init__ portage.db["/"]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts)) File "/usr/lib/portage/pym/portage.py", line 5647, in populate self.remotepkgs = getbinpkg.dir_get_metadata(settings["PORTAGE_BINHOST"], chunk_size=chunk_size) File "/usr/lib/portage/pym/getbinpkg.py", line 510, in dir_get_metadata myid = file_get_metadata(baseurl+"/"+x, conn, chunk_size) File "/usr/lib/portage/pym/getbinpkg.py", line 319, in file_get_metadata data,rc,msg = make_http_request(conn, address, params, headers) File "/usr/lib/portage/pym/getbinpkg.py", line 199, in make_http_request response = conn.getresponse() File "/usr/lib/python2.3/httplib.py", line 778, in getresponse response.begin() File "/usr/lib/python2.3/httplib.py", line 273, in begin version, status, reason = self._read_status() File "/usr/lib/python2.3/httplib.py", line 237, in _read_status raise BadStatusLine(line) httplib.BadStatusLine and here's my portage environment: client openldap # emerge --info Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r1 i686) ================================================================= System uname: 2.6.9-gentoo-r1 i686 Intel(R) Celeron(R) CPU 2.00GHz Gentoo Base System version 1.4.16 distcc 2.13 i386-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.14.90.0.8-r1 Headers: sys-kernel/linux26-headers-2.6.8.1 Libtools: sys-devel/libtool-1.4.3-r4,sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer" CHOST="i386-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/sanity /usr/share/sanity/cfg /usr/share/sanity/mytags /usr/share/sanity/sanity /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/db/cfg /var/db/sanity /var/db/sanity/linux-gentoo/etc /var/qmail/control"CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms" GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo ftp://ftp.ndlug.nd.edu/pub/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://mirrors.tds.net/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://server.example.com/gentoo-portage" USE="x86 X Xaw3d acl acpi alsa apache2 apm arts avi berkdb bitmap-fonts cdr crypt cups curl doc dvd dvdr encode esd evo faad fam flac flash foomaticdb fortran freetds gd gd-external gdbm gif gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 java jpeg junit kde kerberos ldap libwww mad mcal mikmod mmx motif mozilla mpeg mysql ncurses nls odbc oggvorbis opengl oss pam pdflib perl plotutils png postgres python qt quicktime readline samba sasl sdl skey slang snmp speex spell sse ssl tcltk tcpd tetex threads tiff truetype usb xinerama xml xml2 xmms xv zlib" Reproducible: Sometimes Steps to Reproduce: 1. emerge -qGK <packages> 2. 3. Actual Results: Portage traceback Expected Results: emerge of binary packages
the error: httplib.BadStatusLine perhaps the http server you're connecting to is screwed up
The web server is running 2.0.52. There's nothing really special about it. What would be the problem with the webserver that would cause this type of behavior?
well, considering the first output is 'Location has moved:', that's not 'normal' ...
That's always said that ever since I've been doing this (over a year and a half) and I never had this problem before. The only reason I can think that gets stated is that I have Aliases set for the binary package directory, not a directory directly under the webroot.
Investigating the "Location has moved" thing it appears since I have an alias and I go to htt://server.example.com/binaries instead of http://server.example.com/binaries/ (notice the trailing slash) it returns a HTTP 301 which triggers the Location has moved. If I append the trailing slash I get an HTTP 200. I'll try using the trailing slash version and see if that helps anything, though I'm not sure why that would matter.
I've never seen that error and it looks like you're missing the end of the exception. It should end in a colon and the bad line. >>> raise httplib.BadStatusLine("foo bar") Traceback (most recent call last): File "<stdin>", line 1, in ? httplib.BadStatusLine: foo bar
That's all there is to it. The next line after that is my prompt. So far using the correct URL (with trailing slash) seems to be working.
Ah hah. That exception has a weird representation. >>> raise httplib.BadStatusLine("") Traceback (most recent call last): File "<stdin>", line 1, in ? httplib.BadStatusLine >>> raise httplib.BadStatusLine("foo") Traceback (most recent call last): File "<stdin>", line 1, in ? httplib.BadStatusLine: foo So for some reason you have an empty line in your headers when doing a 302?
I'm pretty much using stock Apache 2 for everything. I've just created these aliases to point to the proper place. On a good note, I've been using the corrected URL and I haven't had it fail once, so that looks like the solution. Thanks for the help and suggestions to get me looking in the right place.