Closed Novex closed 4 years ago
I can reproduce this issue.
Terraform v0.11.14
main.tf
provider "docker" {
version = "2.6.0"
}
resource "docker_image" "nginx" {
name = "nginx"
}
resource "docker_container" "iis_services" {
name = "iis-services"
image = "${docker_image.nginx.latest}"
restart = "always"
}
$ terraform apply
# Confirm that "mounts" isn't set in terraform.tfstate
$ vi main.tf # upgrade docker provider from 2.6.0 to 2.7.0 or 2.7.1
$ terraform init
$ terraform plan # panic
If mounts
isn't set in Terraform Configuration with Docker provider v2.6.0,
mounts
isn't set in State.
So rawState
doesn't have the key mounts
and rawState["mounts"].([]interface{})
occurs panic.
mounts := rawState["mounts"].([]interface{})
panic: interface conversion: interface {} is nil, not []interface {}
I have created a pull request to fix this issue. https://github.com/terraform-providers/terraform-provider-docker/pull/271
Terraform Version
0.11.14
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
terraform apply should have completed successfully
Actual Behavior
The provider crashed with an Unexpected EOF error
Steps to Reproduce
terraform apply
Important Factoids
This works fine on v2.6.0, so it must have been something that changed for v2.7.0
We're connecting to docker on Windows Server 2016 - the server version is pretty old.
I can reproduce this reliable and can provide more information/try things if needed.