Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: file provisioner error #30328

Closed
reyeliher opened this issue Jan 10, 2022 · 2 comments
Closed

Error: file provisioner error #30328

reyeliher opened this issue Jan 10, 2022 · 2 comments
Labels
bug new new issue not yet triaged

Comments

@reyeliher
Copy link

Hello, I am upgrading Terraform from version 1.0 to version (1.1.2 or 1.1.3) and when I run the CLI to create cluster it always gives an error when creating the instance, either with google cloud, azure, oracle, aws, ...

google....

connection {
type = "ssh"
port = "22"
timeout = "3m"
host = self.network_interface[0].access_config[0].nat_ip
user = var.ssh_username
private_key = var.keys.private
}

provisioner "file" {
...
}

Error: file provisioner error

│ with google_compute_instance.this,
│ on server.tf line 70, in resource "google_compute_instance" "this":
│ 70: provisioner "file" {

│ timeout - last error: dial tcp 34.145.0.52:22: i/o timeout

{
....

}

this is the error in google

However, without modifying any value, just running it with Terraform 1.0 does not give an error and it is deployed without error.

azure.......

connection {
type = "ssh"
timeout = "3m"
host = self.public_ip_address
user = var.ssh_username
private_key = var.keys.private
}

provisioner "file" {
....
}

│ Error: file provisioner error

│ with azurerm_linux_virtual_machine.this,
│ on server.tf line 98, in resource "azurerm_linux_virtual_machine" "this":
│ 98: provisioner "file" {

│ Upload failed: scp: ~/.ssh: No such file or directory

{
.....
}

same case that google, it working with Terraform 1.0 not with (1.1.2, 1.1.3)

in Oracle and AWS too

some help?

thanks

@reyeliher reyeliher added bug new new issue not yet triaged labels Jan 10, 2022
@apparentlymart
Copy link
Contributor

Hi @reyeliher!

It looks like you've encountered the same problem as previously discussed in #30243. This was the result of an intentional change to address a security-related concern, where the destination argument is no longer subject to shell expansion on the remote system.

In response to that report, we added a new section to the Terraform v1.1 upgrade guide with further guidance: Interpretation of remote file paths in the remote-exec and file provisioners.

The gist of it is to remove the ~/ from that path, so that the destination would be just .ssh, which should then be understood by the remote scp process as being relative to the target user's home directory.

I'm going to close this issue just because the other issue already covers the same problem. Thanks for reporting this!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants