hashicorp/packer · error
The source URL must have at most 16 components, and the one
Error message
The source URL must have at most 16 components, and the one provided has %d. This is unsupported by Packer, please consider using a source that has less components to it. If this is a blocking issue for you, please open an issue to ask for supporting more components to the source URI.
What it means
ParsePluginSourceString caps plugin source addresses at 16 path components (plug.Parts()). Sources split into more segments than that are unsupported by Packer's plugin addressing, and the error invites opening an issue if the limit is a blocker.
Source
Thrown at hcl2template/addrs/plugin.go:206
"\nDid you mean %q?", userErrorPrefix, suggestedType)
}
}
// Otherwise, probably instead an incorrectly-named plugin, perhaps
// arising from a similar instinct to what causes there to be
// thousands of Python packages on PyPI with "python-"-prefixed
// names.
return nil, fmt.Errorf("Plugin source has a type with the %q prefix, which isn't valid.\n"+
"If you are the author of this plugin, rename it to not include the prefix.\n"+
"Ex: %q",
redundantPrefix,
strings.Replace(givenName, redundantPrefix, "", 1))
}
plug := &Plugin{
Source: str,
}
if len(plug.Parts()) > 16 {
return nil, fmt.Errorf("The source URL must have at most 16 components, and the one provided has %d.\n"+
"This is unsupported by Packer, please consider using a source that has less components to it.\n"+
"If this is a blocking issue for you, please open an issue to ask for supporting more "+
"components to the source URI.",
len(plug.Parts()))
}
return plug, nil
}
View on GitHub (pinned to eb36e3c3e4)
Solutions
- Flatten or shorten the repository path so it has at most 16 components
- Use a redirect, proxy, or shorter alias/vanity hostname for the deeply nested repo
- Open a Packer issue if the limit genuinely blocks your source layout
Example fix
// before source = "git.example.com/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/my-plugin" // after (aliased, <=16 parts) source = "plugins.example.com/my-plugin"
Defensive patterns
Strategy: validation
Validate before calling
if len(strings.Split(src, "/")) > 16 { /* shorten or alias source before installing */ } Prevention
- Use vanity hostnames or redirects for deeply nested repo paths
- Keep plugin repos near the git host root
- Count source path segments in CI checks
When it happens
Trigger: ParsePluginSourceString given a source with more than 16 slash-separated components, e.g. a deeply nested enterprise git host path with 17+ segments.
Common situations: Corporate Git servers with deep group/subgroup nesting (GitLab nested namespaces); auto-generated source strings from internal tooling.
Related errors
- cannot use multiple consecutive dashes
- must contain only letters, digits, and dashes, and may not u
- The provided source URL is invalid. The following errors hav
- Invalid plugin type %q in source: %s"
- Plugin source has a type with the prefix %q, which isn't val
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/1f0d9433bd65e0b8.
Report an issue: GitHub.