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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add s3api error for copy in file, not directory
Lapshinn Vitaly6bdc274d4db8
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.goindex fd2a0e6bde..f454bfad29 100644--- a/weed/s3api/s3api_object_handlers.go+++ b/weed/s3api/s3api_object_handlers.go@@ -436,10 +436,14 @@ func setEtag(w http.ResponseWriter, etag string) {}func filerErrorToS3Error(errString string) s3err.ErrorCode {- if strings.HasPrefix(errString, "existing ") && strings.HasSuffix(errString, "is a directory") {+ switch {+ case strings.HasPrefix(errString, "existing ") && strings.HasSuffix(errString, "is a directory"):return s3err.ErrExistingObjectIsDirectory+ case strings.HasSuffix(errString, "is a file"):+ return s3err.ErrExistingObjectIsFile+ default:+ return s3err.ErrInternalError}- return s3err.ErrInternalError}func (s3a *S3ApiServer) maybeAddFilerJwtAuthorization(r *http.Request, isWrite bool) {diff --git a/weed/s3api/s3err/s3api_errors.go b/weed/s3api/s3err/s3api_errors.goindex 8d02f15b14..f4a83d9795 100644--- a/weed/s3api/s3err/s3api_errors.go+++ b/weed/s3api/s3err/s3api_errors.go@@ -101,6 +101,7 @@ const (ErrPreconditionFailedErrExistingObjectIsDirectory+ ErrExistingObjectIsFile)// error code to APIError structure, these fields carry respective@@ -383,6 +384,11 @@ var errorCodeResponse = map[ErrorCode]APIError{Description: "Existing Object is a directory.",HTTPStatusCode: http.StatusConflict,},+ ErrExistingObjectIsFile: {+ Code: "ExistingObjectIsFile",+ Description: "Existing Object is a file.",+ HTTPStatusCode: http.StatusConflict,+ },}// GetAPIError provides API Error for input API error code.