This seems to happen when the remote repo is running lighttpd with just this URL. solar@hangover ~/Desktop $ PORTAGE_BINHOST=http://tinderbox.dev.gentoo.org/default-linux/amd64 emerge -Gpvq mysql Loaded metadata pickle. Location has moved: http://tinderbox.dev.gentoo.org/default-linux/amd64/ Connection: close Content-Type: text/html Content-Length: 349 Date: Tue, 11 Sep 2007 17:40:46 GMT Server: lighttpd/1.4.16 <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>400 - Bad Request</title> </head> <body> <h1>400 - Bad Request</h1> </body> </html> address: http://tinderbox.dev.gentoo.org/default-linux/amd64/ Traceback (most recent call last): File "/usr/bin/emerge", line 5547, in ? retval = emerge_main() File "/usr/bin/emerge", line 5542, in emerge_main myopts, myaction, myfiles, spinner) File "/usr/bin/emerge", line 4868, in action_build mydepgraph = depgraph(settings, trees, myopts, myparams, spinner) File "/usr/bin/emerge", line 965, in __init__ "--getbinpkgonly" in self.myopts) File "/usr/lib/portage/pym/portage.py", line 6632, in populate self.remotepkgs = getbinpkg.dir_get_metadata( File "/usr/lib/portage/pym/getbinpkg.py", line 448, in dir_get_metadata filelist = dir_get_list(baseurl, conn) File "/usr/lib/portage/pym/getbinpkg.py", line 294, in dir_get_list raise Exception, "Unable to get listing: %s %s" % (rc,msg) Exception: Unable to get listing: 400 Server did not respond successfully (400: Bad Request) However on the same server if I stop lighttpd and start apache. solar@hangover ~/Desktop $ PORTAGE_BINHOST=http://tinderbox.dev.gentoo.org/default-linux/amd64 emerge -Gpvq mysql Loaded metadata pickle. Location has moved: http://tinderbox.dev.gentoo.org/default-linux/amd64/ cache miss: 'x' --- cache hit: 'o' oooooo...... [binary N ] perl-core/Sys-Syslog-0.18 [binary N ] dev-db/mysql-init-scripts-1.2 [binary N ] dev-perl/Net-Daemon-0.39 [binary N ] dev-db/mysql-5.0.44-r1 USE="berkdb perl ssl -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal -selinux -static" [binary N ] dev-perl/PlRPC-0.2018 [binary N ] virtual/perl-Sys-Syslog-0.18 [binary N ] virtual/mysql-5.0 [binary N ] dev-perl/DBI-1.55 [binary N ] dev-perl/DBD-mysql-4.00.5 Local portage version 2.1.2.9
Ok did a bit more playing around. this error only happens when the binhost lacks a trailing / Solution is probably pretty simple. Check if binhost endswith("/") if not append it.
This is similar to bug 144440. In svn r7771 if fixed it to append the trailing slash when necessary for http servers.
This has been released in 2.1.3.10.