{"record":{"id":"a8909896b020d95c","repo":"hashicorp/packer","slug":"the-protocol-of-this-plugin-protocol-version-4-an","errorCode":null,"errorMessage":"The protocol of this plugin (protocol version 4 and lower) was deprecated, please use a newer version of this plugin.Or use an older version of Packer (pre 1.7) with this plugin.","messagePattern":"The protocol of this plugin \\(protocol version 4 and lower\\) was deprecated, please use a newer version of this plugin\\.Or use an older version of Packer \\(pre 1\\.7\\) with this plugin\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin_client.go","lineNumber":331,"sourceCode":"\t// Some channels for the next step\n\ttimeout := time.After(c.config.StartTimeout)\n\n\t// Start looking for the address\n\tlog.Printf(\"Waiting for RPC address for: %s\", cmd.Path)\n\tselect {\n\tcase <-timeout:\n\t\terr = errors.New(\"timeout while waiting for plugin to start\")\n\tcase <-exitCh:\n\t\terr = errors.New(\"plugin exited before we could connect\")\n\tcase lineBytes := <-linesCh:\n\t\t// Trim the line and split by \"|\" in order to get the parts of\n\t\t// the output.\n\t\tline := strings.TrimSpace(string(lineBytes))\n\t\tparts := strings.SplitN(line, \"|\", 4)\n\t\tif len(parts) == 3 {\n\t\t\t// In protocol version 4 and before, the protocol only had a Major\n\t\t\t// version\n\t\t\terr = fmt.Errorf(\"The protocol of this plugin (protocol version 4 \" +\n\t\t\t\t\"and lower) was deprecated, please use a newer version of this plugin.\" +\n\t\t\t\t\"Or use an older version of Packer (pre 1.7) with this plugin.\")\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(parts) < 4 {\n\t\t\terr = fmt.Errorf(\"Unrecognized remote plugin message: %s\", line)\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginMajorAPIVersion, pluginMinorAPIVersion, network, netAddr := parts[0], parts[1], parts[2], parts[3]\n\n\t\t// Test the API versions\n\t\tif pluginMajorAPIVersion != pluginsdk.APIVersionMajor {\n\t\t\terr = fmt.Errorf(\"Incompatible API MAJOR version with plugin. \"+\n\t\t\t\t\"plugin MINOR API version: %s, Ours: %s\", pluginMajorAPIVersion, pluginsdk.APIVersionMajor)\n\t\t\treturn nil, err\n\t\t}\n\t\tif pluginMinorAPIVersion > pluginsdk.APIVersionMinor {\n\t\t\terr = fmt.Errorf(\"Incompatible API MINOR version with plugin. \"+","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin_client.go#L313-L349","documentation":"When the plugin client starts a plugin binary, the plugin prints a pipe-delimited handshake line. If the line has only 3 fields, the plugin speaks protocol version 4 or lower, which Packer 1.7+ no longer supports, so Start refuses to connect and returns this deprecation error.","triggerScenarios":"Client.Start() on packer/plugin_client.go reads the plugin's handshake line from stdout; strings.SplitN(line, \"|\", 4) yields exactly 3 parts, i.e. the binary implements the old pre-1.7 protocol.","commonSituations":"Running a very old community plugin (built before ~2021) with modern Packer; a vendored/internal plugin never upgraded to the go-plugin protocol v5 / SDK API version format; manually built old plugin code with an old packer-plugin-sdk.","solutions":["Upgrade the plugin to a version built against a current packer-plugin-sdk (protocol 5+).","If the plugin cannot be upgraded, run Packer pre-1.7 with it.","Replace the plugin with an equivalent maintained one."],"exampleFix":"// before\n$ packer build old-template.json  # uses my-legacy-plugin v0.1.0\n// error: protocol version 4 and lower was deprecated...\n// after\n$ packer plugins install github.com/example/my-legacy-plugin  # fetch latest protocol-compatible release","handlingStrategy":"validation","validationCode":"out, err := exec.Command(pluginPath, \"packer-plugin\").Output()\nif err != nil || len(strings.Split(strings.TrimSpace(string(out)), \"|\")) < 4 {\n  // plugin speaks pre-1.7 protocol; upgrade plugin or use Packer <1.7\n}","typeGuard":null,"tryCatchPattern":"if _, err := client.Start(); err != nil {\n  if strings.Contains(err.Error(), \"deprecated\") {\n    // upgrade plugin or pin older Packer\n  }\n}","preventionTips":["Keep all plugins on releases built with the current packer-plugin-sdk.","Audit legacy community plugins for protocol 4 support before upgrading Packer.","Prefer official plugin releases; avoid unmaintained binaries."],"tags":["plugin-protocol","version-compatibility","handshake"],"backgroundTag":"plugin-protocol-incompatible","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"}