hashicorp/packer · error

Did you mean to use %q?

Error message

Did you mean to use %q?

What it means

Packer could not find the provisioner named in the template among the installed/known provisioner plugins, so it searched the list of known provisioner names with the didyoumean fuzzy matcher and found a close candidate. Instead of the generic 'unknown provisioner' error, it replaces it with this suggestion so the developer can fix the type name typo.

Source

Thrown at packer/core.go:248

	return r
}

func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName string) (CoreBuildProvisioner, error) {
	// Get the provisioner
	cbp := CoreBuildProvisioner{}

	if !c.components.PluginConfig.Provisioners.Has(rawP.Type) {
		err := fmt.Errorf(
			"The provisioner %s is unknown by Packer, and is likely part of a plugin that is not installed.\n"+
				"You may find the needed plugin along with installation instructions documented on the Packer integrations page.\n\n"+
				"https://developer.hashicorp.com/packer/integrations?filter=%s",
			rawP.Type,
			strings.Split(rawP.Type, "-")[0],
		)

		if sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.Provisioners.List()); sugg != "" {
			err = fmt.Errorf("Did you mean to use %q?", sugg)
		}

		return cbp, err
	}

	provisioner, err := c.components.PluginConfig.Provisioners.Start(rawP.Type)
	if err != nil {
		return cbp, fmt.Errorf(
			"error initializing provisioner '%s': %s",
			rawP.Type, err)
	}
	// Seems unlikely that a provisioner doesn't start successfully without error
	if provisioner == nil {
		return cbp, fmt.Errorf(
			"provisioner failed to be started and did not error: %s", rawP.Type)
	}

	return c.generateCoreBuildProvisionerWithProvisioner(rawP, rawName, provisioner)

View on GitHub (pinned to eb36e3c3e4)

Solutions

  1. Fix the provisioner `type` in the template to the suggested name (e.g. 'shel' -> 'shell').
  2. If the suggestion is wrong, install the missing plugin with `packer plugins install <plugin>`.
  3. Run `packer plugins installed` / check PACKER_PLUGIN_PATH to confirm the plugin binary is discoverable.
  4. Run `packer validate` on the template before building to catch unknown provisioner types early.

Example fix

// before
"provisioners": [{ "type": "shel", "script": "setup.sh" }]
// after
"provisioners": [{ "type": "shell", "script": "setup.sh" }]
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check installed provisioners before building (Go, using packer Core/plugin config)
if !core.Components.PluginConfig.Provisioners.Has(pType) {
    known := core.Components.PluginConfig.Provisioners.List()
    return fmt.Errorf("provisioner %q not installed; known: %v", pType, known)
}

Prevention

When it happens

Trigger: A template declares a provisioner whose `type` is not registered in PluginConfig.Provisioners (typo like 'shel' or missing plugin), AND NameSuggestion(rawP.Type, provisioners.List()) returns a non-empty fuzzy match, e.g. 'shel' vs 'shell'. Raised from generateCoreBuildProvisioner during Core.Build.

Common situations: Misspelling a built-in provisioner type ('shel', 'files' for 'file'), using a plugin whose binary is not installed or not on PACKER_PLUGIN_PATH, referencing a provisioner from a plugin version that was never installed.

Related errors


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