I was fiddling with the file provisioner, here's the part of my config:
resource "digitalocean_droplet" "main" {
...
provisioner "file" {
source = "."
destination = "/tmp/work"
connection {
user = "root"
}
}
}
Doing terraform apply creates the resource and attempts to upload files, but the file provisioning hangs for a bit (a minute or two? more?), then eventually gives up:
digitalocean_droplet.main: Provisioning with 'file'...
digitalocean_droplet.main: Error: 1 error(s) occurred:
* ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
Before it gave up with the above error, I thought it was hung, so I ran dtruss on it and saw it repeatedly trying to ssh and giving the same error that is finally reported over some internal logging mechanism within terraform.
The weird part is that the ssh client used by terraform is asking for none as the authentication method - not even publickey or password or the other usual suspects.
I'm willing to believe that I have something misconfigured, but I don't know what.
@jordansissel Hmmm I think you need to specify a password or a key to the connection block. Can you try that and report back? I think we can validate this better.
I can confirm that if I add agent = true to my connection block, the file provisioner works.
--- test.tf.orig 2015-06-16 20:53:12.000000000 -0700
+++ test.tf 2015-06-16 20:49:31.000000000 -0700
@@ -16,6 +16,7 @@
destination = "/tmp/work"
connection {
user = "root"
+ agent = true
}
}
}
Hello! :robot:
This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it.
If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in _this_ issue, because the internal details relating to this problem are likely to be different in the current version of Terraform.
Thanks!
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I can confirm that if I add
agent = trueto myconnectionblock, the file provisioner works.