Problem
When using Git submodules within a repository connected to an HCP Terraform workspace, you may encounter an error during a run if the Include submodules on clone setting is enabled. The error message is as follows.
Failed to ingress slug: Failed to clone: failed to clone repo: entry not found
Cause
This error can occur when there is an inconsistency between the submodule path defined in the repository's .gitmodules file and the actual directory name of the submodule in the repository.
Solution
To resolve this issue, you must ensure the path attribute in the .gitmodules file exactly matches the submodule's directory name.
- Open the
.gitmodulesfile in the root of your repository. - Locate the relevant submodule configuration block.
Update the
pathvalue to match the directory name of the submodule as it appears in your repository.For example, if the submodule directory is named
example, the configuration should appear as follows.## .gitmodules [submodule "example"] path = example url = git@github.com/<org_name>/<repo_name>
- Commit and push the changes to your repository to trigger a new run in HCP Terraform.