Skip to content

Commit f8dca20

Browse files
committed
NC | Lifecycle | Validate bucket storage path exists before processing
Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
1 parent 7790449 commit f8dca20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/manage_nsfs/nc_lifecycle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ class NCLifecycle {
223223
dbg.warn(`process_bucket - bucket owner ${bucket_json.owner_account} does not exist for bucket ${bucket_name}. skipping lifecycle for this bucket`);
224224
return;
225225
}
226+
const bucket_storage_path_exists = await native_fs_utils.is_path_exists(this.config_fs.fs_context, bucket_json.path);
227+
if (!bucket_storage_path_exists) throw new Error(`process_bucket - bucket storage path ${bucket_json.path} does not exist for bucket ${bucket_name}.`);
226228
const object_sdk = new NsfsObjectSDK('', this.config_fs, account, bucket_json.versioning, this.config_fs.config_root, system_json);
227229
await object_sdk._simple_load_requesting_account();
228230
const should_notify = notifications_util.should_notify_on_event(bucket_json, notifications_util.OP_TO_EVENT.lifecycle_delete.name);

0 commit comments

Comments
 (0)