Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.

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.
  • Google Cloud Storage transient errors.
  • Google Cloud Storage errors related to buckets and object authorization.

The App Engine client library for Cloud Storage handles timeout errors on both the App Engine side and the Google Cloud Storage 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.


The App Engine client library for Cloud Storage has the following error exception classes defined:


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 Google Cloud Storage, see HTTP Status and Error Codes in the Google Cloud Storage documentation.

An unauthorized request was received by Google Cloud Storage. This error can occur if an authorized app is using an access token that has expired. Normally, this error is handled automatically in the App Engine client library for Cloud Storage, which gets a new access token and retries the request.

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

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