about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2017-11-03T09·49+0100
committerGitHub <noreply@github.com>2017-11-03T09·49+0100
commit4070264613bec69d746aa2e58ecaa1a71dc62374 (patch)
tree1765459a37d450e9435a1391877b5ed39b2a1893
parentac4a1ef0c1303352d80fb3b97a1fc5fffa00d518 (diff)
parent310567922666472c01c69912c269706fb6bb1921 (diff)
Merge pull request #1655 from copumpkin/patch-1
Don't freak out if we get a 403 from S3
-rw-r--r--src/libstore/s3-binary-cache-store.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index 5fc7371a5198..6a0f19238add 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -241,8 +241,8 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
             auto & error = res.GetError();
             if (error.GetErrorType() == Aws::S3::S3Errors::RESOURCE_NOT_FOUND
                 || error.GetErrorType() == Aws::S3::S3Errors::NO_SUCH_KEY
-                || (error.GetErrorType() == Aws::S3::S3Errors::UNKNOWN // FIXME
-                    && error.GetMessage().find("404") != std::string::npos))
+                // If bucket listing is disabled, 404s turn into 403s
+                || error.GetErrorType() == Aws::S3::S3Errors::ACCESS_DENIED)
                 return false;
             throw Error(format("AWS error fetching '%s': %s") % path % error.GetMessage());
         }