The following document provides reference information about the status codes and error messages that are used in the Google Cloud Storage JSON API.
Contents
Error Response Format
Google Cloud Storage uses the standard HTTP error reporting format for the JSON API. Successful requests return HTTP status codes in the 2xx range. Failed requests return status codes in the 4xx and 5xx ranges. Requests that require a redirect returns status codes in the 3xx range. Error responses usually include a JSON document in the response body, which contains information about the error.
The following examples show some common errors. Note that the header information in the responses is omitted.
401 Unauthorized
The following is an example of an error response you receive if you try to list list the buckets for a project but do not provide an authorization header.
401 Unauthorized { "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }
403 Forbidden
This is an example of an error response you receive if you try to list the buckets of a non-existent project or one in which you don't have permission to list buckets.
403 Forbidden { "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Forbidden" } ], "code": 403, "message": "Forbidden" } }
404 Not Found
The following is an example of an error response you receive if you try to retrieve an object that does not exist.
404 Not Found { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } }
409 Conflict
The following is an example of an error response you receive if you try to create a bucket using the name of a bucket you already own.
409 Conflict { "error": { "errors": [ { "domain": "global", "reason": "conflict", "message": "You already own this bucket. Please select another name." } ], "code": 409, "message": "You already own this bucket. Please select another name." } }
412 Precondition Failed
The following is an example of an error response you receive if you try to get an object
and specify a precondition (e.g.,
ifGenerationMatch
) that fails.
412 Precondition Failed { "error": { "errors": [ { "domain": "global", "reason": "conditionNotMet", "message": "Precondition Failed", "locationType": "header", "location": "If-Match" } ], "code": 412, "message": "Precondition Failed" } }
The following table describes the elements can appear in the response body of error. Fields should be used together to help determine the problem. Also, the example values given below are meant for illustration and are not an exhaustive list of all possible values.
Element | Description |
---|---|
code
|
An HTTP status code value, without the textual description.
Example values include:
|
error
|
A container for the error information. |
errors
|
A container for the error details. |
errors.
domain
|
The scope of the error. Always returns
|
errors.
location
|
The specific item withing the
Example values include:
|
errors.
locationType
|
The location or part of the request that caused the error. Use with
Example values include
|
errors.
message
|
Description of the error.
Example values include
|
errors.
reason
|
Example values include
invalid
,
invalidParameter
, and
required
.
|
message
|
Description of the error. Same as
errors.
|
HTTP Status and Error Codes
This section provides HTTP status and error codes that the Google Cloud Storage JSON API uses.
The
1xx
Informational and
2xx
Success codes are not discussed here.
For more information, see
Status Code Definitions
in RFC 2616.
301—Moved Permanently
Error Name | Description |
---|---|
PermanentRedirect | The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. |
304—Not Modified
Error Name | Description |
---|---|
NotModified | Not modified. |
307—Temporary Redirect
Error Name | Description |
---|---|
Redirect | Temporary redirect. |
TemporaryRedirect | You are being redirected to the bucket while DNS updates. |
308—Resume Incomplete
Error Name | Description |
---|---|
Resume Incomplete | Indicates an incomplete resumable upload and provides the range of bytes already received by Google Cloud Storage. |
400—Bad Request
Error Name | Description |
---|---|
AmbiguousGrantByEmailAddress | The e-mail address you provided is associated with more than one account. |
BadDigest | The Content-MD5 you specified did not match what we received. |
CredentialsNotSupported | This request does not support credentials. |
EntityTooSmall | Your proposed upload is smaller than the minimum allowed object size. |
EntityTooLarge | Your proposed upload exceeds the maximum allowed object size. |
ExcessHeaderValues | Multiple HTTP header values where one was expected. |
ExpiredToken | The provided token has expired. |
IncompleteBody | You did not provide the number of bytes specified by the Content-Length HTTP header. |
IncorrectNumberOfFilesInPostRequest | POST requires exactly one file upload per request. |
InlineDataTooLarge | Inline data exceeds the maximum allowed size. |
InvalidArgument | Invalid argument. |
InvalidBucketName | The specified bucket is not valid. |
InvalidDigest | The Content-MD5 you specified was invalid. |
InvalidLocationConstraint | The specified location constraint is not valid. You cannot specify locations with the Google Cloud Storage API. |
InvalidPolicyDocument | The content of the form does not meet the conditions specified in the policy document. |
InvalidStorageClass | The storage class you specified is not valid. |
InvalidToken | The provided token is malformed or otherwise invalid. |
InvalidURI | Couldn't parse the specified URI. |
KeyTooLong | Your object name is too long. |
MalformedACLError | The XML you provided was not well-formed or did not validate against our published schema. |
MalformedHeaderValue | An HTTP header value was malformed. |
MalformedPOSTRequest | The body of your POST request is not well-formed multipart/form-data. |
MalformedXML | This happens when the user sends a malformed XML (XML that doesn't conform to the published XSD) for the configuration. |
MaxMessageLengthExceeded | Your request was too big. |
MaxPostPreDataLengthExceededError | Your POST request fields preceding the upload file were too large. |
MetadataTooLarge | Your metadata headers exceed the maximum allowed metadata size. |
MissingRequestBodyError | This happens when the user sends an empty XML document as a request. |
MissingSecurityHeader | Your request was missing a required header. |
NoLoggingStatusForKey | There is no such thing as a logging status sub-resource for a key. |
RequestIsNotMultiPartContent | Bucket POST must be of the enclosure-type multipart/form-data. |
RequestTimeout | Your socket connection to the server was not read from or written to within the timeout period. |
TokenRefreshRequired | The provided token must be refreshed. |
TooManyBuckets | You have attempted to create more buckets than allowed. |
UnexpectedContent | This request does not support content. |
UnresolvableGrantByEmailAddress | The e-mail address you provided does not match any account on record. |
UnsupportedAcl | The ACL you specified is not supported. For more information about the ACLs that Google Cloud Storage supports, see Access Control . |
UserKeyMustBeSpecified | The bucket POST must contain the specified field name. If it is specified, please check the order of the fields. |
401—Unauthorized
Error Name | Description |
---|---|
Unauthorized |
Indicates that an unauthorized request has been received by Google Cloud Storage.
|
403—Forbidden
Error Name | Description |
---|---|
AccessDenied | Access denied. |
AccountProblem | There is a problem with your Google account that prevents the operation from completing successfully. Please contact customer service. |
AnotherUserOwnsDomain | The bucket you tried to create is a domain name owned by another user. |
BucketAlreadyExists | 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. |
DomainVerificationRequired | The bucket you tried to create requires domain ownership verification. For more information, see Bucket and Object Naming Guidelines . |
InsufficientQuota | The user does not have enough quota to complete this operation. |
InternalError | We encountered an internal error. Please try again. |
InvalidAccessKeyId | The User Id you provided does not exist in our records. |
InvalidPayer | All access to this object has been disabled. |
InvalidSecurity | The provided security credentials are not valid. |
NotSignedUp | Your account is not signed up for this service. You can sign up at http://google.com/accounts. |
RequestTimeTooSkewed | The difference between the request time and the server's time is too large. |
SignatureDoesNotMatch | The request signature we calculated does not match the signature you provided. Check your Google secret and signing method. |
404—Not Found
Error Name | Description |
---|---|
AccessDenied | Access denied. |
NoSuchBucket | The specified bucket does not exist. |
NoSuchKey | The specified object name does not exist. |
405—Method Not Allowed
Error Name | Description |
---|---|
AccessDenied | Access denied. |
MethodNotAllowed | The specified method is not allowed against this resource. |
409—Conflict
Error Name | Description |
---|---|
BucketAlreadyOwnedByYou | Your previous request to create the named bucket succeeded and you already own it. |
BucketNameUnavailable | 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. This error can occur when you try to create a bucket name that already exists or you try to create a bucket name that does not meet the bucket naming requirements. |
BucketNotEmpty | The bucket you tried to delete is not empty. |
OperationAborted | A conflicting conditional operation is currently in progress against this resource. Please try again. |
411—Length Required
Error Name | Description |
---|---|
MissingContentLength | You must provide the Content-Length HTTP header. |
412—Precondition Failed
Error Name | Description |
---|---|
PreconditionFailed | At least one of the pre-conditions you specified did not hold. |
416—Requested Range Not Satisfiable
Error Name | Description |
---|---|
InvalidRange | The requested range cannot be satisfied. |
429—Too Many Requests
Error Name | Description |
---|---|
TooManyRequests | The Google Cloud Storage JSON API per-project usage limit was exceeded. If your application tries to use more than its limit, additional requests will fail. You can see API usage limits on the Quotas pane in the Google Developers Console. |
500—Internal Server Error
Error Name | Description |
---|---|
InternalError | We encountered an internal error. Please try again. |
501—Not Implemented
Error Name | Description |
---|---|
NotImplemented | A header you provided implies functionality that is not implemented. |
503—Service Unavailable
Error Name | Description |
---|---|
SlowDown | Please reduce your request rate. |