itinance
itinance

Reputation: 12388

Google App Engine: Can't create second app on same developer machine ("The project already contains an App Engine application")

Somewhere on my SSD is an ongoing, actively managed Google App Engine project. I develop it on this machine and I am always able to deploy it successfully with gcloud app deploy.

Now i wanted to create another Google App Engine project.

Steps to reproduce:

  1. I created the directory on my developer machine (Mac)

cd mynewproject

  1. I created the project in google app engine console

mynewproject

  1. Then i wanted to create the new app as follows:

gcloud app create

Result:

But this gives the following error:

$ gcloud app create ERROR: (gcloud.app.create) The project [oldproject] already contains an App Engine application in region [europe-west]. You can deploy your application using gcloud app deploy.

I am pretty sure that i moved to another directory far outside of the directory for "oldproject".

Also the new project is listed in the Google App Engine console with all other projects.

How can i work on this project on the same machine without to need removing my other GAE-project?

Upvotes: 14

Views: 7905

Answers (3)

uudaddy
uudaddy

Reputation: 381

In my case I think the GCP project was just too old (at least a few years old), and I had to delete it and create new project in order to make it work... I did use command "gcloud app describe" and tried to create a new project in the GCP web console as well, both did not work...

Upvotes: 0

Steren
Steren

Reputation: 7909

You can create only one App Engine app per Google Cloud project.

If your new project is related to the old one, You can create a new App Engine service in the same Google Cloud project: In your app.yaml, you can specify a service name: service: [SERVICE_NAME]. Now when you run gcloud app deploy, it will deploy a new service to the same project.

If your new project is not related to the old one, you should just create a new Cloud Console project and then create an App Engine app for this one. To do so, either use the command line: gcloud projects create [PROJECT_ID] or simply browse to https://console.cloud.google.com to create it. Then, you can either:

  • use gcloud app deploy app.yaml --project [PROJECT_ID] to deploy to this project.
  • tell gcloud that you are now working within that project: gcloud config set project [PROJECT_ID]

Upvotes: 19

minou
minou

Reputation: 16563

The gcloud command has configuration options and one of those options is to set the default project. At some point, you set the default project to oldproject and that is why the command is trying to recreate oldproject.

One solution is to unset the default project in your configuration. There are probably other solutions. I think you can create multiple configurations, but the interface for this is klunky so I've never delved into it.

It is probable easier to just create a new project at console.google.com. Though to deploy and do other things, you'll still need to unset the default project or create another configuration.

Upvotes: 0

Related Questions