{"record":{"id":"bdc33452db8e85a0","repo":"hashicorp/packer","slug":"failed-to-write-local-binary-checksum-file-s","errorCode":null,"errorMessage":"failed to write local binary checksum file: %s","messagePattern":"failed to write local binary checksum file: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packer/plugin-getter/plugins.go","lineNumber":932,"sourceCode":"\t\t\t\t\t\terr = fmt.Errorf(\"could not create final plugin binary file: %w\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\treturn nil, errs\n\t\t\t\t\t}\n\t\t\t\t\tif _, err := outputFile.Write(outputFileData.Bytes()); err != nil {\n\t\t\t\t\t\terr = fmt.Errorf(\"could not write final plugin binary file: %w\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\treturn nil, errs\n\t\t\t\t\t}\n\t\t\t\t\toutputFile.Close()\n\n\t\t\t\t\tcs, err = checksum.Checksummer.Sum(&outputFileData)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\terr := fmt.Errorf(\"failed to checksum binary file: %s\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\tlog.Printf(\"[WARNING] %v, ignoring\", err)\n\t\t\t\t\t}\n\t\t\t\t\tif err := os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0644); err != nil {\n\t\t\t\t\t\terr := fmt.Errorf(\"failed to write local binary checksum file: %s\", err)\n\t\t\t\t\t\terrs = multierror.Append(errs, err)\n\t\t\t\t\t\tlog.Printf(\"[WARNING] %v, ignoring\", err)\n\t\t\t\t\t\tos.Remove(outputFileName)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// Success !!\n\t\t\t\t\treturn &Installation{\n\t\t\t\t\t\tBinaryPath: strings.ReplaceAll(outputFileName, \"\\\\\", \"/\"),\n\t\t\t\t\t\tVersion:    \"v\" + version.String(),\n\t\t\t\t\t}, nil\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(versions) == 0 {","sourceCodeStart":914,"sourceCodeEnd":950,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/packer/plugin-getter/plugins.go#L914-L950","documentation":"InstallLatest failed to write the sidecar checksum file (<binary>.SHA256SUM) next to the freshly installed plugin binary. It logs a warning, then removes the just-installed binary and skips to the next version — the plugin is effectively not installed by this attempt.","triggerScenarios":"os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), ...) fails during InstallLatest — no write permission in the plugin dir, disk full, or path collision.","commonSituations":"Full disk after writing a large plugin binary; plugin directory owned by another user; read-only filesystem mount; concurrent packer processes racing in the same plugin directory.","solutions":["Free disk space on the plugins partition and re-run `packer init`","Fix ownership/permissions on ~/.packer.d/plugins (e.g. sudo chown -R $USER ~/.packer.d)","Remove leftover partial files from the plugin directory and retry cleanly","Avoid running multiple packer init processes concurrently against the same plugin path","Set PACKER_PLUGIN_PATH to a writable directory if the default is restricted"],"exampleFix":"// before\n-rw-r--r-- 1 root root plugin_v1.0.0  # installed by sudo, sidecar write as user fails\n// after\nsudo chown -R $USER ~/.packer.d && packer init .","handlingStrategy":"validation","validationCode":"import \"os\"\n// verify plugins dir is writable before init\ntest := filepath.Join(pluginDir, \".write-test\")\nif err := os.WriteFile(test, []byte(\"x\"), 0o644); err != nil {\n    return fmt.Errorf(\"cannot write to %s: %w\", pluginDir, err)\n}\nos.Remove(test)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure ample free disk space — checksum file is written after the (large) binary","Don't run packer with sudo; chown -R $USER ~/.packer.d if ownership drifted","Avoid concurrent `packer init` runs sharing one plugin directory","Re-run packer init after this warning — it removes the binary and retries the next version"],"tags":["plugin-install","checksum","filesystem","packer"],"backgroundTag":"disk-write-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"}