# Error: Failed to download module: could not download module: source not found

- **ID:** `terraform/terraform-init-module-source-error`
- **Domain:** terraform
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 87%

## Root Cause

The module source URL or path specified in the configuration is incorrect, unreachable, or requires authentication.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.5.0 | active | — | — |
| 1.6.0 | active | — | — |
| 1.7.0 | active | — | — |
| 1.8.0 | active | — | — |

## Workarounds

1. **Verify the module source in the configuration. For example, if using a Git repo, ensure the URL is correct: module "vpc" { source = "git::https://github.com/org/terraform-aws-vpc.git?ref=v1.0.0" }. Test the URL in a browser or with git clone.** (90% success)
   ```
   Verify the module source in the configuration. For example, if using a Git repo, ensure the URL is correct: module "vpc" { source = "git::https://github.com/org/terraform-aws-vpc.git?ref=v1.0.0" }. Test the URL in a browser or with git clone.
   ```
2. **If the module is from the Terraform Registry, ensure the source is in the format "namespace/name/provider". Run terraform init -from-module=namespace/name/provider to test.** (85% success)
   ```
   If the module is from the Terraform Registry, ensure the source is in the format "namespace/name/provider". Run terraform init -from-module=namespace/name/provider to test.
   ```
3. **For local modules, ensure the path is relative to the root module and exists. Use an absolute path for testing: source = "/home/user/modules/my-module".** (80% success)
   ```
   For local modules, ensure the path is relative to the root module and exists. Use an absolute path for testing: source = "/home/user/modules/my-module".
   ```

## Dead Ends

- **Run terraform init -upgrade without checking the source URL.** — If the source URL is wrong, upgrading won't fix it; it will just try the same wrong URL again. (90% fail)
- **Set GIT_TERMINAL_PROMPT=1 and hope for an interactive prompt.** — This only helps if the source is a private Git repo and you need to enter credentials, but the error says 'source not found', not authentication failure. (70% fail)
- **Delete the .terraform directory and run terraform init again.** — This only clears the local cache; it doesn't fix the invalid source reference. (95% fail)
