From ff08306746e88e708612cdc6d2dac84bd76f1106 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 4 Jun 2013 15:20:37 +0200 Subject: [PATCH] download-from-binary-cache.pl: Treat a 403 error as a 404 Amazon S3 returns HTTP status code 403 if a file doesn't exist and the user has no permission to list the contents of the bucket. So treat it as 404 (meaning it's cached in the NARExistence table). --- scripts/download-from-binary-cache.pl.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 4ca494497e..1b42152783 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -288,7 +288,7 @@ sub processNARInfo { my ($storePath, $cache, $request) = @_; if ($request->{result} != 0) { - if ($request->{result} != 37 && $request->{httpStatus} != 404) { + if ($request->{result} != 37 && $request->{httpStatus} != 404 && $request->{httpStatus} != 403) { print STDERR "could not download ‘$request->{url}’ (" . ($request->{result} != 0 ? "Curl error $request->{result}" : "HTTP status $request->{httpStatus}") . ")\n"; } else { @@ -467,7 +467,7 @@ sub printSubstitutablePaths { foreach my $request (values %requests) { if ($request->{result} != 0) { - if ($request->{result} != 37 && $request->{httpStatus} != 404) { + if ($request->{result} != 37 && $request->{httpStatus} != 404 && $request->{httpStatus} != 403) { print STDERR "could not check ‘$request->{url}’ (" . ($request->{result} != 0 ? "Curl error $request->{result}" : "HTTP status $request->{httpStatus}") . ")\n"; } else {