From 84f002f5bb7e91ec5527fc8839438ed0c1bbcdc0 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Mon, 25 Nov 2024 18:17:00 +0100 Subject: [PATCH] Ignore bucket not found in `getBucketInfos()` This may happen due to race condition (on bucket removal), or if the system is interrupted halfway in bucket creation/removal. Issue: ARSN-447 --- lib/storage/metadata/mongoclient/MongoClientInterface.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/storage/metadata/mongoclient/MongoClientInterface.js b/lib/storage/metadata/mongoclient/MongoClientInterface.js index c15542fa7..306c8a219 100644 --- a/lib/storage/metadata/mongoclient/MongoClientInterface.js +++ b/lib/storage/metadata/mongoclient/MongoClientInterface.js @@ -2136,6 +2136,10 @@ class MongoClientInterface { // in $regex return this.getBucketAttributes(bucketName, log, (err, bucketInfo) => { + if (err?.is?.NoSuchBucket) { + // Skip bucket if not found: can happen if bucket has just been removed + return next(); + } if (err) { log.error('failed to get bucket attributes', { bucketName,