Search code examples
google-app-engineapp-engine-flexible

Google Cloud App Engine Flex deployment error


I'm receiving the error when deploying the flex version .net core app to GCP. I've additionally tested via gcloud app deploy and getting the exact same issue. In the logs there are multiple errors all with audit_log, method: "google.appengine.v1.Versions.CreateVersion", with status { code: 13 }, added below. There doesn't seem to be any other logs to help investigation. Any advice please?

{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "code": 13
    },
    "authenticationInfo": {
      "principalEmail": "xxxx.iam.gserviceaccount.com",
      "serviceAccountKeyName": "//iam.googleapis.com/projects/xxxxxx/serviceAccounts/xxxx.iam.gserviceaccount.com/keys/xxxxxxxxxxxx"
    },
    "requestMetadata": {
      "callerIp": "xx.xx.xx.xx",
      "requestAttributes": {
        "time": "2021-01-21T15:32:15.695398Z",
        "auth": {}
      },
      "destinationAttributes": {}
    },
    "serviceName": "appengine.googleapis.com",
    "methodName": "google.appengine.v1.Versions.CreateVersion",
    "authorizationInfo": [
      {
        "resource": "apps/xxxxxxxx/services/default/versions/XYZ",
        "permission": "appengine.versions.create",
        "granted": true,
        "resourceAttributes": {}
      }
    ],
    "resourceName": "apps/xxxxxxxx/services/default/versions/XYZ",
    "serviceData": {
      "@type": "type.googleapis.com/google.appengine.v1.AuditData",
      "createVersion": {
        "request": {
          "parent": "apps/xxxxxxxx/services/default",
          "version": {
            "id": "XYZ",
            "automaticScaling": {
              ....
            },
            "resources": {
              ....
            },
            "runtime": "aspnetcore",
            "env": "flex",
            "servingStatus": "SERVING",
            "envVariables": {
              "GCLOUD_PROJECT_NUMBER": "xxxxxxx"
            },
            "readinessCheck": {
              ....
            },
            "livenessCheck": {
              ....
            }
          }
        }
      }
    },
    "resourceLocation": {
      "currentLocations": [
        ....
      ]
    }
  },
  "insertId": "crndlud361i",
  "resource": {
    "type": "gae_app",
    "labels": {
      ....
    }
  },
  "timestamp": "2021-01-21T15:32:15.695398Z",
  "severity": "ERROR",
  "logName": "projects/xxxxxxxx/logs/cloudaudit.googleapis.com%2Factivity",
  "receiveTimestamp": "2021-01-21T15:32:15.683297004Z"
}

Solution

  • Raised a ticket with Google to advise on the issue. I'm not sure the guys got to the bottom of it, however what sorted it in the end was this recommendation:

    Can you try to disable and enable again App Engine Admin API in Console->Api & Services section and try to deploy again? If it doesn't help try to also disable/enable Google App Engine Flexible Environment API and try again.

    Update: G guys got to the bottom of it. It was a permission removed for a App Engine Flexible Environment Service Agent role. Google engineers confirmed they will look into improving an error details.