2020-07-22 13:02:32 +00:00
package api
import (
"context"
"fmt"
"net/http"
2020-08-06 12:02:13 +00:00
"path"
2020-07-22 13:02:32 +00:00
)
type (
// ErrorCode type of error status.
ErrorCode int
errorCodeMap map [ ErrorCode ] Error
)
const maxEConfigJSONSize = 262272
// Error codes, non exhaustive list - http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
const (
2020-08-06 12:02:13 +00:00
_ ErrorCode = iota
2020-07-22 13:02:32 +00:00
ErrAccessDenied
ErrBadDigest
ErrEntityTooSmall
ErrEntityTooLarge
ErrPolicyTooLarge
2021-06-25 12:54:25 +00:00
ErrIllegalVersioningConfigurationException
2020-07-22 13:02:32 +00:00
ErrIncompleteBody
ErrInternalError
ErrInvalidAccessKeyID
ErrInvalidBucketName
ErrInvalidDigest
ErrInvalidRange
ErrInvalidCopyPartRange
ErrInvalidCopyPartRangeSource
ErrInvalidMaxKeys
ErrInvalidEncodingMethod
ErrInvalidMaxUploads
ErrInvalidMaxParts
ErrInvalidPartNumberMarker
ErrInvalidRequestBody
ErrInvalidCopySource
ErrInvalidMetadataDirective
ErrInvalidCopyDest
ErrInvalidPolicyDocument
ErrInvalidObjectState
ErrMalformedXML
ErrMissingContentLength
ErrMissingContentMD5
ErrMissingRequestBodyError
ErrMissingSecurityHeader
ErrNoSuchBucket
ErrNoSuchBucketPolicy
ErrNoSuchBucketLifecycle
ErrNoSuchLifecycleConfiguration
ErrNoSuchBucketSSEConfig
ErrNoSuchCORSConfiguration
ErrNoSuchWebsiteConfiguration
ErrReplicationConfigurationNotFoundError
ErrNoSuchKey
ErrNoSuchUpload
ErrNoSuchVersion
ErrNotImplemented
ErrPreconditionFailed
2021-07-14 12:51:45 +00:00
ErrNotModified
2020-07-22 13:02:32 +00:00
ErrRequestTimeTooSkewed
ErrSignatureDoesNotMatch
ErrMethodNotAllowed
ErrInvalidPart
ErrInvalidPartOrder
ErrAuthorizationHeaderMalformed
ErrMalformedPOSTRequest
ErrPOSTFileRequired
ErrSignatureVersionNotSupported
ErrBucketNotEmpty
ErrAllAccessDisabled
ErrMalformedPolicy
ErrMissingFields
ErrMissingCredTag
ErrCredMalformed
ErrInvalidRegion
ErrInvalidServiceS3
ErrInvalidServiceSTS
ErrInvalidRequestVersion
ErrMissingSignTag
ErrMissingSignHeadersTag
ErrMalformedDate
ErrMalformedPresignedDate
ErrMalformedCredentialDate
ErrMalformedCredentialRegion
ErrMalformedExpires
ErrNegativeExpires
ErrAuthHeaderEmpty
ErrExpiredPresignRequest
ErrRequestNotReadyYet
ErrUnsignedHeaders
ErrMissingDateHeader
ErrInvalidQuerySignatureAlgo
ErrInvalidQueryParams
ErrBucketAlreadyOwnedByYou
ErrInvalidDuration
ErrBucketAlreadyExists
ErrMetadataTooLarge
ErrUnsupportedMetadata
ErrMaximumExpires
ErrSlowDown
ErrInvalidPrefixMarker
ErrBadRequest
ErrKeyTooLongError
ErrInvalidBucketObjectLockConfiguration
ErrObjectLockConfigurationNotFound
ErrObjectLockConfigurationNotAllowed
ErrNoSuchObjectLockConfiguration
ErrObjectLocked
ErrInvalidRetentionDate
ErrPastObjectLockRetainDate
ErrUnknownWORMModeDirective
ErrBucketTaggingNotFound
ErrObjectLockInvalidHeaders
ErrInvalidTagDirective
// Add new error codes here.
2021-05-13 19:25:32 +00:00
// SSE-S3 related API errors.
2020-07-22 13:02:32 +00:00
ErrInvalidEncryptionMethod
// Server-Side-Encryption (with Customer provided key) related API errors.
ErrInsecureSSECustomerRequest
ErrSSEMultipartEncrypted
ErrSSEEncryptedObject
ErrInvalidEncryptionParameters
ErrInvalidSSECustomerAlgorithm
ErrInvalidSSECustomerKey
ErrMissingSSECustomerKey
ErrMissingSSECustomerKeyMD5
ErrSSECustomerKeyMD5Mismatch
ErrInvalidSSECustomerParameters
ErrIncompatibleEncryptionMethod
ErrKMSNotConfigured
ErrKMSAuthFailure
ErrNoAccessKey
ErrInvalidToken
// Bucket notification related errors.
ErrEventNotification
ErrARNNotification
ErrRegionNotification
ErrOverlappingFilterNotification
ErrFilterNameInvalid
ErrFilterNamePrefix
ErrFilterNameSuffix
ErrFilterValueInvalid
ErrOverlappingConfigs
ErrUnsupportedNotification
// S3 extended errors.
ErrContentSHA256Mismatch
// Add new extended error codes here.
// MinIO extended errors.
2021-05-13 19:25:32 +00:00
// ErrReadQuorum
// ErrWriteQuorum
2020-07-22 13:02:32 +00:00
ErrParentIsObject
ErrStorageFull
ErrRequestBodyParse
ErrObjectExistsAsDirectory
ErrInvalidObjectName
ErrInvalidObjectNamePrefixSlash
ErrInvalidResourceName
ErrServerNotInitialized
ErrOperationTimedOut
ErrOperationMaxedOut
ErrInvalidRequest
2021-05-13 19:25:32 +00:00
// MinIO storage class error codes.
2020-07-22 13:02:32 +00:00
ErrInvalidStorageClass
ErrBackendDown
// Add new extended error codes here.
// Please open a https://github.com/minio/minio/issues before adding
// new error codes here.
ErrMalformedJSON
ErrAdminNoSuchUser
ErrAdminNoSuchGroup
ErrAdminGroupNotEmpty
ErrAdminNoSuchPolicy
ErrAdminInvalidArgument
ErrAdminInvalidAccessKey
ErrAdminInvalidSecretKey
ErrAdminConfigNoQuorum
ErrAdminConfigTooLarge
ErrAdminConfigBadJSON
ErrAdminConfigDuplicateKeys
ErrAdminCredentialsMismatch
ErrInsecureClientRequest
ErrObjectTampered
2021-05-13 19:25:32 +00:00
// Bucket Quota error codes.
2020-07-22 13:02:32 +00:00
ErrAdminBucketQuotaExceeded
ErrAdminNoSuchQuotaConfiguration
ErrAdminBucketQuotaDisabled
ErrHealNotImplemented
ErrHealNoSuchProcess
ErrHealInvalidClientToken
ErrHealMissingBucket
ErrHealAlreadyRunning
ErrHealOverlappingPaths
ErrIncorrectContinuationToken
2021-05-13 19:25:32 +00:00
// S3 Select Errors.
2020-07-22 13:02:32 +00:00
ErrEmptyRequestBody
ErrUnsupportedFunction
ErrInvalidExpressionType
ErrBusy
ErrUnauthorizedAccess
ErrExpressionTooLong
ErrIllegalSQLFunctionArgument
ErrInvalidKeyPath
ErrInvalidCompressionFormat
ErrInvalidFileHeaderInfo
ErrInvalidJSONType
ErrInvalidQuoteFields
ErrInvalidRequestParameter
ErrInvalidDataType
ErrInvalidTextEncoding
ErrInvalidDataSource
ErrInvalidTableAlias
ErrMissingRequiredParameter
ErrObjectSerializationConflict
ErrUnsupportedSQLOperation
ErrUnsupportedSQLStructure
ErrUnsupportedSyntax
ErrUnsupportedRangeHeader
ErrLexerInvalidChar
ErrLexerInvalidOperator
ErrLexerInvalidLiteral
ErrLexerInvalidIONLiteral
ErrParseExpectedDatePart
ErrParseExpectedKeyword
ErrParseExpectedTokenType
ErrParseExpected2TokenTypes
ErrParseExpectedNumber
ErrParseExpectedRightParenBuiltinFunctionCall
ErrParseExpectedTypeName
ErrParseExpectedWhenClause
ErrParseUnsupportedToken
ErrParseUnsupportedLiteralsGroupBy
ErrParseExpectedMember
ErrParseUnsupportedSelect
ErrParseUnsupportedCase
ErrParseUnsupportedCaseClause
ErrParseUnsupportedAlias
ErrParseUnsupportedSyntax
ErrParseUnknownOperator
ErrParseMissingIdentAfterAt
ErrParseUnexpectedOperator
ErrParseUnexpectedTerm
ErrParseUnexpectedToken
ErrParseUnexpectedKeyword
ErrParseExpectedExpression
ErrParseExpectedLeftParenAfterCast
ErrParseExpectedLeftParenValueConstructor
ErrParseExpectedLeftParenBuiltinFunctionCall
ErrParseExpectedArgumentDelimiter
ErrParseCastArity
ErrParseInvalidTypeParam
ErrParseEmptySelect
ErrParseSelectMissingFrom
ErrParseExpectedIdentForGroupName
ErrParseExpectedIdentForAlias
ErrParseUnsupportedCallWithStar
ErrParseNonUnaryAgregateFunctionCall
ErrParseMalformedJoin
ErrParseExpectedIdentForAt
ErrParseAsteriskIsNotAloneInSelectList
ErrParseCannotMixSqbAndWildcardInSelectList
ErrParseInvalidContextForWildcardInSelectList
ErrIncorrectSQLFunctionArgumentType
ErrValueParseFailure
ErrEvaluatorInvalidArguments
ErrIntegerOverflow
ErrLikeInvalidInputs
ErrCastFailed
ErrInvalidCast
ErrEvaluatorInvalidTimestampFormatPattern
ErrEvaluatorInvalidTimestampFormatPatternSymbolForParsing
ErrEvaluatorTimestampFormatPatternDuplicateFields
ErrEvaluatorTimestampFormatPatternHourClockAmPmMismatch
ErrEvaluatorUnterminatedTimestampFormatPatternToken
ErrEvaluatorInvalidTimestampFormatPatternToken
ErrEvaluatorInvalidTimestampFormatPatternSymbol
ErrEvaluatorBindingDoesNotExist
ErrMissingHeaders
ErrInvalidColumnIndex
ErrAdminConfigNotificationTargetsFailed
ErrAdminProfilerNotEnabled
ErrInvalidDecompressedSize
ErrAddUserInvalidArgument
ErrAdminAccountNotEligible
ErrServiceAccountNotFound
ErrPostPolicyConditionInvalidFormat
)
// error code to Error structure, these fields carry respective
// descriptions for all the error responses.
var errorCodes = errorCodeMap {
ErrInvalidCopyDest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCopyDest ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "This copy request is illegal because it is trying to copy an object to itself without changing the object's metadata, storage class, website redirect location or encryption attributes." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidCopySource : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCopySource ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Copy Source must mention the source bucket and key: sourcebucket/sourcekey." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidMetadataDirective : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidMetadataDirective ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Unknown metadata directive." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidStorageClass : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidStorageClass ,
2020-07-22 13:02:32 +00:00
Code : "InvalidStorageClass" ,
Description : "Invalid storage class." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidRequestBody : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRequestBody ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Body shouldn't be set for this request." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidMaxUploads : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidMaxUploads ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Argument max-uploads must be an integer between 0 and 2147483647" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidMaxKeys : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidMaxKeys ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Argument maxKeys must be an integer between 0 and 2147483647" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidEncodingMethod : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidEncodingMethod ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Invalid Encoding Method specified in Request" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidMaxParts : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidMaxParts ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Argument max-parts must be an integer between 0 and 2147483647" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidPartNumberMarker : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidPartNumberMarker ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Argument partNumberMarker must be an integer." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidPolicyDocument : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidPolicyDocument ,
2020-07-22 13:02:32 +00:00
Code : "InvalidPolicyDocument" ,
Description : "The content of the form does not meet the conditions specified in the policy document." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAccessDenied : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAccessDenied ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "Access Denied." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrBadDigest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBadDigest ,
2020-07-22 13:02:32 +00:00
Code : "BadDigest" ,
Description : "The Content-Md5 you specified did not match what we received." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEntityTooSmall : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEntityTooSmall ,
2020-07-22 13:02:32 +00:00
Code : "EntityTooSmall" ,
Description : "Your proposed upload is smaller than the minimum allowed object size." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEntityTooLarge : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEntityTooLarge ,
2020-07-22 13:02:32 +00:00
Code : "EntityTooLarge" ,
Description : "Your proposed upload exceeds the maximum allowed object size." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrPolicyTooLarge : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrPolicyTooLarge ,
2020-07-22 13:02:32 +00:00
Code : "PolicyTooLarge" ,
Description : "Policy exceeds the maximum allowed document size." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
2021-06-25 12:54:25 +00:00
ErrIllegalVersioningConfigurationException : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIllegalVersioningConfigurationException ,
2021-06-25 12:54:25 +00:00
Code : "IllegalVersioningConfigurationException" ,
Description : "Indicates that the versioning configuration specified in the request is invalid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
2020-07-22 13:02:32 +00:00
ErrIncompleteBody : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIncompleteBody ,
2020-07-22 13:02:32 +00:00
Code : "IncompleteBody" ,
Description : "You did not provide the number of bytes specified by the Content-Length HTTP header." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInternalError : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInternalError ,
2020-07-22 13:02:32 +00:00
Code : "InternalError" ,
Description : "We encountered an internal error, please try again." ,
HTTPStatusCode : http . StatusInternalServerError ,
} ,
ErrInvalidAccessKeyID : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidAccessKeyID ,
2020-07-22 13:02:32 +00:00
Code : "InvalidAccessKeyId" ,
Description : "The Access Key Id you provided does not exist in our records." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrInvalidBucketName : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidBucketName ,
2020-07-22 13:02:32 +00:00
Code : "InvalidBucketName" ,
Description : "The specified bucket is not valid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidDigest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidDigest ,
2020-07-22 13:02:32 +00:00
Code : "InvalidDigest" ,
Description : "The Content-Md5 you specified is not valid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidRange : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRange ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRange" ,
Description : "The requested range is not satisfiable" ,
HTTPStatusCode : http . StatusRequestedRangeNotSatisfiable ,
} ,
ErrMalformedXML : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedXML ,
2020-07-22 13:02:32 +00:00
Code : "MalformedXML" ,
Description : "The XML you provided was not well-formed or did not validate against our published schema." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingContentLength : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingContentLength ,
2020-07-22 13:02:32 +00:00
Code : "MissingContentLength" ,
Description : "You must provide the Content-Length HTTP header." ,
HTTPStatusCode : http . StatusLengthRequired ,
} ,
ErrMissingContentMD5 : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingContentMD5 ,
2020-07-22 13:02:32 +00:00
Code : "MissingContentMD5" ,
Description : "Missing required header for this request: Content-Md5." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingSecurityHeader : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingSecurityHeader ,
2020-07-22 13:02:32 +00:00
Code : "MissingSecurityHeader" ,
Description : "Your request was missing a required header" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingRequestBodyError : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingRequestBodyError ,
2020-07-22 13:02:32 +00:00
Code : "MissingRequestBodyError" ,
Description : "Request body is empty." ,
HTTPStatusCode : http . StatusLengthRequired ,
} ,
ErrNoSuchBucket : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchBucket ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchBucket" ,
Description : "The specified bucket does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchBucketPolicy : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchBucketPolicy ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchBucketPolicy" ,
Description : "The bucket policy does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchBucketLifecycle : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchBucketLifecycle ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchBucketLifecycle" ,
Description : "The bucket lifecycle configuration does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchLifecycleConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchLifecycleConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchLifecycleConfiguration" ,
Description : "The lifecycle configuration does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchBucketSSEConfig : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchBucketSSEConfig ,
2020-07-22 13:02:32 +00:00
Code : "ServerSideEncryptionConfigurationNotFoundError" ,
Description : "The server side encryption configuration was not found" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchKey ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchKey" ,
Description : "The specified key does not exist." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchUpload : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchUpload ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchUpload" ,
Description : "The specified multipart upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchVersion : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchVersion ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchVersion" ,
Description : "Indicates that the version ID specified in the request does not match an existing version." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNotImplemented : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNotImplemented ,
2020-07-22 13:02:32 +00:00
Code : "NotImplemented" ,
Description : "A header you provided implies functionality that is not implemented" ,
HTTPStatusCode : http . StatusNotImplemented ,
} ,
ErrPreconditionFailed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrPreconditionFailed ,
2020-07-22 13:02:32 +00:00
Code : "PreconditionFailed" ,
Description : "At least one of the pre-conditions you specified did not hold" ,
HTTPStatusCode : http . StatusPreconditionFailed ,
} ,
2021-07-14 12:51:45 +00:00
ErrNotModified : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNotModified ,
2021-07-14 12:51:45 +00:00
Code : "NotModified" ,
Description : "The resource was not changed." ,
HTTPStatusCode : http . StatusNotModified ,
} ,
2020-07-22 13:02:32 +00:00
ErrRequestTimeTooSkewed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrRequestTimeTooSkewed ,
2020-07-22 13:02:32 +00:00
Code : "RequestTimeTooSkewed" ,
Description : "The difference between the request time and the server's time is too large." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrSignatureDoesNotMatch : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSignatureDoesNotMatch ,
2020-07-22 13:02:32 +00:00
Code : "SignatureDoesNotMatch" ,
Description : "The request signature we calculated does not match the signature you provided. Check your key and signing method." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrMethodNotAllowed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMethodNotAllowed ,
2020-07-22 13:02:32 +00:00
Code : "MethodNotAllowed" ,
Description : "The specified method is not allowed against this resource." ,
HTTPStatusCode : http . StatusMethodNotAllowed ,
} ,
ErrInvalidPart : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidPart ,
2020-07-22 13:02:32 +00:00
Code : "InvalidPart" ,
Description : "One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidPartOrder : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidPartOrder ,
2020-07-22 13:02:32 +00:00
Code : "InvalidPartOrder" ,
Description : "The list of parts was not in ascending order. The parts list must be specified in order by part number." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidObjectState : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidObjectState ,
2020-07-22 13:02:32 +00:00
Code : "InvalidObjectState" ,
Description : "The operation is not valid for the current state of the object." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrAuthorizationHeaderMalformed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAuthorizationHeaderMalformed ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationHeaderMalformed" ,
Description : "The authorization header is malformed; the region is wrong; expecting 'us-east-1'." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMalformedPOSTRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedPOSTRequest ,
2020-07-22 13:02:32 +00:00
Code : "MalformedPOSTRequest" ,
Description : "The body of your POST request is not well-formed multipart/form-data." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrPOSTFileRequired : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrPOSTFileRequired ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "POST requires exactly one file upload per request." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrSignatureVersionNotSupported : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSignatureVersionNotSupported ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBucketNotEmpty : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBucketNotEmpty ,
2020-07-22 13:02:32 +00:00
Code : "BucketNotEmpty" ,
Description : "The bucket you tried to delete is not empty" ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrBucketAlreadyExists : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBucketAlreadyExists ,
2020-07-22 13:02:32 +00:00
Code : "BucketAlreadyExists" ,
Description : "The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again." ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrAllAccessDisabled : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAllAccessDisabled ,
2020-07-22 13:02:32 +00:00
Code : "AllAccessDisabled" ,
Description : "All access to this bucket has been disabled." ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrMalformedPolicy : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedPolicy ,
2020-07-22 13:02:32 +00:00
Code : "MalformedPolicy" ,
Description : "Policy has invalid resource." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingFields : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingFields ,
2020-07-22 13:02:32 +00:00
Code : "MissingFields" ,
Description : "Missing fields in request." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingCredTag : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingCredTag ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Missing Credential field for this request." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrCredMalformed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrCredMalformed ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting \"<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMalformedDate : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedDate ,
2020-07-22 13:02:32 +00:00
Code : "MalformedDate" ,
Description : "Invalid date format header, expected to be in ISO8601, RFC1123 or RFC1123Z time format." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMalformedPresignedDate : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedPresignedDate ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "X-Amz-Date must be in the ISO8601 Long Format \"yyyyMMdd'T'HHmmss'Z'\"" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; incorrect date format \"%s\". This date in the credential must be in the format \"yyyyMMdd\".",
// Need changes to make sure variable messages can be constructed.
ErrMalformedCredentialDate : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedCredentialDate ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "Error parsing the X-Amz-Credential parameter; incorrect date format \"%s\". This date in the credential must be in the format \"yyyyMMdd\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; the region 'us-east-' is wrong; expecting 'us-east-1'".
// Need changes to make sure variable messages can be constructed.
ErrMalformedCredentialRegion : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedCredentialRegion ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "Error parsing the X-Amz-Credential parameter; the region is wrong;" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidRegion : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRegion ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRegion" ,
Description : "Region does not match." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// right Description: "Error parsing the X-Amz-Credential parameter; incorrect service \"s4\". This endpoint belongs to \"s3\".".
// Need changes to make sure variable messages can be constructed.
ErrInvalidServiceS3 : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidServiceS3 ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationParametersError" ,
Description : "Error parsing the Credential/X-Amz-Credential parameter; incorrect service. This endpoint belongs to \"s3\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidServiceSTS : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidServiceSTS ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationParametersError" ,
Description : "Error parsing the Credential parameter; incorrect service. This endpoint belongs to \"sts\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// FIXME: Should contain the invalid param set as seen in https://github.com/minio/minio/issues/2385.
// Description: "Error parsing the X-Amz-Credential parameter; incorrect terminal "aws4_reque". This endpoint uses "aws4_request".
// Need changes to make sure variable messages can be constructed.
ErrInvalidRequestVersion : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRequestVersion ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "Error parsing the X-Amz-Credential parameter; incorrect terminal. This endpoint uses \"aws4_request\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingSignTag : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingSignTag ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "Signature header missing Signature field." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingSignHeadersTag : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingSignHeadersTag ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Signature header missing SignedHeaders field." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMalformedExpires : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedExpires ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "X-Amz-Expires should be a number" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrNegativeExpires : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNegativeExpires ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "X-Amz-Expires must be non-negative" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAuthHeaderEmpty : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAuthHeaderEmpty ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Authorization header is invalid -- one and only one ' ' (space) required." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingDateHeader : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingDateHeader ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "AWS authentication requires a valid Date or x-amz-date header" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidQuerySignatureAlgo : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidQuerySignatureAlgo ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "X-Amz-Algorithm only supports \"AWS4-HMAC-SHA256\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrExpiredPresignRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrExpiredPresignRequest ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "Request has expired" ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrRequestNotReadyYet : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrRequestNotReadyYet ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "Request is not valid yet" ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrSlowDown : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSlowDown ,
2020-07-22 13:02:32 +00:00
Code : "SlowDown" ,
Description : "Please reduce your request" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrInvalidPrefixMarker : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidPrefixMarker ,
2020-07-22 13:02:32 +00:00
Code : "InvalidPrefixMarker" ,
Description : "Invalid marker prefix combination" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBadRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBadRequest ,
2020-07-22 13:02:32 +00:00
Code : "BadRequest" ,
Description : "400 BadRequest" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrKeyTooLongError : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrKeyTooLongError ,
2020-07-22 13:02:32 +00:00
Code : "KeyTooLongError" ,
Description : "Your key is too long" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// FIXME: Actual XML error response also contains the header which missed in list of signed header parameters.
ErrUnsignedHeaders : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsignedHeaders ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "There were headers present in the request which were not signed" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidQueryParams : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidQueryParams ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "Query-string authentication version 4 requires the X-Amz-Algorithm, X-Amz-Credential, X-Amz-Signature, X-Amz-Date, X-Amz-SignedHeaders, and X-Amz-Expires parameters." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBucketAlreadyOwnedByYou : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBucketAlreadyOwnedByYou ,
2020-07-22 13:02:32 +00:00
Code : "BucketAlreadyOwnedByYou" ,
Description : "Your previous request to create the named bucket succeeded and you already own it." ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrInvalidDuration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidDuration ,
2020-07-22 13:02:32 +00:00
Code : "InvalidDuration" ,
Description : "Duration provided in the request is invalid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidBucketObjectLockConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidBucketObjectLockConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Bucket is missing ObjectLockConfiguration" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBucketTaggingNotFound : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBucketTaggingNotFound ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchTagSet" ,
Description : "The TagSet does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrObjectLockConfigurationNotFound : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectLockConfigurationNotFound ,
2020-07-22 13:02:32 +00:00
Code : "ObjectLockConfigurationNotFoundError" ,
Description : "Object Lock configuration does not exist for this bucket" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrObjectLockConfigurationNotAllowed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectLockConfigurationNotAllowed ,
2020-07-22 13:02:32 +00:00
Code : "InvalidBucketState" ,
Description : "Object Lock configuration cannot be enabled on existing buckets" ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrNoSuchCORSConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchCORSConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchCORSConfiguration" ,
Description : "The CORS configuration does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchWebsiteConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchWebsiteConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchWebsiteConfiguration" ,
Description : "The specified bucket does not have a website configuration" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrReplicationConfigurationNotFoundError : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrReplicationConfigurationNotFoundError ,
2020-07-22 13:02:32 +00:00
Code : "ReplicationConfigurationNotFoundError" ,
Description : "The replication configuration was not found" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrNoSuchObjectLockConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoSuchObjectLockConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "NoSuchObjectLockConfiguration" ,
Description : "The specified object does not have a ObjectLock configuration" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrObjectLocked : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectLocked ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Object is WORM protected and cannot be overwritten" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidRetentionDate : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRetentionDate ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Date must be provided in ISO 8601 format" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrPastObjectLockRetainDate : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrPastObjectLockRetainDate ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "the retain until date must be in the future" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnknownWORMModeDirective : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnknownWORMModeDirective ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "unknown wormMode directive" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrObjectLockInvalidHeaders : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectLockInvalidHeaders ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "x-amz-object-lock-retain-until-date and x-amz-object-lock-mode must both be supplied" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// Bucket notification related errors.
ErrEventNotification : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEventNotification ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "A specified event is not supported for notifications." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrARNNotification : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrARNNotification ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "A specified destination ARN does not exist or is not well-formed. Verify the destination ARN." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrRegionNotification : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrRegionNotification ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "A specified destination is in a different region than the bucket. You must use a destination that resides in the same region as the bucket." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrOverlappingFilterNotification : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrOverlappingFilterNotification ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "An object key name filtering rule defined with overlapping prefixes, overlapping suffixes, or overlapping combinations of prefixes and suffixes for the same event types." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrFilterNameInvalid : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrFilterNameInvalid ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "filter rule name must be either prefix or suffix" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrFilterNamePrefix : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrFilterNamePrefix ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Cannot specify more than one prefix rule in a filter." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrFilterNameSuffix : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrFilterNameSuffix ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Cannot specify more than one suffix rule in a filter." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrFilterValueInvalid : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrFilterValueInvalid ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Size of filter rule value cannot exceed 1024 bytes in UTF-8 representation" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrOverlappingConfigs : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrOverlappingConfigs ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Configurations overlap. Configurations on the same bucket cannot share a common event type." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedNotification : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedNotification ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedNotification" ,
Description : "MinIO server does not support Topic or Cloud Function based notifications." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidCopyPartRange : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCopyPartRange ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "The x-amz-copy-source-range value must be of the form bytes=first-last where first and last are the zero-based offsets of the first and last bytes to copy" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidCopyPartRangeSource : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCopyPartRangeSource ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Range specified is not valid for source object" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMetadataTooLarge : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMetadataTooLarge ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Your metadata headers exceed the maximum allowed metadata size." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidTagDirective : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidTagDirective ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Unknown tag directive." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidEncryptionMethod : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidEncryptionMethod ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "The encryption method specified is not supported" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInsecureSSECustomerRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInsecureSSECustomerRequest ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Requests specifying Server Side Encryption with Customer provided keys must be made over a secure connection." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrSSEMultipartEncrypted : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSSEMultipartEncrypted ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "The multipart upload initiate requested encryption. Subsequent part requests must include the appropriate encryption parameters." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrSSEEncryptedObject : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSSEEncryptedObject ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "The object was stored using a form of Server Side Encryption. The correct parameters must be provided to retrieve the object." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidEncryptionParameters : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidEncryptionParameters ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "The encryption parameters are not applicable to this object." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidSSECustomerAlgorithm : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidSSECustomerAlgorithm ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Requests specifying Server Side Encryption with Customer provided keys must provide a valid encryption algorithm." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidSSECustomerKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidSSECustomerKey ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "The secret key was invalid for the specified algorithm." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingSSECustomerKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingSSECustomerKey ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Requests specifying Server Side Encryption with Customer provided keys must provide an appropriate secret key." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingSSECustomerKeyMD5 : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingSSECustomerKeyMD5 ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Requests specifying Server Side Encryption with Customer provided keys must provide the client calculated MD5 of the secret key." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrSSECustomerKeyMD5Mismatch : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrSSECustomerKeyMD5Mismatch ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "The calculated MD5 hash of the key did not match the hash that was provided." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidSSECustomerParameters : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidSSECustomerParameters ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "The provided encryption parameters did not match the ones used originally." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrIncompatibleEncryptionMethod : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIncompatibleEncryptionMethod ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Server side encryption specified with both SSE-C and SSE-S3 headers" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrKMSNotConfigured : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrKMSNotConfigured ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Server side encryption specified but KMS is not configured" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrKMSAuthFailure : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrKMSAuthFailure ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Server side encryption specified but KMS authorization failed" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrNoAccessKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrNoAccessKey ,
2020-07-22 13:02:32 +00:00
Code : "AccessDenied" ,
Description : "No AWSAccessKey was presented" ,
HTTPStatusCode : http . StatusForbidden ,
} ,
ErrInvalidToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidToken ,
2020-07-22 13:02:32 +00:00
Code : "InvalidTokenId" ,
Description : "The security token included in the request is invalid" ,
HTTPStatusCode : http . StatusForbidden ,
} ,
// S3 extensions.
ErrContentSHA256Mismatch : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrContentSHA256Mismatch ,
2020-07-22 13:02:32 +00:00
Code : "XAmzContentSHA256Mismatch" ,
Description : "The provided 'x-amz-content-sha256' header does not match what was computed." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// MinIO extensions.
ErrStorageFull : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrStorageFull ,
2020-07-22 13:02:32 +00:00
Code : "XMinioStorageFull" ,
Description : "Storage backend has reached its minimum free disk threshold. Please delete a few objects to proceed." ,
HTTPStatusCode : http . StatusInsufficientStorage ,
} ,
ErrParentIsObject : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParentIsObject ,
2020-07-22 13:02:32 +00:00
Code : "XMinioParentIsObject" ,
Description : "Object-prefix is already an object, please choose a different object-prefix name." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrRequestBodyParse : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrRequestBodyParse ,
2020-07-22 13:02:32 +00:00
Code : "XMinioRequestBodyParse" ,
Description : "The request body failed to parse." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrObjectExistsAsDirectory : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectExistsAsDirectory ,
2020-07-22 13:02:32 +00:00
Code : "XMinioObjectExistsAsDirectory" ,
Description : "Object name already exists as a directory." ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrInvalidObjectName : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidObjectName ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidObjectName" ,
Description : "Object name contains unsupported characters." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidObjectNamePrefixSlash : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidObjectNamePrefixSlash ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidObjectName" ,
Description : "Object name contains a leading slash." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidResourceName : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidResourceName ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidResourceName" ,
Description : "Resource name contains bad components such as \"..\" or \".\"." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrServerNotInitialized : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrServerNotInitialized ,
2020-07-22 13:02:32 +00:00
Code : "XMinioServerNotInitialized" ,
Description : "Server not initialized, please try again." ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrMalformedJSON : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMalformedJSON ,
2020-07-22 13:02:32 +00:00
Code : "XMinioMalformedJSON" ,
Description : "The JSON you provided was not well-formed or did not validate against our published format." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminNoSuchUser : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminNoSuchUser ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminNoSuchUser" ,
Description : "The specified user does not exist." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrAdminNoSuchGroup : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminNoSuchGroup ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminNoSuchGroup" ,
Description : "The specified group does not exist." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrAdminGroupNotEmpty : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminGroupNotEmpty ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminGroupNotEmpty" ,
Description : "The specified group is not empty - cannot remove it." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminNoSuchPolicy : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminNoSuchPolicy ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminNoSuchPolicy" ,
Description : "The canned policy does not exist." ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrAdminInvalidArgument : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminInvalidArgument ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminInvalidArgument" ,
Description : "Invalid arguments specified." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminInvalidAccessKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminInvalidAccessKey ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminInvalidAccessKey" ,
Description : "The access key is invalid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminInvalidSecretKey : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminInvalidSecretKey ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminInvalidSecretKey" ,
Description : "The secret key is invalid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminConfigNoQuorum : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminConfigNoQuorum ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminConfigNoQuorum" ,
Description : "Configuration update failed because server quorum was not met" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrAdminConfigTooLarge : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminConfigTooLarge ,
Code : "XMinioAdminConfigTooLarge" ,
2020-07-22 13:02:32 +00:00
Description : fmt . Sprintf ( "Configuration data provided exceeds the allowed maximum of %d bytes" ,
maxEConfigJSONSize ) ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminConfigBadJSON : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminConfigBadJSON ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminConfigBadJSON" ,
Description : "JSON configuration provided is of incorrect format" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminConfigDuplicateKeys : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminConfigDuplicateKeys ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminConfigDuplicateKeys" ,
Description : "JSON configuration provided has objects with duplicate keys" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminConfigNotificationTargetsFailed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminConfigNotificationTargetsFailed ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminNotificationTargetsTestFailed" ,
Description : "Configuration update failed due an unsuccessful attempt to connect to one or more notification servers" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminProfilerNotEnabled : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminProfilerNotEnabled ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminProfilerNotEnabled" ,
Description : "Unable to perform the requested operation because profiling is not enabled" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminCredentialsMismatch : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminCredentialsMismatch ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminCredentialsMismatch" ,
Description : "Credentials in config mismatch with server environment variables" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrAdminBucketQuotaExceeded : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminBucketQuotaExceeded ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminBucketQuotaExceeded" ,
Description : "Bucket quota exceeded" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAdminNoSuchQuotaConfiguration : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminNoSuchQuotaConfiguration ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminNoSuchQuotaConfiguration" ,
Description : "The quota configuration does not exist" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrAdminBucketQuotaDisabled : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminBucketQuotaDisabled ,
2020-07-22 13:02:32 +00:00
Code : "XMinioAdminBucketQuotaDisabled" ,
Description : "Quota specified but disk usage crawl is disabled on MinIO server" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInsecureClientRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInsecureClientRequest ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInsecureClientRequest" ,
Description : "Cannot respond to plain-text request from TLS-encrypted server" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrOperationTimedOut : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrOperationTimedOut ,
2020-07-22 13:02:32 +00:00
Code : "RequestTimeout" ,
Description : "A timeout occurred while trying to lock a resource, please reduce your request rate" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrOperationMaxedOut : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrOperationMaxedOut ,
2020-07-22 13:02:32 +00:00
Code : "SlowDown" ,
Description : "A timeout exceeded while waiting to proceed with the request, please reduce your request rate" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrUnsupportedMetadata : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedMetadata ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "Your metadata headers are not supported." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrObjectTampered : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectTampered ,
2020-07-22 13:02:32 +00:00
Code : "XMinioObjectTampered" ,
2020-08-06 12:02:13 +00:00
Description : "The requested object was modified and may be compromised" ,
2020-07-22 13:02:32 +00:00
HTTPStatusCode : http . StatusPartialContent ,
} ,
ErrMaximumExpires : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMaximumExpires ,
2020-07-22 13:02:32 +00:00
Code : "AuthorizationQueryParametersError" ,
Description : "X-Amz-Expires must be less than a week (in seconds); that is, the given X-Amz-Expires must be less than 604800 seconds" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// Generic Invalid-Request error. Should be used for response errors only for unlikely
// corner case errors for which introducing new ErrorCode is not worth it. LogIf()
// should be used to log the error at the source of the error for debugging purposes.
ErrInvalidRequest : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRequest ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequest" ,
Description : "Invalid Request" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealNotImplemented : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealNotImplemented ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealNotImplemented" ,
Description : "This server does not implement heal functionality." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealNoSuchProcess : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealNoSuchProcess ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealNoSuchProcess" ,
Description : "No such heal process is running on the server" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealInvalidClientToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealInvalidClientToken ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealInvalidClientToken" ,
Description : "Client token mismatch" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealMissingBucket : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealMissingBucket ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealMissingBucket" ,
Description : "A heal start request with a non-empty object-prefix parameter requires a bucket to be specified." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealAlreadyRunning : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealAlreadyRunning ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealAlreadyRunning" ,
Description : "" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrHealOverlappingPaths : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrHealOverlappingPaths ,
2020-07-22 13:02:32 +00:00
Code : "XMinioHealOverlappingPaths" ,
Description : "" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBackendDown : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBackendDown ,
2020-07-22 13:02:32 +00:00
Code : "XMinioBackendDown" ,
Description : "Object storage backend is unreachable" ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrIncorrectContinuationToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIncorrectContinuationToken ,
2020-07-22 13:02:32 +00:00
Code : "InvalidArgument" ,
Description : "The continuation token provided is incorrect" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
// S3 Select API Errors
ErrEmptyRequestBody : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEmptyRequestBody ,
2020-07-22 13:02:32 +00:00
Code : "EmptyRequestBody" ,
Description : "Request body cannot be empty." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedFunction : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedFunction ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedFunction" ,
Description : "Encountered an unsupported SQL function." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidDataSource : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidDataSource ,
2020-07-22 13:02:32 +00:00
Code : "InvalidDataSource" ,
Description : "Invalid data source type. Only CSV and JSON are supported at this time." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidExpressionType : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidExpressionType ,
2020-07-22 13:02:32 +00:00
Code : "InvalidExpressionType" ,
Description : "The ExpressionType is invalid. Only SQL expressions are supported at this time." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrBusy : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrBusy ,
2020-07-22 13:02:32 +00:00
Code : "Busy" ,
Description : "The service is unavailable. Please retry." ,
HTTPStatusCode : http . StatusServiceUnavailable ,
} ,
ErrUnauthorizedAccess : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnauthorizedAccess ,
2020-07-22 13:02:32 +00:00
Code : "UnauthorizedAccess" ,
Description : "You are not authorized to perform this operation" ,
HTTPStatusCode : http . StatusUnauthorized ,
} ,
ErrExpressionTooLong : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrExpressionTooLong ,
2020-07-22 13:02:32 +00:00
Code : "ExpressionTooLong" ,
Description : "The SQL expression is too long: The maximum byte-length for the SQL expression is 256 KB." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrIllegalSQLFunctionArgument : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIllegalSQLFunctionArgument ,
2020-07-22 13:02:32 +00:00
Code : "IllegalSqlFunctionArgument" ,
Description : "Illegal argument was used in the SQL function." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidKeyPath : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidKeyPath ,
2020-07-22 13:02:32 +00:00
Code : "InvalidKeyPath" ,
Description : "Key path in the SQL expression is invalid." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidCompressionFormat : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCompressionFormat ,
2020-07-22 13:02:32 +00:00
Code : "InvalidCompressionFormat" ,
Description : "The file is not in a supported compression format. Only GZIP is supported at this time." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidFileHeaderInfo : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidFileHeaderInfo ,
2020-07-22 13:02:32 +00:00
Code : "InvalidFileHeaderInfo" ,
Description : "The FileHeaderInfo is invalid. Only NONE, USE, and IGNORE are supported." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidJSONType : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidJSONType ,
2020-07-22 13:02:32 +00:00
Code : "InvalidJsonType" ,
Description : "The JsonType is invalid. Only DOCUMENT and LINES are supported at this time." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidQuoteFields : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidQuoteFields ,
2020-07-22 13:02:32 +00:00
Code : "InvalidQuoteFields" ,
Description : "The QuoteFields is invalid. Only ALWAYS and ASNEEDED are supported." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidRequestParameter : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidRequestParameter ,
2020-07-22 13:02:32 +00:00
Code : "InvalidRequestParameter" ,
Description : "The value of a parameter in SelectRequest element is invalid. Check the service API documentation and try again." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidDataType : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidDataType ,
2020-07-22 13:02:32 +00:00
Code : "InvalidDataType" ,
Description : "The SQL expression contains an invalid data type." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidTextEncoding : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidTextEncoding ,
2020-07-22 13:02:32 +00:00
Code : "InvalidTextEncoding" ,
Description : "Invalid encoding type. Only UTF-8 encoding is supported at this time." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidTableAlias : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidTableAlias ,
2020-07-22 13:02:32 +00:00
Code : "InvalidTableAlias" ,
Description : "The SQL expression contains an invalid table alias." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingRequiredParameter : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingRequiredParameter ,
2020-07-22 13:02:32 +00:00
Code : "MissingRequiredParameter" ,
Description : "The SelectRequest entity is missing a required parameter. Check the service documentation and try again." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrObjectSerializationConflict : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrObjectSerializationConflict ,
2020-07-22 13:02:32 +00:00
Code : "ObjectSerializationConflict" ,
Description : "The SelectRequest entity can only contain one of CSV or JSON. Check the service documentation and try again." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedSQLOperation : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedSQLOperation ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedSqlOperation" ,
Description : "Encountered an unsupported SQL operation." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedSQLStructure : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedSQLStructure ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedSqlStructure" ,
Description : "Encountered an unsupported SQL structure. Check the SQL Reference." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedSyntax : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedSyntax ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedSyntax" ,
Description : "Encountered invalid syntax." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrUnsupportedRangeHeader : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrUnsupportedRangeHeader ,
2020-07-22 13:02:32 +00:00
Code : "UnsupportedRangeHeader" ,
Description : "Range header is not supported for this operation." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrLexerInvalidChar : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrLexerInvalidChar ,
2020-07-22 13:02:32 +00:00
Code : "LexerInvalidChar" ,
Description : "The SQL expression contains an invalid character." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrLexerInvalidOperator : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrLexerInvalidOperator ,
2020-07-22 13:02:32 +00:00
Code : "LexerInvalidOperator" ,
Description : "The SQL expression contains an invalid literal." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrLexerInvalidLiteral : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrLexerInvalidLiteral ,
2020-07-22 13:02:32 +00:00
Code : "LexerInvalidLiteral" ,
Description : "The SQL expression contains an invalid operator." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrLexerInvalidIONLiteral : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrLexerInvalidIONLiteral ,
2020-07-22 13:02:32 +00:00
Code : "LexerInvalidIONLiteral" ,
Description : "The SQL expression contains an invalid operator." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedDatePart : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedDatePart ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedDatePart" ,
Description : "Did not find the expected date part in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedKeyword : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedKeyword ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedKeyword" ,
Description : "Did not find the expected keyword in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedTokenType : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedTokenType ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedTokenType" ,
Description : "Did not find the expected token in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpected2TokenTypes : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpected2TokenTypes ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpected2TokenTypes" ,
Description : "Did not find the expected token in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedNumber : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedNumber ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedNumber" ,
Description : "Did not find the expected number in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedRightParenBuiltinFunctionCall : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedRightParenBuiltinFunctionCall ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedRightParenBuiltinFunctionCall" ,
Description : "Did not find the expected right parenthesis character in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedTypeName : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedTypeName ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedTypeName" ,
Description : "Did not find the expected type name in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedWhenClause : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedWhenClause ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedWhenClause" ,
Description : "Did not find the expected WHEN clause in the SQL expression. CASE is not supported." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedToken ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedToken" ,
Description : "The SQL expression contains an unsupported token." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedLiteralsGroupBy : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedLiteralsGroupBy ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedLiteralsGroupBy" ,
Description : "The SQL expression contains an unsupported use of GROUP BY." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedMember : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedMember ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedMember" ,
Description : "The SQL expression contains an unsupported use of MEMBER." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedSelect : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedSelect ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedSelect" ,
Description : "The SQL expression contains an unsupported use of SELECT." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedCase : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedCase ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedCase" ,
Description : "The SQL expression contains an unsupported use of CASE." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedCaseClause : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedCaseClause ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedCaseClause" ,
Description : "The SQL expression contains an unsupported use of CASE." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedAlias : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedAlias ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedAlias" ,
Description : "The SQL expression contains an unsupported use of ALIAS." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedSyntax : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedSyntax ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedSyntax" ,
Description : "The SQL expression contains unsupported syntax." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnknownOperator : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnknownOperator ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnknownOperator" ,
Description : "The SQL expression contains an invalid operator." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseMissingIdentAfterAt : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseMissingIdentAfterAt ,
2020-07-22 13:02:32 +00:00
Code : "ParseMissingIdentAfterAt" ,
Description : "Did not find the expected identifier after the @ symbol in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnexpectedOperator : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnexpectedOperator ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnexpectedOperator" ,
Description : "The SQL expression contains an unexpected operator." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnexpectedTerm : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnexpectedTerm ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnexpectedTerm" ,
Description : "The SQL expression contains an unexpected term." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnexpectedToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnexpectedToken ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnexpectedToken" ,
Description : "The SQL expression contains an unexpected token." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnexpectedKeyword : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnexpectedKeyword ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnexpectedKeyword" ,
Description : "The SQL expression contains an unexpected keyword." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedExpression : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedExpression ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedExpression" ,
Description : "Did not find the expected SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedLeftParenAfterCast : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedLeftParenAfterCast ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedLeftParenAfterCast" ,
Description : "Did not find expected the left parenthesis in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedLeftParenValueConstructor : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedLeftParenValueConstructor ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedLeftParenValueConstructor" ,
Description : "Did not find expected the left parenthesis in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedLeftParenBuiltinFunctionCall : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedLeftParenBuiltinFunctionCall ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedLeftParenBuiltinFunctionCall" ,
Description : "Did not find the expected left parenthesis in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedArgumentDelimiter : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedArgumentDelimiter ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedArgumentDelimiter" ,
Description : "Did not find the expected argument delimiter in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseCastArity : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseCastArity ,
2020-07-22 13:02:32 +00:00
Code : "ParseCastArity" ,
Description : "The SQL expression CAST has incorrect arity." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseInvalidTypeParam : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseInvalidTypeParam ,
2020-07-22 13:02:32 +00:00
Code : "ParseInvalidTypeParam" ,
Description : "The SQL expression contains an invalid parameter value." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseEmptySelect : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseEmptySelect ,
2020-07-22 13:02:32 +00:00
Code : "ParseEmptySelect" ,
Description : "The SQL expression contains an empty SELECT." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseSelectMissingFrom : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseSelectMissingFrom ,
2020-07-22 13:02:32 +00:00
Code : "ParseSelectMissingFrom" ,
Description : "GROUP is not supported in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedIdentForGroupName : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedIdentForGroupName ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedIdentForGroupName" ,
Description : "GROUP is not supported in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedIdentForAlias : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedIdentForAlias ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedIdentForAlias" ,
Description : "Did not find the expected identifier for the alias in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseUnsupportedCallWithStar : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseUnsupportedCallWithStar ,
2020-07-22 13:02:32 +00:00
Code : "ParseUnsupportedCallWithStar" ,
Description : "Only COUNT with (*) as a parameter is supported in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseNonUnaryAgregateFunctionCall : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseNonUnaryAgregateFunctionCall ,
2020-07-22 13:02:32 +00:00
Code : "ParseNonUnaryAgregateFunctionCall" ,
Description : "Only one argument is supported for aggregate functions in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseMalformedJoin : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseMalformedJoin ,
2020-07-22 13:02:32 +00:00
Code : "ParseMalformedJoin" ,
Description : "JOIN is not supported in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseExpectedIdentForAt : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseExpectedIdentForAt ,
2020-07-22 13:02:32 +00:00
Code : "ParseExpectedIdentForAt" ,
Description : "Did not find the expected identifier for AT name in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseAsteriskIsNotAloneInSelectList : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseAsteriskIsNotAloneInSelectList ,
2020-07-22 13:02:32 +00:00
Code : "ParseAsteriskIsNotAloneInSelectList" ,
Description : "Other expressions are not allowed in the SELECT list when '*' is used without dot notation in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseCannotMixSqbAndWildcardInSelectList : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseCannotMixSqbAndWildcardInSelectList ,
2020-07-22 13:02:32 +00:00
Code : "ParseCannotMixSqbAndWildcardInSelectList" ,
Description : "Cannot mix [] and * in the same expression in a SELECT list in SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrParseInvalidContextForWildcardInSelectList : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrParseInvalidContextForWildcardInSelectList ,
2020-07-22 13:02:32 +00:00
Code : "ParseInvalidContextForWildcardInSelectList" ,
Description : "Invalid use of * in SELECT list in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrIncorrectSQLFunctionArgumentType : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIncorrectSQLFunctionArgumentType ,
2020-07-22 13:02:32 +00:00
Code : "IncorrectSqlFunctionArgumentType" ,
Description : "Incorrect type of arguments in function call in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrValueParseFailure : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrValueParseFailure ,
2020-07-22 13:02:32 +00:00
Code : "ValueParseFailure" ,
Description : "Time stamp parse failure in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorInvalidArguments : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorInvalidArguments ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidArguments" ,
Description : "Incorrect number of arguments in the function call in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrIntegerOverflow : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrIntegerOverflow ,
2020-07-22 13:02:32 +00:00
Code : "IntegerOverflow" ,
Description : "Int overflow or underflow in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrLikeInvalidInputs : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrLikeInvalidInputs ,
2020-07-22 13:02:32 +00:00
Code : "LikeInvalidInputs" ,
Description : "Invalid argument given to the LIKE clause in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrCastFailed : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrCastFailed ,
2020-07-22 13:02:32 +00:00
Code : "CastFailed" ,
Description : "Attempt to convert from one data type to another using CAST failed in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidCast : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidCast ,
2020-07-22 13:02:32 +00:00
Code : "InvalidCast" ,
Description : "Attempt to convert from one data type to another using CAST failed in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorInvalidTimestampFormatPattern : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorInvalidTimestampFormatPattern ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidTimestampFormatPattern" ,
Description : "Time stamp format pattern requires additional fields in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorInvalidTimestampFormatPatternSymbolForParsing : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorInvalidTimestampFormatPatternSymbolForParsing ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidTimestampFormatPatternSymbolForParsing" ,
Description : "Time stamp format pattern contains a valid format symbol that cannot be applied to time stamp parsing in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorTimestampFormatPatternDuplicateFields : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorTimestampFormatPatternDuplicateFields ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorTimestampFormatPatternDuplicateFields" ,
Description : "Time stamp format pattern contains multiple format specifiers representing the time stamp field in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorTimestampFormatPatternHourClockAmPmMismatch : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorTimestampFormatPatternHourClockAmPmMismatch ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorUnterminatedTimestampFormatPatternToken" ,
Description : "Time stamp format pattern contains unterminated token in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorUnterminatedTimestampFormatPatternToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorUnterminatedTimestampFormatPatternToken ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidTimestampFormatPatternToken" ,
Description : "Time stamp format pattern contains an invalid token in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorInvalidTimestampFormatPatternToken : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorInvalidTimestampFormatPatternToken ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidTimestampFormatPatternToken" ,
Description : "Time stamp format pattern contains an invalid token in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorInvalidTimestampFormatPatternSymbol : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorInvalidTimestampFormatPatternSymbol ,
2020-07-22 13:02:32 +00:00
Code : "EvaluatorInvalidTimestampFormatPatternSymbol" ,
Description : "Time stamp format pattern contains an invalid symbol in the SQL expression." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrEvaluatorBindingDoesNotExist : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrEvaluatorBindingDoesNotExist ,
2020-07-22 13:02:32 +00:00
Code : "ErrEvaluatorBindingDoesNotExist" ,
Description : "A column name or a path provided does not exist in the SQL expression" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrMissingHeaders : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrMissingHeaders ,
2020-07-22 13:02:32 +00:00
Code : "MissingHeaders" ,
Description : "Some headers in the query are missing from the file. Check the file and try again." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidColumnIndex : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidColumnIndex ,
2020-07-22 13:02:32 +00:00
Code : "InvalidColumnIndex" ,
Description : "The column index is invalid. Please check the service documentation and try again." ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrInvalidDecompressedSize : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrInvalidDecompressedSize ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidDecompressedSize" ,
Description : "The data provided is unfit for decompression" ,
HTTPStatusCode : http . StatusBadRequest ,
} ,
ErrAddUserInvalidArgument : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAddUserInvalidArgument ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidIAMCredentials" ,
Description : "User is not allowed to be same as admin access key" ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrAdminAccountNotEligible : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrAdminAccountNotEligible ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidIAMCredentials" ,
Description : "The administrator key is not eligible for this operation" ,
HTTPStatusCode : http . StatusConflict ,
} ,
ErrServiceAccountNotFound : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrServiceAccountNotFound ,
2020-07-22 13:02:32 +00:00
Code : "XMinioInvalidIAMCredentials" ,
Description : "The specified service account is not found" ,
HTTPStatusCode : http . StatusNotFound ,
} ,
ErrPostPolicyConditionInvalidFormat : {
2021-07-12 13:18:52 +00:00
ErrCode : ErrPostPolicyConditionInvalidFormat ,
2020-07-22 13:02:32 +00:00
Code : "PostPolicyInvalidKeyName" ,
Description : "Invalid according to Policy: Policy Condition failed" ,
HTTPStatusCode : http . StatusForbidden ,
} ,
// Add your error structure here.
}
2021-07-12 13:18:52 +00:00
// IsS3Error check if the provided error is a specific s3 error.
func IsS3Error ( err error , code ErrorCode ) bool {
e , ok := err . ( Error )
return ok && e . ErrCode == code
}
2020-07-22 13:02:32 +00:00
func ( e errorCodeMap ) ToAPIErrWithErr ( errCode ErrorCode , err error ) Error {
apiErr , ok := e [ errCode ]
if ! ok {
apiErr = e [ ErrInternalError ]
}
if err != nil {
apiErr . Description = fmt . Sprintf ( "%s (%s)" , apiErr . Description , err )
}
return apiErr
}
func ( e errorCodeMap ) ToAPIErr ( errCode ErrorCode ) Error {
return e . ToAPIErrWithErr ( errCode , nil )
}
2020-08-11 14:34:06 +00:00
func ( e Error ) Error ( ) string {
return fmt . Sprintf ( "%s: %d => %s" , e . Code , e . HTTPStatusCode , e . Description )
}
2020-07-24 16:10:41 +00:00
// GetAPIError provides API Error for input API error code.
func GetAPIError ( code ErrorCode ) Error {
2020-07-22 13:02:32 +00:00
if apiErr , ok := errorCodes [ code ] ; ok {
return apiErr
}
return errorCodes . ToAPIErr ( ErrInternalError )
}
// getErrorResponse gets in standard error and resource value and
2021-05-13 19:25:32 +00:00
// provides a encodable populated response values.
2020-08-22 02:36:53 +00:00
func getAPIErrorResponse ( ctx context . Context , err error , resource , requestID , hostID string ) ErrorResponse {
2021-07-14 16:06:24 +00:00
code := "InternalError"
2020-08-22 02:36:53 +00:00
desc := err . Error ( )
2020-08-11 11:30:02 +00:00
info := GetReqInfo ( ctx )
if info == nil {
info = & ReqInfo { }
}
2020-08-22 02:36:53 +00:00
if e , ok := err . ( Error ) ; ok {
code = e . Code
desc = e . Description
}
2020-07-22 13:02:32 +00:00
return ErrorResponse {
2020-08-22 02:36:53 +00:00
Code : code ,
Message : desc ,
2020-08-11 11:30:02 +00:00
BucketName : info . BucketName ,
Key : info . ObjectName ,
2020-07-22 13:02:32 +00:00
Resource : resource ,
RequestID : requestID ,
HostID : hostID ,
}
}
2020-08-06 12:02:13 +00:00
// SignatureDoesNotMatch - when content md5 does not match with what was sent from client.
type SignatureDoesNotMatch struct { }
func ( e SignatureDoesNotMatch ) Error ( ) string {
return "The request signature we calculated does not match the signature you provided. Check your key and signing method."
}
// StorageFull storage ran out of space.
type StorageFull struct { }
func ( e StorageFull ) Error ( ) string {
return "Storage reached its minimum free disk threshold."
}
// SlowDown too many file descriptors open or backend busy .
type SlowDown struct { }
func ( e SlowDown ) Error ( ) string {
return "Please reduce your request rate"
}
// InsufficientReadQuorum storage cannot satisfy quorum for read operation.
type InsufficientReadQuorum struct { }
func ( e InsufficientReadQuorum ) Error ( ) string {
return "Storage resources are insufficient for the read operation."
}
// InsufficientWriteQuorum storage cannot satisfy quorum for write operation.
type InsufficientWriteQuorum struct { }
func ( e InsufficientWriteQuorum ) Error ( ) string {
return "Storage resources are insufficient for the write operation."
}
// GenericError - generic object layer error.
type GenericError struct {
Bucket string
Object string
}
// BucketNotFound bucket does not exist.
type BucketNotFound GenericError
func ( e BucketNotFound ) Error ( ) string {
return "Bucket not found: " + e . Bucket
}
// BucketAlreadyExists the requested bucket name is not available.
type BucketAlreadyExists GenericError
func ( e BucketAlreadyExists ) Error ( ) string {
return "The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again."
}
// BucketAlreadyOwnedByYou already owned by you.
type BucketAlreadyOwnedByYou GenericError
func ( e BucketAlreadyOwnedByYou ) Error ( ) string {
return "Bucket already owned by you: " + e . Bucket
}
// BucketNotEmpty bucket is not empty.
type BucketNotEmpty GenericError
func ( e BucketNotEmpty ) Error ( ) string {
return "Bucket not empty: " + e . Bucket
}
// ObjectNotFound object does not exist.
type ObjectNotFound GenericError
func ( e ObjectNotFound ) Error ( ) string {
return "Object not found: " + e . Bucket + "#" + e . Object
}
// ObjectAlreadyExists object already exists.
type ObjectAlreadyExists GenericError
func ( e ObjectAlreadyExists ) Error ( ) string {
return "Object: " + e . Bucket + "#" + e . Object + " already exists"
}
// ObjectExistsAsDirectory object already exists as a directory.
type ObjectExistsAsDirectory GenericError
func ( e ObjectExistsAsDirectory ) Error ( ) string {
return "Object exists on : " + e . Bucket + " as directory " + e . Object
}
// PrefixAccessDenied object access is denied.
type PrefixAccessDenied GenericError
func ( e PrefixAccessDenied ) Error ( ) string {
return "Prefix access is denied: " + e . Bucket + SlashSeparator + e . Object
}
// ParentIsObject object access is denied.
type ParentIsObject GenericError
func ( e ParentIsObject ) Error ( ) string {
return "Parent is object " + e . Bucket + SlashSeparator + path . Dir ( e . Object )
}
// BucketExists bucket exists.
type BucketExists GenericError
func ( e BucketExists ) Error ( ) string {
return "Bucket exists: " + e . Bucket
}
// InvalidUploadIDKeyCombination - invalid upload id and key marker combination.
type InvalidUploadIDKeyCombination struct {
UploadIDMarker , KeyMarker string
}
func ( e InvalidUploadIDKeyCombination ) Error ( ) string {
return fmt . Sprintf ( "Invalid combination of uploadID marker '%s' and marker '%s'" , e . UploadIDMarker , e . KeyMarker )
}
// InvalidMarkerPrefixCombination - invalid marker and prefix combination.
type InvalidMarkerPrefixCombination struct {
Marker , Prefix string
}
func ( e InvalidMarkerPrefixCombination ) Error ( ) string {
return fmt . Sprintf ( "Invalid combination of marker '%s' and prefix '%s'" , e . Marker , e . Prefix )
}
// BucketPolicyNotFound - no bucket policy found.
type BucketPolicyNotFound GenericError
func ( e BucketPolicyNotFound ) Error ( ) string {
return "No bucket policy configuration found for bucket: " + e . Bucket
}
// BucketLifecycleNotFound - no bucket lifecycle found.
type BucketLifecycleNotFound GenericError
func ( e BucketLifecycleNotFound ) Error ( ) string {
return "No bucket lifecycle configuration found for bucket : " + e . Bucket
}
2021-05-13 19:25:32 +00:00
// BucketSSEConfigNotFound - no bucket encryption found.
2020-08-06 12:02:13 +00:00
type BucketSSEConfigNotFound GenericError
func ( e BucketSSEConfigNotFound ) Error ( ) string {
return "No bucket encryption configuration found for bucket: " + e . Bucket
}
2021-05-13 19:25:32 +00:00
// BucketTaggingNotFound - no bucket tags found.
2020-08-06 12:02:13 +00:00
type BucketTaggingNotFound GenericError
func ( e BucketTaggingNotFound ) Error ( ) string {
return "No bucket tags found for bucket: " + e . Bucket
}
2021-05-13 19:25:32 +00:00
// BucketObjectLockConfigNotFound - no bucket object lock config found.
2020-08-06 12:02:13 +00:00
type BucketObjectLockConfigNotFound GenericError
func ( e BucketObjectLockConfigNotFound ) Error ( ) string {
return "No bucket object lock configuration found for bucket: " + e . Bucket
}
// BucketQuotaConfigNotFound - no bucket quota config found.
type BucketQuotaConfigNotFound GenericError
func ( e BucketQuotaConfigNotFound ) Error ( ) string {
return "No quota config found for bucket : " + e . Bucket
}
// BucketQuotaExceeded - bucket quota exceeded.
type BucketQuotaExceeded GenericError
func ( e BucketQuotaExceeded ) Error ( ) string {
return "Bucket quota exceeded for bucket: " + e . Bucket
}
// Bucket related errors.
// BucketNameInvalid - bucketname provided is invalid.
type BucketNameInvalid GenericError
// Error returns string an error formatted as the given text.
func ( e BucketNameInvalid ) Error ( ) string {
return "Bucket name invalid: " + e . Bucket
}
// Object related errors.
// ObjectNameInvalid - object name provided is invalid.
type ObjectNameInvalid GenericError
// ObjectNameTooLong - object name too long.
type ObjectNameTooLong GenericError
// ObjectNamePrefixAsSlash - object name has a slash as prefix.
type ObjectNamePrefixAsSlash GenericError
// Error returns string an error formatted as the given text.
func ( e ObjectNameInvalid ) Error ( ) string {
return "Object name invalid: " + e . Bucket + "#" + e . Object
}
// Error returns string an error formatted as the given text.
func ( e ObjectNameTooLong ) Error ( ) string {
return "Object name too long: " + e . Bucket + "#" + e . Object
}
// Error returns string an error formatted as the given text.
func ( e ObjectNamePrefixAsSlash ) Error ( ) string {
return "Object name contains forward slash as pefix: " + e . Bucket + "#" + e . Object
}
2021-05-13 19:25:32 +00:00
// AllAccessDisabled All access to this object has been disabled.
2020-08-06 12:02:13 +00:00
type AllAccessDisabled GenericError
// Error returns string an error formatted as the given text.
func ( e AllAccessDisabled ) Error ( ) string {
return "All access to this object has been disabled"
}
// IncompleteBody You did not provide the number of bytes specified by the Content-Length HTTP header.
type IncompleteBody GenericError
// Error returns string an error formatted as the given text.
func ( e IncompleteBody ) Error ( ) string {
return e . Bucket + "#" + e . Object + "has incomplete body"
}
// InvalidRange - invalid range typed error.
type InvalidRange struct {
OffsetBegin int64
OffsetEnd int64
ResourceSize int64
}
func ( e InvalidRange ) Error ( ) string {
return fmt . Sprintf ( "The requested range \"bytes %d-%d/%d\" is not satisfiable." , e . OffsetBegin , e . OffsetEnd , e . ResourceSize )
}
// ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.
type ObjectTooLarge GenericError
func ( e ObjectTooLarge ) Error ( ) string {
return "size of the object greater than what is allowed(5G)"
}
// ObjectTooSmall error returned when the size of the object < what is expected.
type ObjectTooSmall GenericError
func ( e ObjectTooSmall ) Error ( ) string {
return "size of the object less than what is expected"
}
// OperationTimedOut - a timeout occurred.
type OperationTimedOut struct {
}
func ( e OperationTimedOut ) Error ( ) string {
return "Operation timed out"
}
// Multipart related errors.
// MalformedUploadID malformed upload id.
type MalformedUploadID struct {
UploadID string
}
func ( e MalformedUploadID ) Error ( ) string {
return "Malformed upload id " + e . UploadID
}
// InvalidUploadID invalid upload id.
type InvalidUploadID struct {
Bucket string
Object string
UploadID string
}
func ( e InvalidUploadID ) Error ( ) string {
return "Invalid upload id " + e . UploadID
}
2021-05-13 19:25:32 +00:00
// InvalidPart One or more of the specified parts could not be found.
2020-08-06 12:02:13 +00:00
type InvalidPart struct {
PartNumber int
ExpETag string
GotETag string
}
func ( e InvalidPart ) Error ( ) string {
return fmt . Sprintf ( "Specified part could not be found. PartNumber %d, Expected %s, got %s" ,
e . PartNumber , e . ExpETag , e . GotETag )
}
// PartTooSmall - error if part size is less than 5MB.
type PartTooSmall struct {
PartSize int64
PartNumber int
PartETag string
}
func ( e PartTooSmall ) Error ( ) string {
return fmt . Sprintf ( "Part size for %d should be at least 5MB" , e . PartNumber )
}
// PartTooBig returned if size of part is bigger than the allowed limit.
type PartTooBig struct { }
func ( e PartTooBig ) Error ( ) string {
return "Part size bigger than the allowed limit"
}
2021-05-13 19:25:32 +00:00
// InvalidETag error returned when the etag has changed on disk.
2020-08-06 12:02:13 +00:00
type InvalidETag struct { }
func ( e InvalidETag ) Error ( ) string {
return "etag of the object has changed"
}
2021-05-13 19:25:32 +00:00
// NotImplemented If a feature is not implemented.
2020-08-06 12:02:13 +00:00
type NotImplemented struct { }
func ( e NotImplemented ) Error ( ) string {
return "Not Implemented"
}
2021-05-13 19:25:32 +00:00
// UnsupportedMetadata - unsupported metadata.
2020-08-06 12:02:13 +00:00
type UnsupportedMetadata struct { }
func ( e UnsupportedMetadata ) Error ( ) string {
return "Unsupported headers in Metadata"
}
// BackendDown is returned for network errors or if the gateway's backend is down.
type BackendDown struct { }
func ( e BackendDown ) Error ( ) string {
return "Backend down"
}
2021-05-13 19:25:32 +00:00
// PreConditionFailed - Check if copy precondition failed.
2020-08-06 12:02:13 +00:00
type PreConditionFailed struct { }
func ( e PreConditionFailed ) Error ( ) string {
return "At least one of the pre-conditions you specified did not hold"
}
2020-08-22 02:36:53 +00:00
2021-05-13 19:25:32 +00:00
// DeleteError - returns when cant remove object.
2020-08-22 02:36:53 +00:00
type DeleteError struct {
Err error
Object string
}
func ( e DeleteError ) Error ( ) string {
return fmt . Sprintf ( "%s (%s)" , e . Err , e . Object )
}