Introduction
Problem
In Terraform Enterprise v202302-1
the runs are stuck in Plan Queued.
The tfe-task-worker container shows the following error message:
{"@level":"info","@message":"2023-02-23T17:29:26.204Z [ERROR] agent: Failed starting
core plugin: error=\"failed configuring core: agent registration failed:
POST https://<tfe-hostname>/api/agent/register: unexpected status code (404 Not Found)\
"","@module":"tfe-task-worker.executor.task-output","@timestamp":
"2023-02-23T17:29:26.205233Z","id":"c364ae0c-d922-4788-ae0b-db8a281489f6",
"name":"agent-run","stream":"stdout"}
Cause
When using the agent run pipeline mode and the Enable agents functionality has been disabled Terraform Enterprise cannot use the agents anymore, therefore the runs are stuck and not planning.
Solutions:
In the TFE Admin Settings: https://<insert-tfe-hostname>/app/admin/settings under Terraform Cloud Agents, the Enable agents functionality needs to be selected as described in the below screenshot:
By selecting this option the agents will be allowed to be used and the agents are only connecting to the internal Terraform Enterprise.
After the functionality is enabled, the previous runs can be cancelled and triggering a new run will result in a successful plan.
NOTE: This is fixed in TFE March release v202303-1
.