Python 2.7 ha raggiunto la fine del supporto
e verrà
ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment di applicazioni Python 2.7, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment di runtime legacy. Le tue applicazioni Python 2.7 esistenti continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti consigliamo di
eseguire la migrazione all'ultima versione supportata di Python.
Errori e gestione degli errori di Cloud Storage
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Google Cloud Storage è accessibile tramite la funzionalità UrlFetch
di App Engine. Di conseguenza, esistono tre fonti di possibili errori:
- Errori temporanei di UrlFetch di App Engine.
- Errori temporanei di Google Cloud Storage.
- Errori di Google Cloud Storage relativi all'autorizzazione di bucket e oggetti.
La libreria client App Engine per Cloud Storage gestisce gli errori di timeout sia lato App Engine sia lato Google Cloud Storage ed esegue automaticamente i tentativi di nuovo accesso, quindi la tua app non deve aggiungere logica per gestire questo problema. La configurazione del meccanismo di timeout e di ripetizione viene esposta tramite la classe RetryParams, che puoi utilizzare per modificare una o tutte le impostazioni predefinite. Puoi
applicare le modifiche a tutte le chiamate di funzione oppure puoi specificare le modifiche per
una chiamata specifica utilizzando il parametro retry_params
della funzione.
Errori
La libreria client App Engine per Cloud Storage ha definito le seguenti classi di eccezione di errore:
- cloudstorage.Error
-
La classe di base per tutte le eccezioni in questo pacchetto. Gli errori possono essere
generati da App Engine o da Google Cloud Storage. Per informazioni dettagliate sui codici di errore HTTP di Google Cloud Storage, consulta Codici di stato e di errore HTTP nella documentazione di Google Cloud Storage.
- cloudstorage.AuthorizationError
- Google Cloud Storage ha ricevuto una richiesta non autorizzata. Questo errore può verificarsi se un'app autorizzata utilizza un token di accesso scaduto. In genere, questo errore viene gestito automaticamente nella libreria client App Engine per Cloud Storage, che recupera un nuovo token di accesso e riprova a effettuare la richiesta.
- cloudstorage.ForbiddenError
Questo errore (403) indica che l'utente non è stato autorizzato da Google Cloud Storage a effettuare la richiesta.
- cloudstorage.NotFoundError
-
Errore HTTP 404. Il bucket o l'oggetto specificato in una chiamata a
cloudstorage.delete()
, cloudstorage.listbucket()
,
cloudstorage.open()
o
cloudstorage.stat()
non esiste.
- cloudstorage.TimeoutError
-
Questo errore viene generato quando il tentativo di contattare i server Google Cloud Storage scade anche dopo i tentativi di ripetizione. Consulta
RetryParams
per informazioni su come modificare la gestione del timeout predefinito e i tentativi ripetuti.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-09-04 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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."]]