tags 683686 +moreinfo
thanks

Hallo,
* Andras Korn [Thu, Aug 02 2012, 10:16:41PM]:
> Package: apt-cacher-ng
> Version: 0.7.6-1

Seriously? The messages below say that it's 0.7.4, not 0.7.6!

And where is the config?

> 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.)

There is no such error string in ACNG. Must be something in your Squid,
as you assumed below.

> 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.

Your guess is close but I think it's another thing. The "Bad mirror"
code is generated by the code that attempts to detect a mirror with
missing architecture. The skipping of other Packages files would also be
enforced by that code. But this method only becomes active if you have
used the keyfile=... keyword in your config. Have you?

> 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?

Please ask Squid or APT guys!

The problem with wrappers like Squid is the use of persistent
connections for multiple client requests. This is usually ok unless the
remote host (here: apt-cacher-ng) tries to do clever things based on the
connection identity. In your case, I can imagine a scenario where you
there is a mirror list where some mirrors only contain files for arch A
and others for arch B. And you have different clients in your LAN, so
the first client (arch A) tells acng to blacklist mirrors not having
arch A and the next client requires arch B which is unfortunately not
available on any mirrors that have arch A.

> 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):

Hard to find the right message which does not spam regular usage
output... I will change it to "500 Keyfile missing, mirror blacklisted".

> 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.

>From the personal experience, the body of the error page has very
limited use in debugging contents but yes, sometimes it can be helpful
if (and only if) generated properly. There is a plan for the overhaul of
error tracking code (became ugly after some release cycles) but it's a
plan for the far future.

Regards,
Eduard.


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to