Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

s3tables: ensure root tables directory exists before bucket creation

Chris Lu1fb3aefa9593
diff --git a/weed/s3api/s3tables/handler_bucket_create.go b/weed/s3api/s3tables/handler_bucket_create.go
index c5864f991b..079d69fec8 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