Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Google Cloud Storage Errors and Error Handling

Google Cloud Storage is accessed by the App Engine UrlFetch feature. As a result, there are three sources of possible errors:

  • App Engine UrlFetch transient errors.
  • GCS transient errors.
  • GCS errors related to buckets and object authorization.

The GCS client library handles timeout errors on both the App Engine side and the GCS side and performs retries automatically, so your app does not need to add logic to handle this. The configuration of the timeout and retry mechanism is exposed through the RetryParams class, which you can use to change any or all of the default settings. You can make your changes to apply to all function calls or you can specify changes for a specific call using the function's retry_params parameter.

Errors

The GCS client library has the following error exception classes defined:

cloudstorage.Error

The base class for all exceptions in this package. Errors can be generated from App Engine or from Google Cloud Storage. For details on HTTP error codes from GCS, see HTTP Status and Error Codes in the GCS documentation.

cloudstorage.AuthorizationError
An unauthorized request was received by GCS. This error can occur if an authorized app is using an access token that has expired. Normally, this error is handled automatically in the GCS client library, which gets a new access token and retries the request.
cloudstorage.ForbiddenError

This error (403) indicates that the user was not authorized by GCS to make the request.

  • The various possible causes for this error are listed in the GCS error documentation for 403-Forbidden .
  • A common source of this error is that the bucket permissions (bucket ACL) are not set properly to allow your app access. See GCS Authentication for information on setting up access.

cloudstorage.NotFoundError
HTTP error 404. The bucket or object you specified in a call to cloudstorage.delete() , cloudstorage.listbucket() , cloudstorage.open() , or cloudstorage.stat() does not exist.
cloudstorage.TimeoutError
This error is raised when the attempt to contact GCS servers times out even after retry attempts. (See RetryParams for information on changing the default timeout handling and retries.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.