Problem
When executing a Terraform plan that uses the tfe provider, you may encounter the following error message:
Error: Failed to initialize HTTP client
with provider["registry.terraform.io/hashicorp/tfe"],
on main.tf line 10, in provider "tfe":
10: provider "tfe" {
idna: disallowed rune U+0009Cause
This error occurs when the value for the hostname argument in the provider configuration, or the TFE_HOSTNAME environment variable, contains an invisible whitespace character. The error message disallowed rune U+0009 specifically indicates the presence of a horizontal tab character.
Other common unicode values for whitespace characters that could cause a similar error include:
-
U+0020(Space) -
U+000A(Line Feed)
These characters are often introduced by accidental copy-and-paste actions.
Solution
To resolve this issue, you must remove the extra space or tab character(s) from the end of the address that is set for the hostname argument or the TFE_HOSTNAME environment variable.
- Inspect the value provided for the Terraform Enterprise or HCP Terraform hostname in your configuration (
.tffiles) or environment variables. - Carefully delete any trailing whitespace or invisible characters.
- Save the corrected configuration and run
terraform planagain.