terraform icon indicating copy to clipboard operation
terraform copied to clipboard

stdout: error="read |0: file already closed

Open DavidHermes opened this issue 1 year ago • 1 comments

Terraform Version

1.9.0 - 1.9.5 (Linux AMD64)

Terraform Configuration Files

terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "~> 3.116.0" } random = { source = "hashicorp/random" version = "3.3.1" } }

backend "azurerm" {} }

provider "azurerm" { subscription_id = var.subscription_id features {} }

resource "azurerm_resource_group" "test" {

name = "TEST-RG" location = "North Europe"

}

provider "random" {}

Debug Output

[ERROR] provider: error encountered while scanning stdout: error="read |0: file already closed

Expected Behavior

Normal deployment

Actual Behavior

This Error does occur on every deployment but in about 30% of all cases.

Does not occur with terraform 1.8.5

Steps to Reproduce

1.terraform init 2. terraform plan 3. terraform apply

Additional Context

No response

References

A simliar Issue; https://github.com/hashicorp/go-plugin/issues/116

DavidHermes avatar Sep 03 '24 14:09 DavidHermes

Hi @DavidHermes,

That isn't a user-facing error from Terraform, are you experiencing a problem with Terraform planning or applying the configuration?

jbardin avatar Sep 03 '24 15:09 jbardin

It happens when applying a configuration.

DavidHermes avatar Sep 13 '24 07:09 DavidHermes

I can confirm that this issue happens in some deployments. It seems to happen randomly, sometimes I get this error, but then re-running terraform apply with the same exact configuration works. Platform is Ubuntu x64.

This started happening after a recent Terraform update, but I can't pinpoint the exact version. It does not seem to be provider-related, as downgrading to an older Terraform version (1.6.x in my case) fixes it.

hingst avatar Sep 13 '24 10:09 hingst

Hello, the question we're waiting on is if there is an error reported by Terraform in the UI, or if Terraform is not behaving correctly. The log message above is not intended for the end user, it is probably an erroneous log message from an upstream library, but I'd like to rule out any possible Terraform issues before sending this over to other maintainers.

Thanks!

jbardin avatar Sep 17 '24 01:09 jbardin

Since we have not heard back in a while I'm going to close the issue. If you have any updates regarding the issue, feel free to open a new issue with the requested information. If you have more questions, you can also use the community forum where there are more people ready to help.

Thanks!

jbardin avatar Oct 18 '24 17:10 jbardin

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[bot] avatar Nov 18 '24 02:11 github-actions[bot]