hashicorp/packer · error
%q doesn't appear to be a valid %q source address; check sou
Error message
%q doesn't appear to be a valid %q source address; check source and try again.
What it means
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.
Source
Thrown at packer/plugin-getter/github/getter.go:185
return t.Base
}
return http.DefaultTransport
}
type GithubPlugin struct {
Hostname string
Namespace string
Type string
}
func NewGithubPlugin(source *addrs.Plugin) (*GithubPlugin, error) {
parts := source.Parts()
if len(parts) != 3 {
return nil, fmt.Errorf("Invalid github.com URI %q: a Github-compatible source must be in the github.com/<namespace>/<name> format.", source.String())
}
if parts[0] != defaultHostname {
return nil, fmt.Errorf("%q doesn't appear to be a valid %q source address; check source and try again.", source.String(), defaultHostname)
}
return &GithubPlugin{
Hostname: parts[0],
Namespace: parts[1],
Type: strings.Replace(parts[2], "packer-plugin-", "", 1),
}, nil
}
func (gp GithubPlugin) RealRelativePath() string {
return path.Join(
gp.Namespace,
fmt.Sprintf("packer-plugin-%s", gp.Type),
)
}
func (gp GithubPlugin) PluginType() string {
return fmt.Sprintf("packer-plugin-%s", gp.Type)View on GitHub (pinned to eb36e3c3e4)
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.
Example fix
// before source = "github.corp.internal/hashicorp/amazon" // after source = "github.com/hashicorp/amazon"
Defensive patterns
Strategy: validation
Validate before calling
parts := strings.Split(strings.Trim(source, "/"), "/")
if len(parts) == 3 && parts[0] != "github.com" {
return fmt.Errorf("host %q is not supported by the github getter; use github.com", parts[0])
} Try / catch
if err := initPlugins(); err != nil {
if strings.Contains(err.Error(), "valid \"github.com\" source address") { /* correct hostname in source */ }
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Invalid github.com URI %q: a Github-compatible source must b
- The `bucket_name` must be specified
- `channel` is currently a required field.
- the `bucket_name` must be specified
- the `channel_name` must be specified
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/0e70b42f73e3b2fe.
Report an issue: GitHub.