hashicorp/packer · error
a Host must be specified, please reference your communicator
Error message
a Host must be specified, please reference your communicator documentation
What it means
Config validation error from the null builder's Prepare: the communicator type is not "none" but no host is set, so Packer has no machine to connect to. The null builder delegates connection checks to the communicator config and only runs when type != none.
Source
Thrown at builder/null/config.go:43
err := config.Decode(c, &config.DecodeOpts{
PluginType: BuilderId,
Interpolate: true,
InterpolateFilter: &interpolate.RenderFilter{},
}, raws...)
if err != nil {
return nil, err
}
var errs *packersdk.MultiError
if es := c.CommConfig.Prepare(nil); len(es) > 0 {
errs = packersdk.MultiErrorAppend(errs, es...)
}
if c.CommConfig.Type != "none" {
if c.CommConfig.Host() == "" {
errs = packersdk.MultiErrorAppend(errs,
fmt.Errorf("a Host must be specified, please reference your communicator documentation"))
}
if c.CommConfig.User() == "" {
errs = packersdk.MultiErrorAppend(errs,
fmt.Errorf("a Username must be specified, please reference your communicator documentation"))
}
if !c.CommConfig.SSHAgentAuth && c.CommConfig.Password() == "" && c.CommConfig.SSHPrivateKeyFile == "" {
errs = packersdk.MultiErrorAppend(errs,
fmt.Errorf("one authentication method must be specified, please reference your communicator documentation"))
}
if (c.CommConfig.SSHAgentAuth &&
(c.CommConfig.SSHPassword != "" || c.CommConfig.SSHPrivateKeyFile != "")) ||
(c.CommConfig.SSHPassword != "" && c.CommConfig.SSHPrivateKeyFile != "") {
errs = packersdk.MultiErrorAppend(errs,
fmt.Errorf("only one of ssh_agent_auth, ssh_password, and ssh_private_key_file must be specified"))
View on GitHub (pinned to eb36e3c3e4)
Solutions
- Set communicator.host (or host) to the address of the existing machine you want to provision
- Set communicator = "none" if you don't need a connection for this build
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at builder/null/config.go:43 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/bd410b2ff14e4e2a.
Report an issue: GitHub.