akshaykarle / terraform-provider-mongodbatlas

Terraform provider for MongoDB Atlas
Mozilla Public License 2.0
123 stars 54 forks source link

Timeout while waiting for state to become 'IDLE' #57

Closed mkozjak closed 5 years ago

mkozjak commented 5 years ago

Tried creating a new cluster on Atlas and ended up waiting 40 mins to hit the timeout.

The error: timeout while waiting for state to become 'IDLE' (last state: 'CREATING', timeout: 40m0s) After that went to check on the cluster on Atlas web and everything was fine. Terraform plan also reported that everything was up-to-date.

mongodbatlas_cluster.foo: Creating...
  backup:                 "" => "true"
  disk_gb_enabled:        "" => "true"
  disk_size_gb:           "" => "<computed>"
  group:                  "" => "foobar"
  identifier:             "" => "<computed>"
  mongo_uri:              "" => "<computed>"
  mongo_uri_updated:      "" => "<computed>"
  mongo_uri_with_options: "" => "<computed>"
  mongodb_major_version:  "" => "3.6"
  mongodb_version:        "" => "<computed>"
  name:                   "" => "listing"
  num_shards:             "" => "4"
  paused:                 "" => "false"
  provider_backup:        "" => "false"
  provider_name:          "" => "GCP"
  region:                 "" => "CENTRAL_US"
  replication_factor:     "" => "3"
  replication_spec.#:     "" => "<computed>"
  size:                   "" => "M30"
  state:                  "" => "<computed>"

Any ideas on how to debug this?

akshaykarle commented 5 years ago

Hello @mkozjak the mongo provider waits for atlas to provision the cluster successfully before marking it is created with a timeout of 40 mins. Even when the terraform run times out, mongo continues to create the cluster and might complete eventually marking the mongo cluster as created. I could increase the creation timeout to a higher value but not sure that would help as there is no SLA provided by mongodb atlas on how long it will take to create a new cluster. For now, if you see this error, running a terraform refresh or importing the cluster manually should fix the error. And if you see it taking a long time to create clusters maybe contact mongodb atlas support?