hashicorp/packer · warning
failed to write local binary checksum file: %s
Error message
failed to write local binary checksum file: %s
What it means
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.
Source
Thrown at packer/plugin-getter/plugins.go:932
err = fmt.Errorf("could not create final plugin binary file: %w", err)
errs = multierror.Append(errs, err)
return nil, errs
}
if _, err := outputFile.Write(outputFileData.Bytes()); err != nil {
err = fmt.Errorf("could not write final plugin binary file: %w", err)
errs = multierror.Append(errs, err)
return nil, errs
}
outputFile.Close()
cs, err = checksum.Checksummer.Sum(&outputFileData)
if err != nil {
err := fmt.Errorf("failed to checksum binary file: %s", err)
errs = multierror.Append(errs, err)
log.Printf("[WARNING] %v, ignoring", err)
}
if err := os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), []byte(hex.EncodeToString(cs)), 0644); err != nil {
err := fmt.Errorf("failed to write local binary checksum file: %s", err)
errs = multierror.Append(errs, err)
log.Printf("[WARNING] %v, ignoring", err)
os.Remove(outputFileName)
continue
}
// Success !!
return &Installation{
BinaryPath: strings.ReplaceAll(outputFileName, "\\", "/"),
Version: "v" + version.String(),
}, nil
}
}
}
}
if len(versions) == 0 {View on GitHub (pinned to eb36e3c3e4)
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
Example fix
// before -rw-r--r-- 1 root root plugin_v1.0.0 # installed by sudo, sidecar write as user fails // after sudo chown -R $USER ~/.packer.d && packer init .
Defensive patterns
Strategy: validation
Validate before calling
import "os"
// verify plugins dir is writable before init
test := filepath.Join(pluginDir, ".write-test")
if err := os.WriteFile(test, []byte("x"), 0o644); err != nil {
return fmt.Errorf("cannot write to %s: %w", pluginDir, err)
}
os.Remove(test) Prevention
- 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
When it happens
Trigger: os.WriteFile(outputFileName+checksum.Checksummer.FileExt(), ...) fails during InstallLatest — no write permission in the plugin dir, disk full, or path collision.
Common situations: 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.
Related errors
- Checksum: failed to open file for checksum: %s
- could not write final plugin binary file: %w
- failed to checksum binary file: %s
- could not find a local nor a remote checksum for plugin %q %
- binary reported version (%q) is different from the expected
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/bdc33452db8e85a0.
Report an issue: GitHub.