Introduction
Problem
The following API call gives an error when trying to get the outputs of the workspace.
curl \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/vnd.api+json" \
https://app.terraform.io/api/v2/workspaces/ws-XXXX/current-state-version-outputsError:
"errors":[{"status":"503","title":"service unavailable","detail":"Please wait while outputs are parsed from the latest state version","retry_after_sec":"3"}]}%Prerequisites
- TFE on Kubernetes, version 1.0.1 & version 1.0.2.
- TFE application is running for more than 24h.
- The user has waited a reasonable amount of time based on the number of resources on the workspace.
Cause
- This error is caused by an internal Bug raised with Hashicorp Engineering.
-
We observed the following flag
resources-processedis not turningtruewhen the 503 error appears.How to check the value of
resource-processedusing the API:curl \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/vnd.api+json" \ https://app.terraform.io/api/v2/workspaces/<ws-XXXX>/current-state-version Output: "resources-processed":false,
Workarounds
Use any of the following workarounds. There are 3 different workarounds to choose from where option 1 is preferred.
1. (preferred)
In your Terraform Enterprise configuration file add the environment variable TFE_USAGE_REPORTING_DISABLED=true
NOTE: This will disable the TFE product usage reporting.
2. Restart the terraform-enterprise pod
NOTE: Needs to be repeated every time the error appears.
3. Restart the sidekiq process inside the Terraform Enterprise container:
supervisorctl restart tfe:sidekiq
NOTE: Needs to be repeated every time the error appears.
Solution
Upgrade to Terraform Enterprise to version 1.0.3
Outcome
The outputs will be available using the API call