{"record":{"id":"0e70b42f73e3b2fe","repo":"hashicorp/packer","slug":"q-doesn-t-appear-to-be-a-valid-q-source-address","errorCode":null,"errorMessage":"%q doesn't appear to be a valid %q source address; check source and try again.","messagePattern":"%q doesn't appear to be a valid %q source address; check source and try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/github/getter.go","lineNumber":185,"sourceCode":"\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)\n}\n\nfunc (gp GithubPlugin) PluginType() string {\n\treturn fmt.Sprintf(\"packer-plugin-%s\", gp.Type)","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/github/getter.go#L167-L203","documentation":"NewGithubPlugin additionally requires the first address part to equal the default hostname \"github.com\". This error is returned when the source address is well-formed (3 parts) but its host component is not github.com, so the GitHub getter cannot handle it.","triggerScenarios":"Calling Get with sources like \"gitlab.com/org/name\", \"github.corp.internal/team/plugin\", or any three-part address whose parts[0] != defaultHostname being routed to the github getter.","commonSituations":"Using a GitHub Enterprise or other forge address that the github getter doesn't support; mixing up source schemes so a non-github address reaches the github plugin getter; typos like \"gihub.com/org/name\" that still pass the 3-part check only if split correctly — more commonly wrong-host entries in required_plugins.","solutions":["Ensure the source host is exactly github.com for the github getter.","Use the correct protocol/hostname scheme for other forges (e.g. full URLs with supported protocols) instead of routing them through github.com addressing.","Fix typos in the hostname portion of the source string.","Check Packer docs/plugin listing for the correct source address format of the plugin you want."],"exampleFix":"// before\nsource = \"github.corp.internal/hashicorp/amazon\"\n\n// after\nsource = \"github.com/hashicorp/amazon\"","handlingStrategy":"validation","validationCode":"parts := strings.Split(strings.Trim(source, \"/\"), \"/\")\nif len(parts) == 3 && parts[0] != \"github.com\" {\n    return fmt.Errorf(\"host %q is not supported by the github getter; use github.com\", parts[0])\n}","typeGuard":null,"tryCatchPattern":"if err := initPlugins(); err != nil {\n    if strings.Contains(err.Error(), \"valid \\\"github.com\\\" source address\") { /* correct hostname in source */ }\n}","preventionTips":["Use the documented source scheme for each forge; don't route non-github hosts through github.com sources.","Double-check hostname spelling in required_plugins blocks.","Verify with `packer validate` before builds; keep plugin sources centralized and reviewed."],"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"}