Hi.
We are constantly seeing two different errors on CI and I really would like to understand and fix them.
First one is this:
Selected mirror https://hackage.haskell.org/
Downloading root
Waiting to acquire cache lock on /Users/runner/.stack/pantry/hackage/hackage-security-lock
Acquired cache lock on /Users/runner/.stack/pantry/hackage/hackage-security-lock
Released cache lock on /Users/runner/.stack/pantry/hackage/hackage-security-lock
Selected mirror https://hackage.haskell.org/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Verification error: Invalid hash for <repo>/01-index.tar.gz
...
Invalid hash for <repo>/01-index.tar.gz
Invalid hash for <repo>/01-index.tar.gz
Invalid hash for <repo>/01-index.tar.gz
Invalid hash for <repo>/01-index.tar.gz
Invalid hash for <repo>/01-index.tar.gz
(reported at Cache causing invalid hash for 01-index Ā· Issue #1366 Ā· haskell/hackage-server Ā· GitHub)
Usually the error is indeed reported for the 01-index.tar.gz
file, but sometimes we also see an error about snapshot.json
.
The second one is an error from Stack, but seems to be also related to hackage infra:
2025-08-19 06:14:00.219502: [debug] Downloading archive from https://hackage.haskell.org/package/proto-lens-runtime-0.7.0.4.tar.gz
HttpExceptionRequest Request {
host = "hackage.haskell.org"
port = 443
secure = True
requestHeaders = [("User-Agent","Haskell pantry package")]
path = "/package/proto-lens-runtime-0.7.0.4.tar.gz"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
proxySecureMode = ProxySecureWithConnect
}
InvalidChunkHeaders
(reported at stack unpack: error S-5170 -- InvalidChunkHeaders Ā· Issue #145 Ā· commercialhaskell/pantry Ā· GitHub)
Both problems are transient, usually retrying the failed jobs makes the workflow succeed (we are using GitHub Actions).
Maybe these problems are related, probably both have something to do with the CDN?
A few questions:
What is the difference between 00-index.tar.gz
and 01-index.tar.gz
and when is one used instead of the other? How does the verification work? And what could be a reason for a failure?
Are others also seeing this on a regular basis?
I was able to reproduce it with the following steps, run in a loop:
rm -rf ~/.stack/pantry/
stack āresolver ../snapshot.yaml unpack HUnit-1.6.2.0 QuickCheck-2.14.3 ā¦
rm -rf *
From 100 runs, I got 4 times error S-5170
which was caused 3 times by an VerificationErrorLoop
resulting from a Invalid hash
error for 01-index.tar.gz
and once an InvalidChunkHeaders
error.
For a single run, there also were a few VerificationError
ās for 01-index.tar.gz
reported, but apparently on the 4th try it could successfully verify the file and the run was eventually successful.
Thanks!