Introduction
Problem
After migrating to `202209-2`, Terraform Enterprise fails to start up due to a Postgres version incompatibility.
To verify this, you can find errors similar to this in the output of docker logs tfe-migrations:
2022-11-18T21:33:47.288945604Z StandardError: An error has occurred, all later migrations canceled:
2022-11-18T21:33:47.288954905Z
2022-11-18T21:33:47.288961505Z PG::SyntaxError: ERROR: syntax error at or near "PROCEDURE"
2022-11-18T21:33:47.288968406Z LINE 2: CREATE OR REPLACE PROCEDURE execute_transaction()
Prerequisites (if applicable)
- Terraform Enterprise 202209-02 or later
- Postgres 10.x or 9.x
Cause
- Terraform Enterprise 202209-2 and later versions are no longer compatible with Postgres 10.x or 9.x
- https://developer.hashicorp.com/terraform/enterprise/releases/2022/v202209-2
Overview of possible solutions (if applicable)
Solutions:
-
Upgrade the Postgres version of the system that TFE is using as RDB storage to 11.x or higher.