Environment stuck in an "unexpected state"

We have deployed a brand new cluster, including a new environment. The creation went well. However, we would like to create a new secret on this environment:

data "aws_ssm_parameter" "databaseConnectionString" {
  name = "[REDACTED]"

resource "qovery_environment" "environment" {
  # ...
  secrets = [{
    key   = "DATABASE_URL"
    value = data.aws_ssm_parameter.databaseConnectionString.value

Running a new terraform apply timeouts:

module.[redacted]].environment: Still modifying... [id=ece9f2c6-996c-4d1f-9452-8b63f196fd17, 14m50s elapsed]
module.[redacted]].environment: Still modifying... [id=ece9f2c6-996c-4d1f-9452-8b63f196fd17, 15m0s elapsed]
module.[redacted]].environment: Still modifying... [id=ece9f2c6-996c-4d1f-9452-8b63f196fd17, 15m10s elapsed]
│ Error: Error on environment update
│   with module.[redacted]].environment,
│   on ../modules/[redacted]/qovery-cluster/main.tf line 41, in resource "qovery_environment" "environment":
│   41: resource "qovery_environment" "environment" {
│ failed to update environment: failed to redeploy: unexpected state

This is not blocking, as we added the secret manually. The environment is now correctly deployed and running. However, every following Terraform deployment takes 15 minutes, time for the environment deployment to timeout.

Can you help? Thanks a lot! :slight_smile:

Hello @jpetitcolas
Sorry for the late answer.
Are you still facing the issue?


Hi Pierre,

No worries. Yes, it has been solved when we deleted the cluster to recreate a new one (from memory, as it is an old issue now). It wasn’t use in production at this time, so we had this possibility. :slight_smile: