Open brandonbumgarner opened 4 years ago
Hmm, strange, so it did not work with 2.6.0
either?
That is correct. It had been working up until about 3 weeks ago with no changes to the files I had been using for the service imports. Now, it crashes consistently no matter what service I try to import.
I just tried upgrading to 2.7.0 and hit the same error as well on state refresh during a terraform apply
Error: Error refreshing state: 1 error occurred:
* docker_container.iis_services: 1 error occurred:
* docker_container.iis_services: docker_container.iis_services: unexpected EOF
Terraform 0.11.14 as well, though I moved back a version to 2.6.0 and that is working for me.
We're connecting to docker on Windows Server 2016 as well if that helps, the server version is pretty old.
Server Version: 1.12.2-cs2-ws-beta
Default Isolation: process
Kernel Version: 10.0 14393 (14393.3630.amd64fre.rs1_release.200407-1730)
Operating System: Windows Server 2016 Datacenter
OSType: windows
In the following line, I believe Go will throw a panic if either of those values have not been initialized.
if string(service.Endpoint.Spec.Mode) == "" && string(service.Spec.EndpointSpec.Mode) == "" {
Could that be the issue?
@Novex I tried to roll back to 2.6.0 and that did not work for me. This was actually one of the first things that I had tried, but thanks for providing this info.
@sujith-apivista Thanks for pointing this out! It seems that none of the services I had left to import had endpoints specified. After adding the endpoint spec mode to the service json, it imported successfully. I would suggest that a fix be implemented in the provider to handle a condition where endpoint spec might not be specified since it is not required by Docker. Thanks for your comments everyone!
"EndpointSpec": {
"Mode": "vip"
}
I could have hit a different issue - is there any way to see the actual panic error thrown by the provider?
@Novex I provided the crash log which has the panic error shown. Are you looking for that or something different?
Thanks for clarifying - I didn't realise the 'unexpected eof' was a generic something's wrong error. The error I found in my log file is different to yours so I've definitely got a different problem
Terraform version
0.11.14
Affected Resource(s)
Terraform Configuration Files
Panic Output
https://gist.github.com/brandonbumgarner/163a3145f7d1613a4d55dadc5dd0d0f2
Expected Behavior
The service should be imported into a state file stored in S3.
Actual Behavior
Terraform crashes. It seems like the state is captured, but when the state is refreshed, it crashes. The crash.log shows the docker inspect command output(stripped from gist, but in the actual it is there). So it seems that it is communicating with the docker node and getting the data.
Please keep in mind I have stripped the service id and any "sensitive" information from the logs and output. In the actual logs and output it has the specific environment, domain, service id, etc. For example: service-id is actually the id of a service that exists in that environment
Steps to Reproduce
terraform init -var "environment=env" -backend-config="key=folder/service.state" terraform import -var "environment=env" docker_service.service service-id
Important Factoids
Right now I have the Docker provider pinned to 2.7.0, but have also tried 2.6.0. This had been working for most of our other services, but stopped working last week without any changes to the tf file.