hashicorp/packer · error
Unknown address type: %s
Error message
Unknown address type: %s
What it means
The handshake line's third field names the RPC network the plugin is listening on. Packer only knows how to resolve "tcp" and "unix" addresses; any other value is rejected with this error before an address can be resolved.
Source
Thrown at packer/plugin_client.go:360
// Test the API versions
if pluginMajorAPIVersion != pluginsdk.APIVersionMajor {
err = fmt.Errorf("Incompatible API MAJOR version with plugin. "+
"plugin MINOR API version: %s, Ours: %s", pluginMajorAPIVersion, pluginsdk.APIVersionMajor)
return nil, err
}
if pluginMinorAPIVersion > pluginsdk.APIVersionMinor {
err = fmt.Errorf("Incompatible API MINOR version with plugin. "+
"plugin MINOR API version: %s, Ours: %s. Please upgrade Packer.", pluginMinorAPIVersion, pluginsdk.APIVersionMinor)
return nil, err
}
switch network {
case "tcp":
c.address, err = net.ResolveTCPAddr("tcp", netAddr)
case "unix":
c.address, err = net.ResolveUnixAddr("unix", netAddr)
default:
return nil, fmt.Errorf("Unknown address type: %s", network)
}
log.Printf("Received %s RPC address for %s: addr is %s", network, cmd.Path, c.address)
}
return c.address, err
}
func (c *PluginClient) logStderr(r io.Reader) {
logPrefix := filepath.Base(c.config.Cmd.Path)
if logPrefix == "packer" {
// we just called the normal packer binary with the plugin arg.
// grab the last arg from the list which will match the plugin name.
logPrefix = c.config.Cmd.Args[len(c.config.Cmd.Args)-1]
}
bufR := bufio.NewReader(r)
for {
line, err := bufR.ReadString('\n')View on GitHub (pinned to eb36e3c3e4)
Solutions
- Rebuild/reinstall the plugin with the official hashicorp/go-plugin and packer-plugin-sdk versions so it advertises tcp or unix.
- Inspect the plugin's handshake output (run the binary directly) to see the malformed network field.
- Use an official release of the plugin rather than a custom fork.
Defensive patterns
Strategy: validation
Validate before calling
out, _ := exec.Command(pluginPath, "packer-plugin").Output()
parts := strings.Split(strings.TrimSpace(string(out)), "|")
if len(parts) >= 3 && parts[2] != "tcp" && parts[2] != "unix" { /* unsupported network type */ } Try / catch
if _, err := client.Start(); err != nil {
if strings.Contains(err.Error(), "Unknown address type") {
// rebuild plugin with official go-plugin/SDK
}
} Prevention
- Only use plugins built with the official hashicorp/go-plugin and packer-plugin-sdk.
- Avoid forked SDKs that change the handshake format.
- Verify handshake output manually when using custom-built plugins.
When it happens
Trigger: Client.Start() in packer/plugin_client.go reaches the network switch with a network value other than "tcp" or "unix" — i.e. the plugin advertised an unsupported or malformed network type in its handshake line.
Common situations: A plugin built with a forked/nonstandard SDK that negotiates a different network type; a corrupted or garbled handshake line causing a bogus network field; hand-rolled plugin wrappers that print their own handshake format.
Related errors
- The protocol of this plugin (protocol version 4 and lower) w
- Unrecognized remote plugin message: %s
- error retrieving iteration from HCP Packer registry: %s
- request Fulcio certificate: %w
- load keyless trusted root: %w
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/c80a95a6448dbf08.
Report an issue: GitHub.