florianrosenberg
florianrosenberg

Reputation: 159

Database creation fails with a conflict

I've created a Postgres DB with the name 'tf-prod-db' and deleted it soon after b/c I needed it to be provisioned with different parameters. This was done via the UI.

Now I'm trying to re-create the DB via the CLI with the same name and I get the following error:

gcloud sql instances create tf-prod-db --database-version=POSTGRES_9_6 --cpu=2 --memory=4GB --region=europe-west3 --gce-zone=europe-west3-a --backup --storage-auto-increase
ERROR: (gcloud.sql.instances.create) Resource in project [tf-freemium-prod] is the subject of a conflict: The Cloud SQL instance already exists.

I don't understand the error, the DB was deleted before and I don't see it listed in the UI nor when I query with the CLI.

Any pointers?

Upvotes: 1

Views: 534

Answers (2)

Yezheng Li
Yezheng Li

Reputation: 11

To generate a database not exist (name not used in the past), still have

 gcloud sql databases create test3db  --instance test0
Creating Cloud SQL database...failed.
Database creation failed. Check if a database named test3db  already exists.

Upvotes: 0

rvs
rvs

Reputation: 1301

CloudSQL instance names cannot be reused for around 30 days. You'd have to pick a new name or wait.

Upvotes: 2

Related Questions