I am trying to deploy a new pgsql database through terraform.
I am getting the following error
Could not deploy database '123ae17f-764f-4369-88ac-f878b21d29e6', unexpected error: 500 Internal Server Error - could not execute statement; SQL [n/a]; constraint [deployment_pkey]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
Here is the Terraform configuration:
resource "qovery_database" "pgsql" {
environment_id = qovery_environment.deskare.id
name = "PostgreSQL"
type = "POSTGRESQL"
version = "13"
mode = "CONTAINER
accessibility = "PRIVATE"
cpu = 250
memory = 256
storage = 10
state = "RUNNING"
}
Hi @kerwanp, Iβll take a look at this to find the root cause of this issue.
But from what I can see at the moment, it look like there were two deployment triggered at the same time which caused an issue while inserting a new row in database (on our side).
In the mean time could you try to terraform apply once again to find out if the issue is still present ?
This is something we need to fix on our side, and we will do so on the next version on the provider that will be released in a few weeks.
In the mean time I found a temporary fix that will allow you to deploy you environment.
Since we canβt let multiple deployments be created at the same time, you can add dependencies to your resources. In your case you can say the your second database depends on the first one using the depends_on keyword like this: