Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
Cloud Storage のエラーとエラー処理
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Cloud Storage は、App Engine UrlFetch
機能によってアクセスされます。このため、次の 3 種類のエラーが発生します。
- App Engine UrlFetch の一時エラー。
- Google Cloud Storage の一時エラー。
- バケットとオブジェクト権限に関連する Google Cloud Storage エラー。
Cloud Storage 用 App Engine クライアント ライブラリは、App Engine と Google Cloud Storage の両方でタイムアウト エラーを処理し、自動的に再試行を行います。このエラーを処理するロジックをアプリに追加する必要はありません。タイムアウトと再試行の構成は RetryParams クラスで公開します。これにより、デフォルト設定の一部またはすべてを変更できます。すべての関数呼び出しに適用される変更を行うことも、関数の retry_params
パラメータを使用して特定の呼び出しに変更を行うこともできます。
エラー
Cloud Storage 用 App Engine クライアント ライブラリには、次のエラー例外クラスが定義されています。
- cloudstorage.Error
-
このパッケージのすべての例外の基本クラスです。このエラーは、App Engine または Google Cloud Storage で発生します。Google Cloud Storage の HTTP エラーコードの詳細については、Google Cloud Storage のドキュメントで HTTP ステータスとエラーコードの説明をご覧ください。
- cloudstorage.AuthorizationError
- Google Cloud Storage が未承認のリクエストを受信しました。このエラーは、承認済みのアプリが期限切れのトークンを使用すると発生します。通常、このエラーは Cloud Storage 用 App Engine クライアント ライブラリによって自動的に処理され、新しいアクセス トークンでリクエストが再試行されます。
- cloudstorage.ForbiddenError
このエラー(403)は、Google Cloud Storage でユーザーにリクエストの送信が許可されていないことを意味します。
- cloudstorage.NotFoundError
-
HTTP エラー 404。
cloudstorage.delete()
、cloudstorage.listbucket()
、cloudstorage.open()
、cloudstorage.stat()
の呼び出しで指定したバケットまたはオブジェクトが存在しません。
- cloudstorage.TimeoutError
-
このエラーは、再試行後に Google Cloud Storage サーバーとの接続がタイムアウトすると発生します。デフォルトのタイムアウト処理と再試行を変更する方法については、RetryParams をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-19 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-19 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,[]]