Skip to content

Instantly share code, notes, and snippets.

@MisterPea
Created February 25, 2024 16:50
Show Gist options
  • Save MisterPea/abac478c94fd452ef83c7c7d177044c9 to your computer and use it in GitHub Desktop.
Save MisterPea/abac478c94fd452ef83c7c7d177044c9 to your computer and use it in GitHub Desktop.
AWS S3 Error Codes
const s3ErrorCodes = {
AccessControlListNotSupported: {
description: 'The bucket does not allow ACLs.',
httpStatusCode: '400 Bad Request'
},
AccessDenied: { description: 'Access Denied', httpStatusCode: '403 Forbidden' },
AccessPointAlreadyOwnedByYou: {
description: 'An access point with an identical name already exists in your account.',
httpStatusCode: '409 Conflict'
},
AccountProblem: {
description: 'There is a problem with your AWS account that prevents the operation from completing successfully. For further assistance, see Contact Us.',
httpStatusCode: '403 Forbidden'
},
AllAccessDisabled: {
description: 'All access to this Amazon S3 resource has been disabled. For further assistance, see Contact Us.',
httpStatusCode: '403 Forbidden'
},
AmbiguousGrantByEmailAddress: {
description: 'The email address that you provided is associated with more than one account.',
httpStatusCode: '400 Bad Request'
},
AuthorizationHeaderMalformed: {
description: 'The authorization header that you provided is not valid.',
httpStatusCode: '400 Bad Request'
},
BadDigest: {
description: 'The Content-MD5 or checksum value that you specified did not match what the server received.',
httpStatusCode: '400 Bad Request'
},
BucketAlreadyExists: {
description: 'The requested bucket name is not available. The bucket namespace is shared by all users of the system. Specify a different name and try again.',
httpStatusCode: '409 Conflict'
},
BucketAlreadyOwnedByYou: {
description: 'The bucket that you tried to create already exists, and you own it. Amazon S3 returns this error in all AWS Regions except in the US East (N. Virginia) Region(us-east-1). For legacy compatibility, if you re-create an existing bucket that you already own in us-east-1, Amazon S3returns 200 OK and resets the bucket access control lists(ACLs). For Amazon S3 on Outposts, the bucket that you tried to create already exists in your Outpost and you own it.',
httpStatusCode: '409 Conflict (in all Regions except us-east-1)'
},
BucketNotEmpty: {
description: 'The bucket that you tried to delete is not empty.',
httpStatusCode: '409 Conflict'
},
ClientTokenConflict: {
description: 'Your Multi-Region Access Point idempotency token was already used fora different request.',
httpStatusCode: '409 Conflict'
},
CredentialsNotSupported: {
description: 'This request does not support credentials.',
httpStatusCode: '400 Bad Request'
},
CrossLocationLoggingProhibited: {
description: 'Cross-Region logging is not allowed. Buckets in one AWS Region cannot log information to a bucket in anotherRegion.',
httpStatusCode: '403 Forbidden'
},
EntityTooSmall: {
description: 'Your proposed upload is smaller than the minimum allowed object size.',
httpStatusCode: '400 Bad Request'
},
EntityTooLarge: {
description: 'Your proposed upload exceeds the maximum allowed object size. For more information, seeAmazon Simple Storage Service endpoints and quotas in the AWS General Reference.',
httpStatusCode: '400 Bad Request'
},
ExpiredToken: {
description: 'The provided token has expired.',
httpStatusCode: '400 Bad Request'
},
IllegalLocationConstraintException: {
description: 'You are trying to access a bucket from a different Region than where the bucket exists. To avoid this error, use the --region option. For example:aws s3 cp aws example.txt s3://DOC-EXAMPLE-BUCKET/ --region ap-east-1.',
httpStatusCode: '400 Bad Request'
},
IllegalVersioningConfigurationException: {
description: 'The versioning configuration specified in the request is not valid.',
httpStatusCode: '400 Bad Request'
},
IncompleteBody: {
description: 'You did not provide the number of bytes specified by theContent-Length HTTP header.',
httpStatusCode: '400 Bad Request'
},
IncorrectNumberOfFilesInPostRequest: {
description: 'POST requires exactly one file upload per request.',
httpStatusCode: '400 Bad Request'
},
InlineDataTooLarge: {
description: 'The inline data exceeds the maximum allowed size.',
httpStatusCode: '400 Bad Request'
},
InternalError: {
description: 'An internal error occurred. Try again.',
httpStatusCode: '500 Internal Server Error'
},
InvalidAccessKeyId: {
description: 'The AWS access key ID that you provided does not exist in our records.',
httpStatusCode: '403 Forbidden'
},
InvalidAccessPoint: {
description: 'The specified access point name or account is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidAccessPointAliasError: {
description: 'The specified access point alias name is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidAddressingHeader: {
description: 'You must specify the Anonymous role.',
httpStatusCode: 'N/A'
},
InvalidArgument: {
description: 'This error might occur for the following reasons: The specified argument was not valid. The request was missing a required header. The specified argument was incomplete or in the wrong format. The specified argument must have a length greater than or equal to 3.',
httpStatusCode: '400 Bad Request'
},
InvalidBucketAclWithObjectOwnership: {
description: "Bucket cannot have ACLs set with ObjectOwnership'sBucketOwnerEnforced setting.",
httpStatusCode: '400 Bad Request'
},
InvalidBucketName: {
description: 'The specified bucket is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidBucketState: {
description: 'The request is not valid for the current state of the bucket.',
httpStatusCode: '409 Conflict'
},
InvalidDigest: {
description: 'The Content-MD5 or checksum value that you specified is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidEncryptionAlgorithmError: {
description: 'The encryption request that you specified is not valid. The valid value isAES256.',
httpStatusCode: '400 Bad Request'
},
InvalidLocationConstraint: {
description: 'The specified location (Region) constraint is not valid. For more information about selecting a Region for your buckets, see Buckets overview.',
httpStatusCode: '400 Bad Request'
},
InvalidObjectState: {
description: 'The operation is not valid for the current state of the object.',
httpStatusCode: '403 Forbidden'
},
InvalidPart: {
description: "One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag.",
httpStatusCode: '400 Bad Request'
},
InvalidPartOrder: {
description: 'The list of parts was not in ascending order. The parts list must be specified in orderby part number.',
httpStatusCode: '400 Bad Request'
},
InvalidPayer: {
description: 'All access to this object has been disabled. For further assistance, see Contact Us.',
httpStatusCode: '403 Forbidden'
},
InvalidPolicyDocument: {
description: 'The content of the form does not meet the conditions specified in the policy document.',
httpStatusCode: '400 Bad Request'
},
InvalidRange: {
description: 'The requested range is not valid for the request. Try another range.',
httpStatusCode: '416 Requested Range Not Satisfiable'
},
InvalidRequest: {
description: 'This error might occur for the following reasons: The request is using the wrong signature version. Use AWS4-HMAC-SHA256(Signature Version 4). An access point can be created only for an existing bucket. The access point is not in a state where it can be deleted. An access point can be listed only for an existing bucket. The next token is not valid. At least one action must be specified in a lifecycle rule. At least one lifecycle rule must be specified. The number of lifecycle rules must not exceed the allowed limit of 1000 rules. The range for the MaxResults parameter is not valid. SOAP requests must be made over an HTTPSconnection. Amazon S3 Transfer Acceleration is not supported for buckets with non-DNS compliant names. Amazon S3 Transfer Acceleration is not supported for buckets with periods (.) in their names. The Amazon S3 Transfer Acceleration endpoint supports only virtual style requests. Amazon S3 Transfer Acceleration is not configured on this bucket. Amazon S3 Transfer Acceleration is disabled on this bucket. Amazon S3 Transfer Acceleration is not supported on this bucket. For assistance, contactAWS Support. Amazon S3 Transfer Acceleration cannot be enabled on this bucket. For assistance, contactAWS Support. Conflicting values provided in HTTP headers and query parameters. Conflicting values provided in HTTP headers and POST form fields. CopyObject request made on objects larger than 5GB in size.',
httpStatusCode: '400 Bad Request'
},
InvalidSecurity: {
description: 'The provided security credentials are not valid.',
httpStatusCode: '403 Forbidden'
},
InvalidSOAPRequest: {
description: 'The SOAP request body is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidStorageClass: {
description: 'The storage class that you specified is not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidTargetBucketForLogging: {
description: 'The target bucket for logging either does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group.',
httpStatusCode: '400 Bad Request'
},
InvalidToken: {
description: 'The provided token is malformed or otherwise not valid.',
httpStatusCode: '400 Bad Request'
},
InvalidURI: {
description: "The specified URI couldn't be parsed.",
httpStatusCode: '400 Bad Request'
},
KeyTooLongError: {
description: 'Your key is too long.',
httpStatusCode: '400 Bad Request'
},
MalformedACLError: {
description: 'The ACL that you provided was not well formed or did not validate against our published schema.',
httpStatusCode: '400 Bad Request'
},
MalformedPOSTRequest: {
description: 'The body of your POST request is not well-formed multipart/form-data.',
httpStatusCode: '400 Bad Request'
},
MalformedXML: {
description: 'The XML that you provided was not well formed or did not validate against our published schema.',
httpStatusCode: '400 Bad Request'
},
MaxMessageLengthExceeded: {
description: 'Your request was too large.',
httpStatusCode: '400 Bad Request'
},
MaxPostPreDataLengthExceededError: {
description: 'Your POST request fields preceding the upload file were too large.',
httpStatusCode: '400 Bad Request'
},
MetadataTooLarge: {
description: 'Your metadata headers exceed the maximum allowed metadata size.',
httpStatusCode: '400 Bad Request'
},
MethodNotAllowed: {
description: 'The specified method is not allowed against this resource.',
httpStatusCode: '405 Method Not Allowed'
},
MissingAttachment: {
description: 'A SOAP attachment was expected, but none was found.',
httpStatusCode: 'N/A'
},
MissingContentLength: {
description: 'You must provide the Content-Length HTTP header.',
httpStatusCode: '411 Length Required'
},
MissingRequestBodyError: {
description: 'You sent an empty XML document as a request.',
httpStatusCode: '400 Bad Request'
},
MissingSecurityElement: {
description: 'The SOAP 1.1 request is missing a security element.',
httpStatusCode: '400 Bad Request'
},
MissingSecurityHeader: {
description: 'Your request is missing a required header.',
httpStatusCode: '400 Bad Request'
},
NoLoggingStatusForKey: {
description: 'There is no such thing as a logging status sub-resource for a key.',
httpStatusCode: '400 Bad Request'
},
NoSuchBucket: {
description: 'The specified bucket does not exist.',
httpStatusCode: '404 Not Found'
},
NoSuchBucketPolicy: {
description: 'The specified bucket does not have a bucket policy.',
httpStatusCode: '404 Not Found'
},
NoSuchCORSConfiguration: {
description: 'The specified bucket does not have a CORS configuration.',
httpStatusCode: '404 Not Found'
},
NoSuchKey: {
description: 'The specified key does not exist.',
httpStatusCode: '404 Not Found'
},
NoSuchLifecycleConfiguration: {
description: 'The specified lifecycle configuration does not exist.',
httpStatusCode: '404 Not Found'
},
NoSuchMultiRegionAccessPoint: {
description: 'The specified Multi-Region Access Point does not exist.',
httpStatusCode: '404 Not Found'
},
NoSuchWebsiteConfiguration: {
description: 'The specified bucket does not have a website configuration.',
httpStatusCode: '404 Not Found'
},
NoSuchTagSet: {
description: 'The specified tag does not exist.',
httpStatusCode: '404 Not Found'
},
NoSuchUpload: {
description: 'The specified multipart upload does not exist. The upload ID might not be valid, or the multipart upload might have been aborted or completed.',
httpStatusCode: '404 Not Found'
},
NoSuchVersion: {
description: 'The version ID specified in the request does not match an existing version.',
httpStatusCode: '404 Not Found'
},
NotImplemented: {
description: 'A header that you provided implies functionality that is not implemented.',
httpStatusCode: '501 Not Implemented'
},
NotModified: {
description: 'The resource was not changed.',
httpStatusCode: '304 Not Modified'
},
NotSignedUp: {
description: 'Your account is not signed up for the Amazon S3 service. You must sign up before you can useAmazon S3. You can sign up at the following URL: https://aws.amazon.com/s3',
httpStatusCode: '403 Forbidden'
},
OwnershipControlsNotFoundError: {
description: 'The bucket ownership controls were not found.',
httpStatusCode: '404 Not Found'
},
OperationAborted: {
description: 'A conflicting conditional operation is currently in progress against this resource. Try again.',
httpStatusCode: '409 Conflict'
},
PermanentRedirect: {
description: 'The bucket that you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint.',
httpStatusCode: '301 Moved Permanently'
},
PreconditionFailed: {
description: 'At least one of the preconditions that you specified did not hold.',
httpStatusCode: '412 Precondition Failed'
},
Redirect: {
description: 'Temporary redirect. You are being redirected to the bucket while the Domain Name System(DNS) server is being updated.',
httpStatusCode: '307 Moved Temporarily'
},
RequestHeaderSectionTooLarge: {
description: 'The request header and query parameters used to make the request exceed the maximum allowed size.',
httpStatusCode: '400 Bad Request'
},
RequestIsNotMultiPartContent: {
description: 'A bucket POST request must be of the enclosure-type multipart/form-data.',
httpStatusCode: '400 Bad Request'
},
RequestTimeout: {
description: 'Your socket connection to the server was not read from or written to within the timeout period.',
httpStatusCode: '400 Bad Request'
},
RequestTimeTooSkewed: {
description: "The difference between the request time and the server's time is too large.",
httpStatusCode: '403 Forbidden'
},
RequestTorrentOfBucketError: {
description: 'Requesting the torrent file of a bucket is not permitted.',
httpStatusCode: '400 Bad Request'
},
RestoreAlreadyInProgress: {
description: 'The object restore is already in progress.',
httpStatusCode: '409 Conflict'
},
ServerSideEncryptionConfigurationNotFoundError: {
description: 'The server-side encryption configuration was not found.',
httpStatusCode: '400 Bad Request'
},
ServiceUnavailable: {
description: 'Service is unable to handle request.',
httpStatusCode: '503 Service Unavailable'
},
SignatureDoesNotMatch: {
description: 'The request signature that the server calculated does not match the signature that you provided. Check your AWS secret access key and signing method. For more information, see REST Authentication and SOAPAuthentication.',
httpStatusCode: '403 Forbidden'
},
SlowDown: {
description: 'Please reduce your request rate.',
httpStatusCode: '503 Slow Down'
},
'503 SlowDown': { description: 'Slow Down', httpStatusCode: '503 Slow Down' },
TemporaryRedirect: {
description: 'You are being redirected to the bucket while the Domain Name System (DNS) server is being updated.',
httpStatusCode: '307 Moved Temporarily'
},
TokenRefreshRequired: {
description: 'The provided token must be refreshed.',
httpStatusCode: '400 Bad Request'
},
TooManyAccessPoints: {
description: 'You have attempted to create more access points than are allowed for an account. For more information, see Amazon Simple Storage Service endpoints and quotas in the AWS General Reference.',
httpStatusCode: '400 Bad Request'
},
TooManyBuckets: {
description: 'You have attempted to create more buckets than are allowed for an account. For more information, see Amazon Simple Storage Service endpoints and quotas in the AWS General Reference.',
httpStatusCode: '400 Bad Request'
},
TooManyMultiRegionAccessPointRegionsError: {
description: 'You have attempted to create a Multi-Region Access Point with more Regions than are allowed for an account. For more information, see Amazon Simple Storage Service endpoints and quotas in the AWS General Reference.',
httpStatusCode: '400 Bad Request'
},
TooManyMultiRegionAccessPoints: {
description: 'You have attempted to create more Multi-Region Access Points than are allowed for an account. For more information, see Amazon Simple Storage Service endpoints and quotas in the AWS General Reference.',
httpStatusCode: '400 Bad Request'
},
UnexpectedContent: {
description: 'This request contains unsupported content.',
httpStatusCode: '400 Bad Request'
},
UnresolvableGrantByEmailAddress: {
description: 'The email address that you provided does not match any account on record.',
httpStatusCode: '400 Bad Request'
},
UserKeyMustBeSpecified: {
description: 'The bucket POST request must contain the specified field name. If it is specified,check the order of the fields.',
httpStatusCode: '400 Bad Request'
},
NoSuchAccessPoint: {
description: 'The specified access point does not exist.',
httpStatusCode: '404 Not Found'
},
InvalidTag: {
description: 'Your request contains tag input that is not valid. For example, your request might contain duplicate keys, keys or values that are too long, or system tags.',
httpStatusCode: '400 Bad Request'
},
MalformedPolicy: {
description: 'Your policy contains a principal that is not valid.',
httpStatusCode: '400 Bad Request'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment