hashicorp/packer · error
Error reading checksum file
Error message
Error reading checksum file: %s
What it means
When parsing GitHub's checksum/tag file line by line, a read error other than io.EOF aborts parsing with this error. It wraps the underlying reader failure, so the checksum file content could not be fully retrieved from the network.
Solutions
- Retry `packer init` — this is typically a transient network error.
- Check proxy settings (HTTP_PROXY/HTTPS_PROXY) and corporate TLS interception.
- Verify connectivity to github.com/objects.githubusercontent.com.
- If persistent, download the checksum file manually and use a local file source.
Defensive patterns
Strategy: retry
Validate before calling
resp, err := http.Get(checksumURL)
if err == nil && resp.StatusCode != http.StatusOK {
return fmt.Errorf("checksum endpoint returned %d", resp.StatusCode)
} Try / catch
for attempt := 0; attempt < 3; attempt++ {
err := installPlugins()
if err == nil || !isNetworkErr(err) { break }
time.Sleep(time.Duration(1<<attempt) * time.Second)
} Prevention
- Run plugin installs on stable networks or with retry wrappers in CI.
- Configure proxy/TLS settings correctly (HTTPS_PROXY, custom CAs).
- Watch for GitHub rate limits and add authentication or backoff.
When it happens
Trigger: Streaming the checksum file from a GitHub release URL and the HTTP body read fails with a non-EOF error: connection reset, TLS error, or proxy interruption — anything where rd.ReadString('\n') returns err != nil && err != io.EOF.
Common situations: Corporate proxy or firewall cutting the connection; GitHub rate-limiting or transient 5xx behind a streaming reader; flaky VPN/network during `packer init`.
Related errors
- empty response body for
- failed to download release checksums
- could not find a local nor a remote checksum for plugin
- failed reading response body for
- failed to build index request
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/24ae9d1171bdf94a.
Report an issue: GitHub.
Appendix: source
Thrown at packer/plugin-getter/github/getter.go:61
Versions map[string]PluginVersion `json:"versions"`
}
type PluginVersion struct {
Name string `json:"name"`
Version string `json:"version"`
}
func TransformChecksumStream() func(in io.ReadCloser) (io.ReadCloser, error) {
return func(in io.ReadCloser) (io.ReadCloser, error) {
defer in.Close()
rd := bufio.NewReader(in)
buffer := bytes.NewBufferString("[")
json := json.NewEncoder(buffer)
for i := 0; ; i++ {
line, err := rd.ReadString('\n')
if err != nil {
if err != io.EOF {
return nil, fmt.Errorf(
"Error reading checksum file: %s", err)
}
break
}
parts := strings.Fields(line)
switch len(parts) {
case 2: // nominal case
checksumString, checksumFilename := parts[0], parts[1]
if i > 0 {
_, _ = buffer.WriteString(",")
}
if err := json.Encode(struct {
Checksum string `json:"checksum"`
Filename string `json:"filename"`
}{
Checksum: checksumString,
Filename: checksumFilename,View on GitHub (pinned to eb36e3c3e4)