{"record":{"id":"8e87525c6a9cf03a","repo":"hashicorp/packer","slug":"error-initializing-provisioner-s-s","errorCode":null,"errorMessage":"error initializing provisioner '%s': %s","messagePattern":"error initializing provisioner '(.+?)': (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/core.go","lineNumber":256,"sourceCode":"\tif !c.components.PluginConfig.Provisioners.Has(rawP.Type) {\n\t\terr := fmt.Errorf(\n\t\t\t\"The provisioner %s is unknown by Packer, and is likely part of a plugin that is not installed.\\n\"+\n\t\t\t\t\"You may find the needed plugin along with installation instructions documented on the Packer integrations page.\\n\\n\"+\n\t\t\t\t\"https://developer.hashicorp.com/packer/integrations?filter=%s\",\n\t\t\trawP.Type,\n\t\t\tstrings.Split(rawP.Type, \"-\")[0],\n\t\t)\n\n\t\tif sugg := didyoumean.NameSuggestion(rawP.Type, c.components.PluginConfig.Provisioners.List()); sugg != \"\" {\n\t\t\terr = fmt.Errorf(\"Did you mean to use %q?\", sugg)\n\t\t}\n\n\t\treturn cbp, err\n\t}\n\n\tprovisioner, err := c.components.PluginConfig.Provisioners.Start(rawP.Type)\n\tif err != nil {\n\t\treturn cbp, fmt.Errorf(\n\t\t\t\"error initializing provisioner '%s': %s\",\n\t\t\trawP.Type, err)\n\t}\n\t// Seems unlikely that a provisioner doesn't start successfully without error\n\tif provisioner == nil {\n\t\treturn cbp, fmt.Errorf(\n\t\t\t\"provisioner failed to be started and did not error: %s\", rawP.Type)\n\t}\n\n\treturn c.generateCoreBuildProvisionerWithProvisioner(rawP, rawName, provisioner)\n}\n\nfunc (c *Core) generateCoreBuildProvisionerWithProvisioner(rawP *template.Provisioner, rawName string, provisioner packersdk.Provisioner) (CoreBuildProvisioner, error) {\n\tcbp := CoreBuildProvisioner{}\n\n\t// Get the configuration\n\tconfig := make([]interface{}, 1, 2)\n\tconfig[0] = rawP.Config","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/core.go#L238-L274","documentation":"The provisioner plugin binary of the requested type was found and Packer attempted to launch it via PluginConfig.Provisioners.Start, but the plugin process failed to start or failed its handshake. Packer wraps the underlying plugin error with the provisioner type for context.","triggerScenarios":"Provisioners.Start(rawP.Type) returns a non-nil error — e.g. the plugin binary exists in the registry entry but is missing/corrupt on disk, has wrong permissions, crashes at startup, or its protocol version is incompatible with the core. Raised from generateCoreBuildProvisioner during Core.Build.","commonSituations":"Upgraded Packer core with an old external plugin built against an incompatible SDK; plugin binary deleted or corrupted in the plugin directory; partially failed `packer plugins install`; OS refusing to exec the binary; plugin panicking during handshake.","solutions":["Read the wrapped inner error and fix the root cause (reinstall the plugin: `packer plugins install github.com/hashicorp/<name>`).","Verify the plugin binary exists and is executable in the plugin directory.","Check Packer/plugin SDK version compatibility and upgrade the plugin if it was built against an old SDK.","Run the plugin binary manually to see if it crashes at startup."],"exampleFix":"# before\n$ packer build .\n# error initializing provisioner 'ansible': ...\n# after\n$ packer plugins install github.com/hashicorp/ansible\n$ packer build .","handlingStrategy":"try-catch","validationCode":"// Verify the plugin binary can execute before building:\n// packer plugins installed  &&  run `packer init` to repair missing installs","typeGuard":null,"tryCatchPattern":"if _, err := core.Build(name); err != nil {\n    if strings.Contains(err.Error(), \"error initializing provisioner\") {\n        // remediate: reinstall plugin, check binary, then retry once\n        exec.Command(\"packer\", \"plugins\", \"install\", pluginSource).Run()\n    }\n    return err\n}","preventionTips":["Always `packer init` in CI before building.","Pin plugin versions compatible with your Packer core version.","Avoid hand-editing or pruning the plugin cache directory.","Test plugin upgrades in a separate plugin path (PACKER_PLUGIN_PATH) first."],"tags":["provisioner","plugin","initialization","plugin-crash"],"backgroundTag":"plugin-start-failed","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}