Problem
When you publish a new module version in Terraform Enterprise, the update fails without a clear error message in the user interface.
Cause
While the Terraform Enterprise UI may not display a specific error, detailed logs are available in the tfe-sidekiq container. These logs can help you identify the root cause of the module ingress failure.
Solutions
You can find the reason for the module version failing to upload by reviewing the logs in the tfe-sidekiq container. The following solutions address common errors found in the logs.
Solution 1: Resolve "Version has already been taken" error
This error occurs if you attempt to publish a module with a version tag that already exists in the registry. The log entry will appear similar to the following.
WARN: ActiveRecord::RecordInvalid: Validation failed: Version has already been taken
To resolve this, publish the module again using a new, unique version number.
Solution 2: Resolve "invalid configuration_aliases value" error
This error indicates a syntax issue in your provider configuration, where a provider alias does not have the correct prefix. The tfe-sidekiq log may show an error similar to the following.
{
"status": "reg_ingress_failed",
"error": "error loading the module: Invalid configuration_aliases value: Configuration aliases must be prefixed with the provider name. Expected \"azurerm\", but found \"$WRONGALIAS\" (in providers.tf on line 5)"
}The error message indicates the specific file and line number causing the issue, such as line 5 in providers.tf. Correct the provider alias in the specified file to resolve the error.
Additional Information
For more information on provider configuration, please refer to the official Terraform documentation on provider aliases.