Deleted by accident *.appspot.com bucket, how to recovery? - google-app-engine

I deleted by accident project-id.appspot.com, us.artifacts.project-id.appspot.com and staging.project-id.appspot.com buckets created by cloud scheduler and now it stopped to work. I can't redeploy again, I can't recreate the buckets because its ended in appspot.com (because I need domain verification for that, and of course appspot.com isn't mine.)
How to recovery?

I think you should run the command :
gcloud beta app repair
(BETA) For example, this command will restore the App Engine staging
bucket if it has been deleted. It will no longer restore the service
account, instead, the IAM service account undelete API must be used
for the purpose.
gcloud beta app repair - restores required App Engine features to the current application

Related

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.

Deployment to GAE failing after project has been restored

I had a project deployment to GAE using cloud build which was working fine, But I deleted the project by mistake. But after the restore, the deployment is failing with
ERROR: (gcloud.app.deploy) Error Response: [4] Timed out waiting for the app infrastructure to become healthy.
I see this in the cloud build logs: even when the Cloud build service account has the App Engine Admin Permissions
WARNING: Unable to verify that the Appengine Flexible API is enabled for project []. You may not have permission to list enabled services on this project. If it is not enabled, this may cause problems in running your deployment. Please ask the project owner to ensure that the Appengine Flexible API has been enabled and that this account has permission to list enabled APIs.
Also, the permissions for the account owner has changed from : 1350/1578 to 1266/1578. How can I fix that?
I have tried to replicate the issue you're experiencing by creating a new project and deploying a simple HelloWorld app in GAE Flexible environment.
I have deleted my project and then restored it, and, after that, I was unable to deploy the app again. The issue was solved once I made sure my Google App Engine Flexible Environment API is enabled and linked my Billing Account again (as it gets removed when you delete the project).
EDIT:
After further research, I found this page in the GCP issue tracker.
Based on the information from that page, the error you are experiencing can occur for various reasons. It can be related to quotas (e.g. CPU cores, memory, public IP addresses) or, sometimes, the region where you are trying to deploy.
As it was confirmed by the engineer, trying to re-deploy, or to deploy in a different region often resolves the issue. However, if the issue persists and you have a support package, I'd recommend you to contact GCP support as the issue is too broad to troubleshoot it here and may require a project inspection.

Error message "service cloudbuilt.googleapis.com is not for consumer..." when deploying App Engine application

My team and I are working on the Trendy Lights Tutorial.
We have set up all the files and also have converted the .p12 key to .pem key but failed to run the app on the Google Cloud Platform and constantly got the error message saying:
You do not have permission to access project [...] and service
"cloudbuilt.googleapis.com" is not for consumer..."
We have already whitelisted our service account for the use of Earth Engine. Does anyone know what the problem might be?
Thank you so much!
I see that you are attempting to deploy your application to the App Engine Flexible Environment.
The Flexible environment differs from the Standard environment in that it gives you more control over the individual instances that are running your deployed application. It does this by hosting your application within Docker on Compute Engine virtual machines.
Therefore, you will need to enable the Compute Engine API for your project so that the GCloud tool can start new Compute Engine virtual machines when you deploy your application.
Note: Since the Flexible environment uses Compute Engine resources, you will also need to enable billing for your project.
If after performing the above you still experience the 'cloudbuild.googleapis.com' error, I ask that you run gcloud components update, then ensure that the value of account seen in the output of the command gcloud info has Owner or Editor permissions in your project.
If it still persists after all of the above, you should then open a Public Issue Tracker to inform our backend team of the issue.

Transferring datastore backup between apps; how to add an app to another app with edit permissions?

The documentation here states:
Using the Google Cloud Platform Console, locate the project that has
the bucket used for your backups and add the target app (the app you
are restoring to) to the project team with Edit permissions.
Where and how do I add the target app?
You need to get the receivers App Engine Service Account ie: YOURAPPID#appspot.gserviceaccount.com which you will then add to the Permissions section of the Application generating the backup.

App Engine deploy from multiple users to same project

is it possible to deploy to the same appengine project from multiple users? Like if I add another user to have access to my appengine project how can the other user also deploy to my appengine? Is this possible?
Yes, multiple users can deploy to the same AppEngine app id. Just give them each permission from the cloud console.
At that point, every authorized developer is the same and can deploy in the normal fashion. Just keep in mind that users can/will overwrite each other's deploys if they push the same version identifier.
The most recent deploy of the same version wins and overwrites the earlier deploy. So, make sure your team workflow accommodates this.

Resources