How to fix Failed to enqueue cost estimate or Sentinel Policy check in Terraform

TerraformINTERMEDIATEHIGHUpdated Dec 30, 2025· 150 views

This error occurs in Terraform Enterprise/Cloud when the cost estimation service or Sentinel policy checker fails to enqueue jobs. Common causes include database schema issues after upgrades, network connectivity problems, or resource limitations.

Quick fix

Fixes Failed to enqueue cost estimate or Sentinel Policy check

# On your TFE instance, check version
curl http://localhost:8080/_health_check | grep -i version
  1. Check Terraform Enterprise version and recent upgrades
  2. Generate a support bundle and check task worker logs
  3. Verify database connectivity and run migrations
  4. For Docker Compose deployments, verify network configuration
terraform — error
# On your TFE instance, check version
curl http://localhost:8080/_health_check | grep -i version
Failed to enqueue cost estimate or Sentinel Policy check

What this error means

The "Failed to enqueue cost estimate or Sentinel Policy check" error indicates that Terraform Enterprise or Terraform Cloud encountered a failure while attempting to queue either a cost estimation job or a policy evaluation job. This typically happens in Terraform Enterprise environments, particularly after version upgrades or infrastructure changes. The error suggests a backend service issue rather than a problem with your Terraform configuration. The cost estimation service and Sentinel policy worker are background services that process these requests asynchronously, and when they fail to queue, it usually indicates a database schema mismatch, network configuration issue, or service availability problem.

Typical symptoms

  • Cost estimation fails with 'Failed to enqueue cost estimate' message during plan phase
  • Sentinel policy checks fail with 'Failed to enqueue' error
  • Terraform runs hang or fail during the policy evaluation stage
  • Error appears in tfe-task-worker.stdout logs mentioning database schema issues
  • Database migration errors visible in support bundles

Common causes

  1. After upgrading Terraform Enterprise with a mounted disk instance, required database schemas (task_worker schema) were not created due to a bug
  2. Database driver unable to process NULL values in schema queries (SQL: Scan error on column index 0, name 'current_schema')
  3. Sentinel worker TCP connection failure on port 8000 due to missing Docker network in containerized deployments
  4. Cost estimation service temporarily unavailable or experiencing high load
  5. Network connectivity issues between task workers and the main application

How to fix "Failed to enqueue cost estimate or Sentinel Policy check"

1Check Terraform Enterprise version and recent upgrades

Verify your Terraform Enterprise version and check if you recently performed an upgrade, especially on a mounted disk instance. The issue affects v202212-x when upgrading from older versions.

bash
# On your TFE instance, check version
curl http://localhost:8080/_health_check | grep -i version

If you recently upgraded, this is likely the root cause and requires database schema recreation.

2Generate a support bundle and check task worker logs

Create a support bundle from the Terraform Enterprise console (Settings > Diagnostics > Request support bundle) and examine the tfe-task-worker.stdout file.

Look for errors like:

bash
error running database migrations
database driver: sql: Scan error on column index 0, name 'current_schema': converting NULL to string is unsupported

If you see these database schema errors, the task_worker schema is missing and needs to be created.

3Verify database connectivity and run migrations

Ensure the database service is healthy and all migrations have run.

bash
# For mounted disk instances, restart the application
# This will trigger any pending migrations
sudo systemctl restart tfe

# Or, if using Docker Compose, restart services
docker-compose restart

The task_worker schema will be automatically created during application restart if it's missing.

4For Docker Compose deployments, verify network configuration

If using Terraform Enterprise in Docker Compose, ensure the Sentinel worker network is configured correctly.

Check your docker-compose file for:

bash
# Verify the network exists
docker network ls | grep tfe_terraform_isolation

# If missing, create it
docker network create tfe_terraform_isolation

# Or remove the TFE_RUN_PIPELINE_DOCKER_NETWORK setting to use default bridge
# Edit docker-compose and remove or comment out:
# - TFE_RUN_PIPELINE_DOCKER_NETWORK=tfe_terraform_isolation

Then restart the services:

bash
docker-compose down && docker-compose up -d
5Verify Sentinel worker availability

Check if the Sentinel policy worker service is running and accessible.

bash
# Attempt to connect to Sentinel worker port
curl -v http://127.0.0.1:8000 2>&1 | head -20

# If connection refused, check if the service is running
docker ps | grep sentinel
ps aux | grep sentinel

If the service is not running, restart Terraform Enterprise or the worker containers. If you see "network tfe_terraform_isolation not found", follow Step 4 to fix the Docker network configuration.

6Contact HashiCorp Support if issue persists

If the issue continues after restarting the application and verifying database connectivity, contact HashiCorp Support with:
- Your support bundle (including tfe-task-worker.stdout)
- Terraform Enterprise version
- Deployment type (mounted disk, container, etc.)
- Recent infrastructure or configuration changes

HashiCorp Support can verify database schema creation and provide additional diagnostics.

Advanced notes

The "Failed to enqueue" error can manifest differently depending on your deployment model:

Mounted Disk Instances: This is the most common scenario affecting upgraded TFE instances. The task_worker schema must exist in the database for cost estimation and Sentinel policy evaluation to function. After upgrades, ensure the database has been fully migrated by restarting the application.

Docker Compose Deployments: The Sentinel worker runs in a separate container and requires specific Docker networking. The error "Failed to open TCP connection to 127.0.0.1:8000" indicates the network is not properly configured. The TFE_RUN_PIPELINE_DOCKER_NETWORK setting must reference an existing network (or be removed to use the default bridge).

Troubleshooting Approach: Always start by generating a support bundle to inspect detailed logs. The database schema mismatch error is the most actionable—a simple restart typically fixes it. For networking issues, verify Docker networks are created before starting TFE.

Prevention: When upgrading Terraform Enterprise, plan for extended downtime and run a full application restart to ensure all database migrations complete.

Frequently asked questions

What does "Failed to enqueue cost estimate or Sentinel Policy check" mean?
The "Failed to enqueue cost estimate or Sentinel Policy check" error indicates that Terraform Enterprise or Terraform Cloud encountered a failure while attempting to queue either a cost estimation job or a policy evaluation job. This typically happens in Terraform Enterprise environments, particularly after version upgrades or infrastructure changes. The error suggests a backend service issue rather than a problem with your Terraform configuration.
How do I fix "Failed to enqueue cost estimate or Sentinel Policy check"?
This error occurs in Terraform Enterprise/Cloud when the cost estimation service or Sentinel policy checker fails to enqueue jobs. Common causes include database schema issues after upgrades, network connectivity problems, or resource limitations.
What causes "Failed to enqueue cost estimate or Sentinel Policy check"?
After upgrading Terraform Enterprise with a mounted disk instance, required database schemas (task_worker schema) were not created due to a bug Database driver unable to process NULL values in schema queries (SQL: Scan error on column index 0, name 'current_schema') Sentinel worker TCP connection failure on port 8000 due to missing Docker network in containerized deployments
Is the "Failed to enqueue cost estimate or Sentinel Policy check" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading