{"record":{"id":"09329302662f97dd","repo":"hashicorp/terraform","slug":"invalid-source-address-s","errorCode":null,"errorMessage":"invalid source address: %s","messagePattern":"invalid source address: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/getmodules/moduleaddrs/detect_remote_shorthands.go","lineNumber":93,"sourceCode":"\t\t\t// have to ensure the path isn't escaped.\n\t\t\tu.RawPath = u.Path\n\n\t\t\tresult = u.String()\n\t\t}\n\n\t\t// Preserve the forced getter if it exists. We try to use the\n\t\t// original set force first, followed by any force set by the\n\t\t// detector.\n\t\tif getForce != \"\" {\n\t\t\tresult = fmt.Sprintf(\"%s::%s\", getForce, result)\n\t\t} else if detectForce != \"\" {\n\t\t\tresult = fmt.Sprintf(\"%s::%s\", detectForce, result)\n\t\t}\n\n\t\treturn result, nil\n\t}\n\n\treturn \"\", fmt.Errorf(\"invalid source address: %s\", src)\n}\n\nfunc getForcedSourceType(src string) (string, string) {\n\tvar forced string\n\tif ms := forcedRegexp.FindStringSubmatch(src); ms != nil {\n\t\tforced = ms[1]\n\t\tsrc = ms[2]\n\t}\n\n\treturn forced, src\n}\n","sourceCodeStart":75,"sourceCodeEnd":105,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/getmodules/moduleaddrs/detect_remote_shorthands.go#L75-L105","documentation":"The terminal fallback of the remote-shorthand detector: no detector matched and the source is not a recognizable remote address. After all detectors (GitHub, BitBucket, GCS, S3, etc.) and forced-source handling fail to produce a result, the function gives up and labels the source invalid.","triggerScenarios":"A module source that is neither a local path nor a recognized remote scheme reaches the detector — e.g. an unrecognizable host, a typo'd scheme, or a bare filename.","commonSituations":"Typo in source ('gihub.com/...'); unsupported host; missing scheme on a custom Git server; using a source format the legacy detector does not handle.","solutions":["If the module is local, prefix it with './' or '../' so it is treated as a local path.","If remote, add an explicit scheme/force prefix: 'git::https://...' or 'git::ssh://...'.","Fix typos in the host name (github.com, bitbucket.org, etc.).","Confirm the source is one of the supported detector formats."],"exampleFix":"# before (typo, no detector matches)\nsource = \"gihub.com/org/repo\"\n\n# after\nsource = \"github.com/org/repo\"\n# or for an unsupported host:\nsource = \"git::https://git.example.com/org/repo.git\"","handlingStrategy":"validation","validationCode":"// Classify a source before passing it to the detector.\n// func classifySource(src string) (kind string, err error) {\n//     if strings.HasPrefix(src, \"./\") || strings.HasPrefix(src, \"../\") { return \"local\", nil }\n//     for _, p := range []string{\"github.com/\", \"bitbucket.org/\", \"googleapis.com/\", \".amazonaws.com/\"} {\n//         if strings.HasPrefix(src, p) || strings.Contains(src, p) { return \"remote\", nil }\n//     }\n//     if ms := forcedRegexp.FindStringSubmatch(src); ms != nil { return \"remote\", nil }\n//     return \"\", fmt.Errorf(\"invalid source address: %s\", src)\n// }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefix local sources with './' or '../'.","Add explicit scheme/force prefix (git::, s3::, gcs::) for unsupported hosts.","Spell-check hostnames (github.com, bitbucket.org)."],"tags":["module-address","detection","validation"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}