From 8e8edd77062b1cdf8afd48b15cbec3d641b5d2e2 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 23 Feb 2026 00:12:04 -0800 Subject: [PATCH] not empty only if there are actual files in the bucket --- weed/s3api/s3tables/handler_namespace.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/weed/s3api/s3tables/handler_namespace.go b/weed/s3api/s3tables/handler_namespace.go index 9cf0f7809..fe622daa7 100644 --- a/weed/s3api/s3tables/handler_namespace.go +++ b/weed/s3api/s3tables/handler_namespace.go @@ -557,8 +557,14 @@ func (h *S3TablesHandler) handleDeleteNamespace(w http.ResponseWriter, r *http.R return err } if entry.Entry != nil && !strings.HasPrefix(entry.Entry.Name, ".") { - hasChildren = true - break + // Only consider it a child if it's a table (has metadata) or a file. + // Empty directories left by dropped tables or S3 clients should not + // prevent the namespace from being deleted. + _, hasMetadata := entry.Entry.Extended[ExtendedKeyMetadata] + if hasMetadata || !entry.Entry.IsDirectory { + hasChildren = true + break + } } }