Problem
In Terraform Enterprise (TFE) or HCP Terraform workspaces using self-hosted agents, runs fail during the apply phase. The raw log for the run may hang with an undefined entry or no new output, and the agent logs display the following error.
[INFO] core: Job received: job.type=apply job.id=run-xxxxxxx [ERROR] agent: Failed handling job: error= | failed decoding run: 1 error(s) decoding: | | * '' has invalid keys: runtime_report_url
Cause
This error is caused by a known bug in the tfc-agent binary that affects versions 1.7.0 and earlier. The agent fails to decode run information for assessments, which prevents the apply from proceeding.
Solutions
This issue is resolved in tfc-agent version 1.7.1 and newer. To fix the problem, you must upgrade the agent binary.
Solution 1: Upgrade the tfc-agent Binary
- Download an updated
tfc-agentbinary, version 1.7.1 or newer, from the official releases page. - Follow your standard procedures to deploy the new binary to all of your self-hosted agents.
- In the TFE or HCP Terraform UI, cancel any runs that are currently stuck in the apply phase.
- Queue a new run in the affected workspace to confirm the agent processes it correctly.
Outcome
After upgrading the self-hosted agents to version 1.7.1 or newer, new runs will complete successfully without encountering the decoding error.