{"record":{"id":"207fbaad3af67fdf","repo":"hashicorp/packer","slug":"wrong-system-expected-s-s","errorCode":null,"errorMessage":"wrong system, expected %s_%s","messagePattern":"wrong system, expected (.+?)_(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/github/getter.go","lineNumber":327,"sourceCode":"\n\tparts := strings.Split(res, \"_\")\n\t// [\"v0.2.12\", \"x5.0\", \"freebsd\", \"amd64\"]\n\tif len(parts) < 4 {\n\t\treturn fmt.Errorf(\"malformed filename expected %s{version}_x{protocol-version}_{os}_{arch}\", req.FilenamePrefix())\n\t}\n\n\tentry.BinVersion, entry.ProtVersion, entry.Os, entry.Arch = parts[0], parts[1], parts[2], parts[3]\n\n\treturn nil\n}\n\nfunc (g *Getter) Validate(opt plugingetter.GetOptions, expectedVersion string, installOpts plugingetter.BinaryInstallationOptions, entry *plugingetter.ChecksumFileEntry) error {\n\texpectedBinVersion := \"v\" + expectedVersion\n\tif entry.BinVersion != expectedBinVersion {\n\t\treturn fmt.Errorf(\"wrong version: %s does not match expected %s\", entry.BinVersion, expectedBinVersion)\n\t}\n\tif entry.Os != installOpts.OS || entry.Arch != installOpts.ARCH {\n\t\treturn fmt.Errorf(\"wrong system, expected %s_%s\", installOpts.OS, installOpts.ARCH)\n\t}\n\n\treturn installOpts.CheckProtocolVersion(entry.ProtVersion)\n}\n\nfunc (g *Getter) ExpectedFileName(pr *plugingetter.Requirement, version string, entry *plugingetter.ChecksumFileEntry, _ string) string {\n\tpluginSourceParts := strings.Split(pr.Identifier.Source, \"/\")\n\treturn strings.Join([]string{\n\t\t\"packer-plugin-\" + pluginSourceParts[2],\n\t\tentry.BinVersion,\n\t\tentry.ProtVersion,\n\t\tentry.Os,\n\t\tentry.Arch + entry.Ext,\n\t}, \"_\")\n}\n","sourceCodeStart":309,"sourceCodeEnd":343,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/github/getter.go#L309-L343","documentation":"Validate() also verifies the entry's OS and architecture match the machine Packer is running on (installOpts.OS/ARCH). If the checksum entry was parsed for a different os_arch combination, it is rejected because the binary would not run on this host.","triggerScenarios":"Getter.Validate() is given an entry where entry.Os != installOpts.OS or entry.Arch != installOpts.ARCH — e.g. iterating checksum entries and encountering a linux_amd64 asset while installing on darwin_arm64.","commonSituations":"Installing a plugin whose release lacks an asset for your OS/arch so only foreign-platform entries exist; a misparsed filename maps the wrong OS/arch fields (see the malformed-filename error); running Packer on an unusual platform (e.g. freebsd/arm64) not published upstream.","solutions":["Check that the plugin release publishes an asset for your OS/arch; if not, build the plugin yourself for that platform and install it into PACKER_PLUGIN_PATH.","Verify the asset filenames follow the _{os}_{arch} convention so parsing assigns the right fields.","Run Packer on a platform the plugin supports, or ask the plugin maintainer to add the missing platform."],"exampleFix":"// release lacks darwin_arm64 — build it yourself\nGOOS=darwin GOARCH=arm64 go build -o packer-plugin-foo_1.0.0_x5.0_darwin_arm64 .","handlingStrategy":"validation","validationCode":"if entry.Os != installOpts.OS || entry.Arch != installOpts.ARCH {\n\treturn fmt.Errorf(\"asset %s_%s not usable on %s_%s\", entry.Os, entry.Arch, installOpts.OS, installOpts.ARCH)\n}","typeGuard":"func entryMatchesPlatform(entry *plugingetter.ChecksumFileEntry, opts plugingetter.BinaryInstallationOptions) bool {\n\treturn entry != nil && entry.Os == opts.OS && entry.Arch == opts.ARCH\n}","tryCatchPattern":"if err := g.Validate(opt, ver, installOpts, entry); err != nil {\n\tif strings.HasPrefix(err.Error(), \"wrong system\") {\n\t\treturn fmt.Errorf(\"plugin has no %s_%s build; skipping\", installOpts.OS, installOpts.ARCH)\n\t}\n}","preventionTips":["Before pinning a plugin, confirm the release publishes an asset for your GOOS/GOARCH","Filter checksum entries by platform before validating","Publish cross-compiled assets for all major platforms"],"tags":["plugin-getter","platform-mismatch","os-arch","plugin-install"],"backgroundTag":"platform-mismatch","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"}