Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
Cloud Storage Errors and Error Handling
Stay organized with collections
Save and categorize content based on your preferences.
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.
Errors
The App Engine client library for Cloud Storage 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 Google Cloud Storage, see
HTTP Status and Error
Codes in the Google Cloud Storage documentation.
- cloudstorage.AuthorizationError
- 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.
- cloudstorage.ForbiddenError
This error (403) indicates that the user was not authorized by Google Cloud Storage to
make the request.
- 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 Google Cloud Storage servers times out even
after retry attempts. (See
RetryParams
for information on changing the default timeout handling and retries.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe App Engine client library for Cloud Storage handles timeout errors and retries automatically, eliminating the need for manual handling in your app.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eRetryParams\u003c/code\u003e class allows customization of timeout and retry settings, which can be applied globally or to specific function calls.\u003c/p\u003e\n"],["\u003cp\u003eErrors related to Google Cloud Storage access can stem from transient issues, or from bucket and object authorization, in addition to transient errors coming from App Engine \u003ccode\u003eUrlFetch\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecloudstorage\u003c/code\u003e library defines exception classes like \u003ccode\u003eError\u003c/code\u003e, \u003ccode\u003eAuthorizationError\u003c/code\u003e, \u003ccode\u003eForbiddenError\u003c/code\u003e, \u003ccode\u003eNotFoundError\u003c/code\u003e, and \u003ccode\u003eTimeoutError\u003c/code\u003e to handle various error scenarios.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eForbiddenError\u003c/code\u003e (403) is common when the bucket permissions (bucket ACL) are not configured properly to allow access from the application.\u003c/p\u003e\n"]]],[],null,["# Cloud Storage Errors and Error Handling\n\nGoogle Cloud Storage is accessed by the App Engine ` UrlFetch ` feature. As a result,\nthere are three sources of possible errors:\n\n- App Engine UrlFetch transient errors.\n- Google Cloud Storage transient errors.\n- Google Cloud Storage errors related to buckets and object authorization.\n\nThe App Engine client library for Cloud Storage handles timeout errors on both the App Engine side and\nthe Google Cloud Storage side and performs retries automatically, so your app does not need to\nadd logic to handle this. The configuration of the timeout and retry mechanism\nis exposed through the [RetryParams](/appengine/docs/legacy/standard/python/googlecloudstorageclient/retryparams_class)\nclass, which you can use to change any or all of the default settings. You can\nmake your changes to apply to all function calls or you can specify changes for\na specific call using the function's `retry_params` parameter.\n\nErrors\n------\n\nThe App Engine client library for Cloud Storage has the following error exception classes defined:\n\ncloudstorage.Error\n\n: The base class for all exceptions in this package. Errors can be\n generated from App Engine or from Google Cloud Storage. For details on HTTP\n error codes from Google Cloud Storage, see\n [HTTP Status and Error\n Codes](/storage/docs/reference-status#standardcodes) in the Google Cloud Storage documentation.\n\ncloudstorage.AuthorizationError\n: An unauthorized request was received by Google Cloud Storage. This error can occur if an\n authorized app is using an access token that has expired. Normally, this error\n is handled automatically in the App Engine client library for Cloud Storage, which gets a new access token\n and retries the request.\n\ncloudstorage.ForbiddenError\n\n: This error (403) indicates that the user was not authorized by Google Cloud Storage to\n make the request.\n\n - The various possible causes for this error are listed in the [Google Cloud Storage error\n documentation](/storage/docs/reference-status#standardcodes) for **403-Forbidden**.\n - A common source of this error is that the bucket permissions (bucket ACL) are not set properly to allow your app access. See [Google Cloud Storage Authentication](/storage/docs/authentication) for information on setting up access.\n\n \u003cbr /\u003e\n\ncloudstorage.NotFoundError\n:\n HTTP error 404. The bucket or object you specified in a call to\n `cloudstorage.delete()`, `cloudstorage.listbucket()`,\n `cloudstorage.open()`,\n or `cloudstorage.stat()` does not exist.\n\ncloudstorage.TimeoutError\n:\n This error is raised when the attempt to contact Google Cloud Storage servers times out even\n after retry attempts. (See\n [RetryParams](/appengine/docs/legacy/standard/python/googlecloudstorageclient/retryparams_class)\n for information on changing the default timeout handling and retries."]]