AppEngineデプロイ時にエラー

少し仕組みが変わっている?


service account does not have access to the bucketと表示される


ERROR: (gcloud.app.deploy) Error Response: [13] Failed to create cloud build: com.google.net.rpc3.client.RpcClientException: APPLICATION_ERROR;google.devtools.cloudbuild.v1/ArgoAdminNoCloudAudit.CreateBuild;invalid bucket "staging.XXXXXXXX-431409.appspot.com"; service account markdowneditor-431409@appspot.gserviceaccount.com does not have access to the bucket;AppErrorCode=9;StartTimeMs=1722679395963;unknown;ResFormat=uncompressed;ServerTimeSec=2.104986938;LogBytes=256;Non-FailFast;EndUserCredsRequested;EffSecLevel=none;ReqFormat=uncompressed;ReqID=b5c351844a9bad1b;GlobalID=0;Server=[2002:a05:630c:969:b0:6e:903a:5e33]:4001.
Cloud Storageへの権限がないといったエラー。
新しくプロジェクトを作成 → App Engine作成時に課金アカウント制限に引っかかる → 対応したときに権限周りが中途半端になっている。ということかもしれない。



対応方法


App Engine 管理者を有効化する。
https://console.cloud.google.com/cloud-build/settings/service-accountcount

以下も有効化
https://console.cloud.google.com/apis/api/appengine.googleapis.com/metrics


ERROR: (gcloud.app.deploy) B instance [staging.app-xxxxx.appspot.com] not found: The specified bucket does not exist.



軽率にGoogle Cloud Storageのバゲットを丸ごと消したら動作しなくなった。
今までは問題なかったと思うがどうやら少し仕組みが変わっているらしい。
キャッシュを無効にしてデプロイ。
gcloud app deploy --no-cach
特に変わらず。
https://stackoverflow.com/questions/76826568/gcloud-app-deploy-complains-about-missing-staging-bucket
gcloud beta app repair
こちらもダメ。

API経由でRepairを試す

https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps/repair
右側のTry this methodから実際に試すことが出来る。

appsIdにはプロジェクトIDを指定するだけで良い。
Cloud Storageにバケットが作成されていればOK.
デプロイ出来るようになっているはず。




参考


https://stackoverflow.com/questions/64274811/gcloud-app-deploy-error-response-13-failed-to-create-cloud-build-invalid-buc

2024年8月3日土曜日