From 1fb3aefa9593f520b975a58eada165ff4b465824 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 28 Jan 2026 12:30:32 -0800 Subject: [PATCH] s3tables: ensure root tables directory exists before bucket creation --- weed/s3api/s3tables/handler_bucket_create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/s3api/s3tables/handler_bucket_create.go b/weed/s3api/s3tables/handler_bucket_create.go index c5864f991..079d69fec 100644 --- a/weed/s3api/s3tables/handler_bucket_create.go +++ b/weed/s3api/s3tables/handler_bucket_create.go @@ -89,6 +89,11 @@ func (h *S3TablesHandler) handleCreateTableBucket(w http.ResponseWriter, r *http } err = filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { + // Ensure root tables directory exists + if err := h.createDirectory(r.Context(), client, TablesPath); err != nil { + return fmt.Errorf("failed to ensure root tables directory: %w", err) + } + // Create bucket directory if err := h.createDirectory(r.Context(), client, bucketPath); err != nil { return err