Problem
The Terraform Enterprise application may fail to start when upgrading to v202310-1, v202311-1, v202312-1, or v202401-1 due to the PopulateWorkspaceNoCodeModuleVersion migration failing. Docker container logs will show an error similar to the following:
== 20230821102201 PopulateWorkspaceNoCodeModuleVersion: migrating ============="}
0/45 0% calculating..."}
[ERROR] msg=No-Code Provisioning: Could not get module metadata name=<MODULE> provider=<PROVIDER> version=<VERSION> organization=<ORG> response={\"errors\":[\"Error loading module metadata\"]}"}
Cause
The PopulateWorkspaceNoCodeModuleVersion is a required migration which must pass for the application to start. Since the migration failed, the application will fail to start. The migration failure is caused by a unique scenario where the module metadata endpoint returns a 500 error. This occurs when looking up a module version's metadata which failed to properly ingress.
Solution
Engineering has released a hotfix for this issue in v202401-2. The module metadata endpoint will now return with a 404 response instead of a 500 response when looking up a module version which failed to ingress. This change will prevent the migration from failing when looking up a module version which is in an unhealthy state.
In order to recover the environment, a rollback of the application is necessary. Please follow the standard rollback procedures and upgrade directly to v202401-2 or higher on your next upgrade attempt.
Additional Information
References
Terraform Enterprise Release Notes (v202401-2)