{"record":{"id":"5b90a8823b9a0be1","repo":"hashicorp/packer","slug":"malformed-filename-s-expected-s-version-x-prot","errorCode":null,"errorMessage":"malformed filename %s: expected %s{version}_x{protocol-version}_{os}_{arch} or %s{version}_{os}_{arch}","messagePattern":"malformed filename (.+?): expected (.+?)(.+?)_x(.+?)_(.+?)_(.+?) or (.+?)(.+?)_(.+?)_(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packer/plugin-getter/remote/getter.go","lineNumber":290,"sourceCode":"func (g *Getter) Init(req *plugingetter.Requirement, entry *plugingetter.ChecksumFileEntry) error {\n\tfilename := entry.Filename\n\tres := strings.TrimPrefix(filename, req.FilenamePrefix())\n\n\tentry.Ext = filepath.Ext(res)\n\tres = strings.TrimSuffix(res, entry.Ext)\n\n\tparts := strings.Split(res, \"_\")\n\tswitch {\n\tcase len(parts) >= 4 && protocolVersionRe.MatchString(parts[1]):\n\t\tif !strings.HasPrefix(parts[0], \"v\") {\n\t\t\treturn fmt.Errorf(\"malformed filename %s: version %q must have a v prefix alongside a protocol version\", filename, parts[0])\n\t\t}\n\t\tentry.BinVersion, entry.ProtVersion, entry.Os, entry.Arch = parts[0], parts[1], parts[2], parts[3]\n\tcase len(parts) == 3 && !strings.HasPrefix(parts[0], \"v\"):\n\t\tentry.BinVersion, entry.Os, entry.Arch = \"v\"+parts[0], parts[1], parts[2]\n\t\tentry.ProtVersion = \"\"\n\tdefault:\n\t\treturn fmt.Errorf(\n\t\t\t\"malformed filename %s: expected %s{version}_x{protocol-version}_{os}_{arch} or %s{version}_{os}_{arch}\",\n\t\t\tfilename, req.FilenamePrefix(), req.FilenamePrefix())\n\t}\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\tif entry.ProtVersion == \"\" {\n\t\t// The protocol version was resolved from the version's manifest.json","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/remote/getter.go#L272-L308","documentation":"Remote getter error from Init: the checksum-file entry's filename doesn't match either accepted shape — {prefix}{version}_x{protocol}_{os}_{arch} (GitHub style) or {prefix}{version}_{os}_{arch} (releases.hashicorp.com style) — so its metadata cannot be parsed.","triggerScenarios":"Thrown at packer/plugin-getter/remote/getter.go:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the release asset to follow the standard packer-plugin naming convention","Verify the checksum file references assets with the exact expected names"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}