Loading...
Loading...
### Terraform Version ```shell Terraform v1.13.3 on linux_amd64 ``` ### Terraform Configuration Files ```terraform terraform { backend "consul" { address = "192.168.1.30:8500" scheme = "http" path = "terraform/state" } } ``` ### Debug Output ``` terraform init 2025-09-25T21:40:45.235-0400 [INFO] Terraform version: 1.13.3 2025-09-25T21:40:45.235-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.74.1 2025-09-25T21:40:45.235-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.24.0 2025-09-25T21:40:45.235-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2025-09-25T21:40:45.235-0400 [DEBUG] using github.com/zclconf/go-cty v1.16.3 2025-09-25T21:40:45.235-0400 [INFO] Go runtime version: go1.24.5 2025-09-25T21:40:45.235-0400 [INFO] CLI args: []string{"terraform", "init"} 2025-09-25T21:40:45.235-0400 [TRACE] Stdout is a terminal of width 156 2025-09-25T21:40:45.235-0400 [TRACE] Stderr is a terminal of width 156 2025-09-25T21:40:45.235-0400 [TRACE] Stdin is a terminal 2025-09-25T21:40:45.235-0400 [DEBUG] Attempting to open CLI config file: /home/user/.terraformrc 2025-09-25T21:40:45.235-0400 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /home/user/.terraform.d/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /home/user/.local/share/terraform/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /home/user/.local/share/flatpak/exports/share/terraform/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /var/lib/flatpak/exports/share/terraform/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins 2025-09-25T21:40:45.235-0400 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins 2025-09-25T21:40:45.235-0400 [INFO] CLI command args: []string{"init"} Initializing the backend... 2025-09-25T21:40:45.236-0400 [TRACE] Meta.Backend: built configuration for "consul" backend with hash value 1439040377 2025-09-25T21:40:45.236-0400 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory 2025-09-25T21:40:45.236-0400 [TRACE] Meta.Backend: moving from default local state only to "consul" backend 2025-09-25T21:40:45.236-0400 [DEBUG] checking for provisioner in "." 2025-09-25T21:40:45.241-0400 [DEBUG] checking for provisioner in "/usr/bin" 2025-09-25T21:40:45.241-0400 [TRACE] backend/local: state manager for workspace "default" will: - read initial snapshot from terraform.tfstate - write new snapshots to terraform.tfstate - create any backup at terraform.tfstate.backup 2025-09-25T21:40:45.241-0400 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate 2025-09-25T21:40:45.241-0400 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay 2025-09-25T21:40:45.241-0400 [TRACE] statemgr.Filesystem: read nil snapshot 2025-09-25T21:40:45.241-0400 [TRACE] Meta.Backend: ignoring local "default" workspace because its state is empty ╷ │ Error: Failed to get existing workspaces: Unexpected response code: 500 (invalid key name, keys should respect the "^[a-zA-Z0-9,_./\\-?&=]+$" format) ``` The error from the Consul logs: ``` 2025-09-26T01:40:45.248800+00:00 pi01 consul[1212181]: 2025-09-26T01:40:45.247Z [ERROR] agent.http: Request error: method=GET url="/v1/kv/terraform/state-env:?keys=&separator=%2F" from=10.50.2.12:57896 error="invalid key name, keys should respect the \"^[a-zA-Z0-9,_./\\-?&=]+$\" format" ``` ### Expected Behavior A successful init when using Consul `v1.21.5`, the same way as it is working on `v1.21.4` ### Actual Behavior The init is failing with ``` Error: Failed to get existing workspaces: Unexpected response code: 500 (invalid key name, keys should respect the "^[a-zA-Z0-9,_./\\-?&=]+$" format) ``` It work well on Consul v1.21.4 It's unclear if this is a temporary bug in Consul that will be fixed, or a new, permanent feature. The pull request (https://github.com/hashicorp/consul/pull/22682) calls this a fix, which implies that others will now have to adjust their configurations. Given that both are HashiCorp products, a seamless integration should be a priority. ### Steps to Reproduce 1. Install/Upgrade Consul version 1.21.5 2. Configure the Consul Backend 3. Run `terraform init` ### Additional Context _No response_ ### References https://github.com/hashicorp/consul/pull/22682 ### Generative AI / LLM assisted development? _No response_
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.