Problem:
When publishing a new module version on Terraform Enterprise, it fails with no clear error messaging in the UI.
Solutions:
You can often verify the reason for your module version failing to upload by reviewing the logs in tfe-sidekiq
. The below list is not an exhaustive list of reasons, but provides some examples that can be searched for.
WARN: ActiveRecord::RecordInvalid: Validation failed: Version has already been taken
To resolve, try a different version number.
"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)"}
You can refer to the invalid configuration_aliases
error line in the logs , as it will indicate the line and file where the error occurs. For instance, in the scenario mentioned earlier , the error is pinpointed to line 5 of the providers.tf line.