Problem
A new module version fails to upload to the Terraform Enterprise Private Module Registry. When you check the module's status using the Get a Module API, the status remains reg_ingressing and does not progress to setup_complete.
Prerequisites
- Terraform Enterprise versions prior to
v202308-1.
Cause
This issue can occur if an invalid or malformed file is present in the module directory. In Terraform Enterprise versions before v202308-1, the system did not properly validate certain types of corrupt files during the upload process, causing publishing to fail.
For example, a symbolic link may be incorrectly configured with file content instead of a path, as shown in this output.
$ examples/test-module ls -lahl
##...
lrwxrwxrwx variables.tf ⇒ variable "region_primary" {type = stringdescription = "AWS primary region to deploy to"}Solution
Follow these steps to resolve the issue.
-
Inspect and Correct Module Files
Review the contents of your module files. Check to ensure they are valid, do not contain incorrect symlinks, and are not otherwise malformed or corrupt. Correct any invalid files you find.
-
Delete the Failed Module Version
Once you have corrected the files, delete the failed module version using the Delete a Module API.
-
Re-publish the Module Version
- If using a VCS integration, ensure the invalid file is not included in any tagged version of the module. You can either delete the tag associated with the failed version or increment the version number with a new tag. A new tagged version will trigger Terraform Enterprise to ingress the new version.
- If uploading directly, re-upload the corrected module version.
Note: If the entire module is failing to upload (not just a single version), you may need to delete the entire module and upload it again after confirming all invalid files have been corrected.
Outcome
After you remove or correct the invalid files and re-upload, the new module or module version should successfully upload and ingress to the Private Module Registry in Terraform Enterprise.