{"record":{"id":"0ba30dd1236ace48","repo":"hashicorp/packer","slug":"invalid-github-com-uri-q-a-github-compatible-sou","errorCode":null,"errorMessage":"Invalid github.com URI %q: a Github-compatible source must be in the github.com/<namespace>/<name> format.","messagePattern":"Invalid github\\.com URI %q: a Github-compatible source must be in the github\\.com/<namespace>/<name> format\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/github/getter.go","lineNumber":181,"sourceCode":"}\n\nfunc (t *HostSpecificTokenAuthTransport) base() http.RoundTripper {\n\tif t.Base != nil {\n\t\treturn t.Base\n\t}\n\treturn http.DefaultTransport\n}\n\ntype GithubPlugin struct {\n\tHostname  string\n\tNamespace string\n\tType      string\n}\n\nfunc NewGithubPlugin(source *addrs.Plugin) (*GithubPlugin, error) {\n\tparts := source.Parts()\n\tif len(parts) != 3 {\n\t\treturn nil, fmt.Errorf(\"Invalid github.com URI %q: a Github-compatible source must be in the github.com/<namespace>/<name> format.\", source.String())\n\t}\n\n\tif parts[0] != defaultHostname {\n\t\treturn nil, fmt.Errorf(\"%q doesn't appear to be a valid %q source address; check source and try again.\", source.String(), defaultHostname)\n\t}\n\n\treturn &GithubPlugin{\n\t\tHostname:  parts[0],\n\t\tNamespace: parts[1],\n\t\tType:      strings.Replace(parts[2], \"packer-plugin-\", \"\", 1),\n\t}, nil\n}\n\nfunc (gp GithubPlugin) RealRelativePath() string {\n\treturn path.Join(\n\t\tgp.Namespace,\n\t\tfmt.Sprintf(\"packer-plugin-%s\", gp.Type),\n\t)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/github/getter.go#L163-L199","documentation":"NewGithubPlugin validates a plugin source address and requires it to resolve to exactly three parts (github.com/<namespace>/<name>). This error is returned when the address splits into a different number of components, so it is not a well-formed Github-compatible source URI.","triggerScenarios":"Calling Get with a required_plugins source like \"github.com/hashicorp\" (missing name), \"github.com/hashicorp/name/extra\" (too many parts), or any address whose Parts() does not yield exactly 3 elements.","commonSituations":"Copy-pasting a partial plugin path in required_plugins; including a version or subpath in the source string; forgetting that github.com sources must be namespace/name only (no tag/refs).","solutions":["Write the source as github.com/<namespace>/<name> with exactly three slash-separated parts.","Remove extra path segments (versions, subfolders) from the source; pin versions via version constraints instead.","Use full protocol-prefixed sources (e.g. packer-plugin-... paths or other protocols) when not targeting github.com.","Run `packer init` and read the error's %q value to see the exact malformed address."],"exampleFix":"// before\nrequired_plugins {\n  amazon = {\n    source = \"github.com/hashicorp\"\n  }\n}\n\n// after\nrequired_plugins {\n  amazon = {\n    source  = \"github.com/hashicorp/amazon\"\n    version = \">= 1.0.0\"\n  }\n}","handlingStrategy":"validation","validationCode":"parts := strings.Split(strings.Trim(source, \"/\"), \"/\")\nif len(parts) != 3 || parts[0] != \"github.com\" {\n    return fmt.Errorf(\"source %q must be github.com/<namespace>/<name>\", source)\n}","typeGuard":null,"tryCatchPattern":"if err := initPlugins(); err != nil {\n    if strings.Contains(err.Error(), \"Invalid github.com URI\") { /* fix required_plugins source */ }\n}","preventionTips":["Copy source addresses from the plugin's official documentation.","Keep versions in `version =` constraints, never in the source path.","Run `packer validate`/`packer init` in CI to catch malformed sources early."],"tags":["plugin-install","config","github","validation"],"backgroundTag":"invalid-source-address","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}