Deploy Google App Engine Failed Create VM - google-app-engine

[Failed create VM][1]
Please help me to solve this problem. I'm deploying NodeJS Service to Google App Engine, but It's always fail like the attachments.
It said that failed create VM and the version deployed have no instance running
https://i.stack.imgur.com/YgxuH.png

Related

Error connecting GCP App Engine to GCP SQL

I'm trying to deploy a Flask App on the App Engine, but I'm getting this error about the database connection:
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003,
"Can't connect to MySQL server on 'localhost' ([Errno 111] Connection
refused)")
I'm doing the connection like this:
databaseUri = 'mysql+pymysql://user:pass#/database?unix_socket=/cloudsql/connection_name'
Also activated the Cloud SQL Administrator API as the documentation says, but not working
Does anyone have an idea about what am I missing or doing wrong?
I've have been stuck on this for 2 days and I can't make it work, thanks for your help.
I solved it.
I post the solution maybe helps someone else.
I still don't know why, but when running the command to deploy the app in the App Engine:
gcloud app deploy
It use by default the Compute Engine service account instead of the App Engine service account, so I just had to run the command specifying it to use the App Engine service account:
gcloud app deploy --service-account=SERVICE_ACCOUNT
Hope it helps any newbe like me.

How to create version number in Google App Engine

I have one web project. Pipeline in Azure DevOps, instance in GCP. If I canceled pipeline in Google App Engine create version and i must pay for this.... How to set up a pipeline or Google App Engine so that the version in Google is recorded only when the pipeline is successfully completed
When you try to deploy a version of your APP to Google App Engine using a pipeline on Azure DevOps, if the deployment step itself is failed, normally the new version may not be deployed to App Engine. You just need to retry the pipeline.
However, if the deployment step has completed successfully, but one of the subsequent steps or jobs is failed and caused the pipeline failed, the new version has been deployed to App Engine. In this situation, you may not able to redeploy the same version to App Engine.

Can't deploy app to App Engine, it fails with `Unable to write to staging bucket` and `unable to resolve resource`

I'm using the gcloud SDK to try to deploy a Dockerfile and app.yaml to app engine. My App Engine service account has Project Editor and Storage Admin and SQL Client roles, and the Cloud Build, App Engine, and App Engine Flexible APIs are all enabled. Nonetheless, I keep encountering this error with gcloud beta:
ERROR: (gcloud.beta.app.deploy) Error Response: [7] Unable to write to staging bucket staging.
<project name>.appspot.com. Please grant access to the App Engine service account on your project
by visiting https://console.developers.google.com/storage/browser?project=<project name>
and this (less clear) error with vanilla gcloud:
ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source
In a different sandbox/dev project, I didn't have this issue, but in this production project, that hasn't been the case. Adding the SAs manually makes no difference. And weirdly, the deploy is writing the files to the staging bucket, so I don't trust this error. Where it seems to be failing is the step immediately after that--maybe App Engine Flexible service account agent wants to access them; maybe the Dockerfile needs to be passed onward to Cloud Build SA; but in any case, I have tried every combination of granting bucket access to both App Engine and Cloud Build SAs and their agents as well, and it hasn't worked.
My user account has app engine deployer role assigned to it, and even impersonating the App Engine account with its editor role didn't make a difference. Cloud Build has App Deployer role as well.
The error of the Vanilla GCloud indicates that your service account is likely missing some permissions. Try disabling and re-enabling the Cloud Build API in your project so a new service account is created.
This ensures that Cloud Build has permission to start builds.
Also, make sure to wait a few minutes before trying to deploy (like 10 minutes or so), so that the permissions can be propagated to all systems.

Unable to create Google App Engine application

When I tried to create a Google App Engine application via gcloud app create at terminal on Ubuntu and on the web, it gives me the following error,
"ERROR: (gcloud.app.create) Error Response: [13] An internal error occurred while ensuring the default service account exists."
I guess the reason why I don't have the default service account because I deleted a default project on GCP which was made when I started using GCP, not sure though.
I made a service account at IAM & admin menu, but not work. Any idea?
Although I found this answer, it didn't work for me.
How to recover Google App Engine's "default service account"
But I didn't delete the default google app engine service account, it was missing at the first place. Maybe because I tried to create a GAE app on the web and left the page before it's done. I don't know.
Anyway, I make a new project and create a GAE app via gcloud cli, and now it's good to go.

appengine.application.create permission missing

Trying to create a new GAE app using gcloud:
gcloud app create --region "us-central"
Getting:
ERROR: (gcloud.app.create) PERMISSION_DENIED: Operation not allowed
- '#type': type.googleapis.com/google.rpc.ResourceInfo
description: The "appengine.applications.create" permission is required.
The service account has Project Editor and all App Engine roles, but looking in IAM there's actually no "appengine.application.create" permission:
This was from a VM.
Opening Cloud Shell in the same project and typing the same command, I get:
The project [xxx] already contains an App Engine application. You can deploy your application using gcloud app deploy
How can I delete the existing GAE app so that I can create one and how can I create a GAE app from my VM - basically how to add that "create" permission?
You can only create GAE once in a region that cannot be changed. This is what google says:
Important: Each GCP project can contain only a single App Engine application and you cannot change the region after you create the App Engine application.
See e.g. here:
https://cloud.google.com/appengine/docs/flexible/python/managing-projects-apps-billing

Resources