Package: apt-cacher-ng
Version: 0.7.6-1
Severity: normal

Hi,

I'm having weird, confusing issues with Ubuntu clients working through
apt-cacher-ng (which a transparent Squid forwards relevant requests to).

Part of the problem seems to be that apt-cacher-ng returns "500 internal
server error" if asked to retreive a Packages file that doesn't exist:

% wget -S -O- 
'http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages'
--2012-08-02 21:29:05--  
http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages
Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.92.180, 
91.189.92.181, 91.189.92.182, ...
Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.92.180|:80... 
connected.
HTTP request sent, awaiting response...
  HTTP/1.0 500 Internal Server Error
  Content-Length: 144
  Content-Type: text/html
  Date: Thu Aug  2 19:29:05 2012
  Server: Debian Apt-Cacher NG/0.7.4
  X-Cache: MISS from proxy
  X-Cache-Lookup: MISS from proxy:3128
  Connection: keep-alive
2012-08-02 21:29:05 ERROR 500: Internal Server Error.

(This request first passed through a transparent Squid, which forwarded it
to apt-cacher-ng.)

The real server replies with:

% wget -S -O- 
'http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages'
--2012-08-02 21:51:08--  
http://archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages
Resolving archive.ubuntu.com... 91.189.92.152, 91.189.92.153, 91.189.92.154, ...
Connecting to archive.ubuntu.com|91.189.92.152|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 404 Not Found
  Date: Thu, 02 Aug 2012 19:51:09 GMT
  Server: Apache/2.2.22 (Ubuntu)
  Vary: Accept-Encoding
  Content-Length: 329
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: text/html; charset=iso-8859-1
2012-08-02 21:51:09 ERROR 404: Not Found.

It seems to me that in this case, tools like apt-get and debootstrap would
try Packages.gz and Packages.bz2 as well (which do exist), but the 500 error
throws them off.

Interestingly, the responses from apt-cacher-ng vary somewhat depending on
how it's queried:

% wget -S -O- 
'http://aptcacher:3142/archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages'
--2012-08-02 21:36:51--  
http://aptcacher:3142/archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages
Resolving aptcacher (aptcacher)... 192.168.0.254
Connecting to aptcacher (aptcacher)|192.168.0.254|:3142... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 500 Bad mirror
  Content-Length: 144
  Content-Type: text/html
  Date: Thu Aug  2 19:36:51 2012
  Server: Debian Apt-Cacher NG/0.7.6
  Connection: Keep-Alive
2012-08-02 21:36:51 ERROR 500: Bad mirror.

This is what happens when I query it directly instead of going through
Squid. I suppose Squid discards "Bad mirror" and returns "Internal Server
Error" based on an internal table of HTTP status codes.

Is there a good reason why the client is not allowed to see the 404 error?

Even if that error can't be passed through to the client for whatever
reason, I think the error message ACNG returns could be improved. The error
log isn't very informative either (and this is with Debug:4):

Thu Aug  2 21:36:51 2012|Detected incoming connection from the TCP socket
Thu Aug  2 21:36:51 2012|Client name: 192.168.0.4
Thu Aug  2 21:36:51 2012|Raw request URI: 
/archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages
Thu Aug  2 21:36:51 2012|Processing new job, GET 
/archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages HTTP/1.1
Thu Aug  2 21:36:51 2012|Prepared response header for user:
HTTP/1.1 500 Bad mirror
Content-Length: 144
Content-Type: text/html
Date: Thu Aug  2 19:36:51 2012
Server: Debian Apt-Cacher NG/0.7.6
Connection: Keep-Alive

A simple HTML page saying something like "ACNG running on host <hostname>
attempted to fetch <real-url> from <real-server> but the server said <server
response>.

<Reasoning explaining why ACNG can't deal with this.>" would be very
helpful.

Andras

-- 
                     Andras Korn <korn at elan.rulez.org>
          Eagles may soar but weasels aren't sucked into jet engines.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to