hashicorp/packer · error

Unknown provisioner %s

Error message

Unknown provisioner %s

What it means

MapOfProvisioner.Start looks up a provisioner by name in the plugin registry map and returns this error when the name is not registered. It signals that Packer cannot find a provisioner binary/builtin matching the requested name — typically the plugin was never Set() into the map or the name is misspelled in the template.

Source

Thrown at packer/maps.go:26

	packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
)

type MapOfProvisioner map[string]func() (packersdk.Provisioner, error)

func (mop MapOfProvisioner) Has(provisioner string) bool {
	_, res := mop[provisioner]
	return res
}

func (mop MapOfProvisioner) Set(provisioner string, starter func() (packersdk.Provisioner, error)) {
	mop[provisioner] = starter
}

func (mop MapOfProvisioner) Start(provisioner string) (packersdk.Provisioner, error) {
	p, found := mop[provisioner]
	if !found {
		return nil, fmt.Errorf("Unknown provisioner %s", provisioner)
	}
	return p()
}

func (mop MapOfProvisioner) List() []string {
	res := []string{}
	for k := range mop {
		res = append(res, k)
	}
	return res
}

type MapOfPostProcessor map[string]func() (packersdk.PostProcessor, error)

func (mopp MapOfPostProcessor) Has(postProcessor string) bool {
	_, res := mopp[postProcessor]
	return res
}

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Check the provisioner "type" in the template for spelling/casing against `packer plugins installed` or the List() output.
  2. Run `packer init .` to install missing third-party plugins declared in required_plugins.
  3. Verify the plugin binary exists in PACKER_PLUGIN_PATH with the correct naming scheme.
  4. If embedding plugins in Go, confirm Set() is called on the MapOfProvisioner before Start().

Example fix

// before
provisioner "filee" { ... }

// after
provisioner "file" { ... }
Defensive patterns

Strategy: validation

Validate before calling

if !provisioners.Has(name) {
    return fmt.Errorf("provisioner %q is not installed; run `packer init` (known: %v)", name, provisioners.List())
}
p, err := provisioners.Start(name)

Try / catch

if err != nil {
    if strings.HasPrefix(err.Error(), "Unknown provisioner") { /* fall back to `packer init` */ }
}

Prevention

When it happens

Trigger: Calling Start(name) with a name absent from the map: a template provisioner block whose type is misspelled (e.g. "provisioners" instead of "provisioner"), a third-party plugin not installed in the plugin directory, or a plugin name with wrong casing (map lookups are case-sensitive).

Common situations: Typo in the provisioner "type" field in an HCL2/JSON template; using a custom plugin without running `packer init`; Packer version mismatch where the provisioner was removed or renamed; plugin binary not named per the expected packer-plugin-* convention.

Related errors


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/2ff37b1e4b102a7f. Report an issue: GitHub.