Loading...
Loading...
### Terraform Version <!--- Run `terraform version` to show the version, and paste the result between the ``` marks below. If you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed. --> ``` $ terraform version Terraform v0.13.5 + provider registry.terraform.io/hashicorp/null v3.0.0 ``` ### Terraform Configuration Files <!-- Paste the relevant parts of your Terraform configuration between the ``` marks below. For Terraform configs larger than a few resources, or that involve multiple files, please make a GitHub repository that we can clone, rather than copy-pasting multiple files in here. For security, you can also encrypt the files using our GPG public key at https://www.hashicorp.com/security. --> ```terraform resource "null_resource" "foo" { connection { type = "ssh" user = "invidian" host = "localhost" } provisioner "remote-exec" { inline = [ "echo -e 'this\nis\nmy\nlengthy\nerror\nmessage\nfrom\nthe\nprocess\nwhich\nterraform\nshould\nnot\ntrim.'; exit 1", ] } } ``` ### Expected Behavior `remote-exec` provisioner should wait for all output to be fetched from remote machine before closing the connection, so all output printed by provisioning script is presented to the user. ### Actual Behavior Output from `remote-exec` command is randomly trimmed when provisioning fails, which makes it more difficult to debug. ### Steps to Reproduce 1. `terraform init` 2. `terraform apply` ### Additional Context Using `stdbuf -i0 -o0 -e0` to force-disable the stdout buffer can be used as a workaround for this issue. Sample configuration: ```hcl esource "null_resource" "foo" { connection { type = "ssh" user = "invidian" host = "localhost" } provisioner "remote-exec" { inline = [ "stdbuf -i0 -o0 -e0 echo -e 'this\nis\nmy\nlengthy\nerror\nmessage\nfrom\nthe\nprocess\nwhich\nterraform\nshould\nnot\ntrim.'; exit 1", ] } } ```
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.