How to fix Root resource was present, but now absent in Terraform

TerraformINTERMEDIATEHIGHUpdated Dec 30, 2025· 113 views

This error occurs when Terraform successfully creates a resource but cannot verify its existence immediately after. The provider creates the resource but fails to read it back, causing Terraform to believe the resource disappeared.

Quick fix

Fixes Root resource was present, but now absent

terraform import <resource_type>.<resource_name> <resource_id>
  1. Verify the resource actually exists in the remote service
  2. Try applying again
  3. Import the resource into Terraform state
  4. Update the provider to the latest version
terraform — error
terraform import <resource_type>.<resource_name> <resource_id>
Root resource was present, but now absent

What this error means

This error indicates a provider bug or timing issue. When Terraform applies changes, the provider successfully creates a resource in the remote service but then fails to verify it exists when reading back the state. This can happen due to API delays, network timeouts, race conditions, or permission changes that occur during resource creation. The outer error "provider produced an unexpected new value" wraps the inner message "Root resource was present, but now absent", which comes from Terraform's state validation logic.

Typical symptoms

  • Apply command fails after creating a resource
  • Error message includes "Provider produced inconsistent result after apply"
  • Resource may actually exist in the remote service despite Terraform reporting failure
  • Subsequent apply attempts may succeed
  • Issue is intermittent or occurs under high load

Common causes

  1. Provider has a bug in its resource read logic after creation
  2. API response time is too slow, causing read timeout before resource is available
  3. Resource ownership or permissions change during creation, making it unreadable to Terraform
  4. Network latency between Terraform and the remote API
  5. Provider does not wait for resource to be fully available before attempting to read it
  6. Concurrency issues when multiple resources are created simultaneously

How to fix "Root resource was present, but now absent"

1Verify the resource actually exists in the remote service

Before taking any action, confirm that the resource was actually created. Use the provider's web console, CLI, or API to check if the resource exists. Many times the resource is successfully created despite Terraform reporting an error.

2Try applying again

Run terraform apply again. Often the issue is transient and a second apply will succeed, as the resource is now queryable. This is a common short-term workaround.

3Import the resource into Terraform state

If the resource exists in the remote service, import it into your Terraform state:

bash
terraform import <resource_type>.<resource_name> <resource_id>

Then run terraform apply again. This tells Terraform to track an existing resource rather than creating a new one.

4Update the provider to the latest version

Check if your provider has a newer version that fixes this issue:

bash
terraform init -upgrade

Many of these errors have been fixed in recent provider updates. Update your provider constraint in your Terraform configuration to allow newer versions.

5Delete the resource and retry if it's non-critical

If the resource is not critical and already exists in the remote service, you can manually delete it and re-run terraform apply. This is only recommended for development/test environments, not production.

6Add explicit dependencies if using multiple related resources

If creating multiple related resources, add depends_on statements to enforce creation order. This can help with timing issues:

hcl
resource "example_resource" "second" {
  depends_on = [example_resource.first]
  # ...
}

Note: This doesn't always resolve the issue but can help with resource interdependencies.

7Report the issue to the provider maintainers

This is typically a bug in the provider itself. Open an issue on the provider's GitHub repository with:
- Exact error message and stack trace
- Terraform version (terraform version)
- Provider version
- Minimal reproducible configuration
- Steps to reproduce

Include the remote resource ID and whether the resource actually exists after the error.

Advanced notes

This error originates from Terraform's compatibility layer in compatible.go, which validates that resource changes are consistent. It's distinct from other "resource not found" errors because it specifically means the resource *was* present during creation but became absent during state refresh. This can indicate:

1. Resource lifecycle issues: Some resources have complex creation processes where access permissions change during creation (e.g., AWS resources with role assumption, Snowflake resources with ownership transfers)

2. Provider-specific quirks: Different providers handle resource creation verification differently. Some check too early, some have race conditions in their read logic.

3. API behavior: Some cloud APIs have eventual consistency delays. The resource exists but isn't queryable immediately after creation.

4. State file corruption: In rare cases, corrupted state can cause this. Verify your state file integrity if this happens repeatedly.

This error is NOT typically a Terraform core issue—it's almost always a provider-level bug that should be reported to the specific provider maintainers.

Frequently asked questions

What does "Root resource was present, but now absent" mean?
This error indicates a provider bug or timing issue. When Terraform applies changes, the provider successfully creates a resource in the remote service but then fails to verify it exists when reading back the state. This can happen due to API delays, network timeouts, race conditions, or permission changes that occur during resource creation.
How do I fix "Root resource was present, but now absent"?
This error occurs when Terraform successfully creates a resource but cannot verify its existence immediately after. The provider creates the resource but fails to read it back, causing Terraform to believe the resource disappeared.
What causes "Root resource was present, but now absent"?
Provider has a bug in its resource read logic after creation API response time is too slow, causing read timeout before resource is available Resource ownership or permissions change during creation, making it unreadable to Terraform
Is the "Root resource was present, but now absent" 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