Problem
After an external database instance (such as Amazon RDS) used by Terraform Enterprise becomes temporarily unavailable due to events like resizing, failover, or network interruption, Terraform runs may fail with the following error:
Timed out while fetching the configuration version
You may also observe related database connection errors in the tfe-atlas container logs.
msg=SettingStorage::Postgres failed to look up setting 'atlas.base_url'
Cause
Terraform Enterprise maintains persistent connections to its database. When the database instance is altered or becomes temporarily unavailable, these existing connections can become stale or invalid. The application may not automatically re-establish new connections, causing operations that require database access to fail.
Solution
To resolve this issue, you must perform a full restart of the Terraform Enterprise application. This action forces all services to terminate their old database connections and establish new, valid ones upon startup.
- Stop the Terraform Enterprise application using the appropriate commands for your installation type.
- Start the Terraform Enterprise application.
This procedure ensures that all components reconnect to the database instance correctly.