Home > Back-end >  ERROR: (gcloud.app.deploy): The App Engine appspot and App Engine flexible environment service accou
ERROR: (gcloud.app.deploy): The App Engine appspot and App Engine flexible environment service accou

Time:05-17

I have the following error when I try to build my app on GCP App Engine, my app environment is ideed a flexible one. But I don't know if my App Engine environment is flex or not.

If that's the case how can I set my environment to flex in GCP App Engine?

ERROR: (gcloud.app.deploy) Error Response: [7] The App Engine appspot and App Engine 
flexible environment service accounts must have permissions on the image 
[eu.gcr.io/["key file"]/appengine/default.20220514t124713:latest]. Please check 
that the App Engine default service account has the [Storage Object Viewer] role and the 
App Engine  Flexible service account has the App Engine Flexible Environment Service 
Agent role

I'm building on Travis CI using the right .travis format and I receive this error. I also tried to build this directly on Cloud Shell terminal in GCP, but I have the same error.

This is my app.yaml file:

env: flex
runtime: custom
service: default
manual_scaling:
  instances: 1
resources:
  cpu: 1

This is what I have in IAM permissions:

enter image description here

CodePudding user response:

@DazWilkin solved it. To solved it I needed to add to IAM the ({project-id}@appspot.gserviceaccount.com), to build the project correctly.

"You can determine its email address ({project-id}@appspot.gserviceaccount.com) and you should be able to simply re-add it to the IAM policy... Give it roles/editor. It's a Google-managed (owned) Service Account and so you can't delete the Service Account itself, just the role binding." - @DazWilkin

  • Related