EOF and unexpected EOF are different failures
| Message | What happened | Where to look |
|---|---|---|
EOF | Nothing arrived at all | The connection, the URL, the host's availability |
unexpected EOF | Bytes arrived, then the stream ended early | Content encoding, truncation, an intermediary |
With a plain EOF the client got an empty stream, which usually means the host closed immediately or the request never produced a body. With unexpected EOF the client was mid-read: the decompressor, the JSON decoder, or the line reader hit the end of input before the structure was complete.
So this error is evidence that the host answered. That narrows the search considerably, and it rules out DNS, TLS, and reachability.
Compression is the most common cause
Subscriptions are usually served with a content encoding, most often gzip, because a node list compresses well. The client advertises support, the host compresses, and the client decompresses as it reads.
If the compressed stream is truncated, the decompressor reaches the end of the input while still expecting more. The result is an unexpected EOF at the decode step, not at the socket. Two things produce this:
- The host sends a length that does not match the body. A content length header computed before compression, or a chunked response that ends early.
- An intermediary truncates. A proxy, a CDN edge, or a filtering appliance that has a size limit and cuts the body without closing cleanly.
The test is to fetch the same URL without compression and compare length and validity:
curl -sS --compressed -o /tmp/a.txt -w '%{size_download} %{http_code}\n' "$URL"
curl -sS -H 'Accept-Encoding: identity' -o /tmp/b.txt -w '%{size_download} %{http_code}\n' "$URL"
If the identity version is complete and the compressed one is short, compression is the cause. If the identity one is also short, the body itself is truncated at the source.
The other three causes
The response is genuinely empty or halfway
Some panels emit a profile header first and stream the node list after, and a failure mid-generation leaves a partial document. The signature is a body that starts correctly and ends mid-line. Compare with a known-good subscription from another host: if that one is complete, the truncation is at the provider.
An intermediary is cutting the connection
A captive portal, an enterprise filter, or an antivirus proxy can allow the headers and then block the body. The tell is that the failure is reproducible on one network and absent on another, and that small subscriptions succeed while large ones fail — the size threshold is the fingerprint of a body-length limit.
The client's own timeout fires mid-read
A slow host that dribbles bytes can exceed a read deadline after the first chunk arrived. The error looks like truncation but the body is intact on the server. Distinguish by fetching with curl and timing the transfer: a total time near the client's timeout with a complete body means the client gave up rather than the host failing.
Why retrying sometimes works and that is not a fix
Truncation is often probabilistic: a size limit near the subscription's length, or a load balancer with inconsistent behaviour, fails some fraction of the time. A retry succeeding is consistent with every cause above and therefore proves nothing.
What to do instead is compare sizes across several attempts. Two fetches of the same URL producing different byte counts, with neither matching the length the server declares, is conclusive evidence of truncation on the path. That is a finding; a successful retry is not.
What not to change
- The node list. Nothing about nodes can cause a fetch to end early. Editing them is time spent on the wrong layer.
- Certificate settings. TLS already succeeded — the failure is inside the response body. Disabling verification changes nothing here.
- The profile format. The client did not reach the parse step with a complete document, so format problems cannot be the cause of this error.
The useful record is: the URL, the declared length, the actual length with and without compression, whether the failure is consistent, and whether another network behaves differently. Those five facts separate a provider fault from a path fault from a client timeout.
Frequently asked
Does unexpected EOF mean the subscription is broken?
Not necessarily. It means the transfer ended early. The source may be producing a complete document that is being truncated on the path, which a different network would fetch successfully.
Why do large subscriptions fail while small ones work?
That pattern points at a body-length limit somewhere on the path — a filter, a proxy, or a CDN rule. It is the clearest fingerprint of truncation rather than of a provider error.
Is a retry a valid workaround?
It can succeed by chance and tells you nothing. Compare byte counts across attempts instead; if they differ, you have truncation on the path, which is a diagnosis rather than a workaround.
Can I disable compression in the client?
Some clients let you set request headers. Sending Accept-Encoding: identity avoids the decompression layer and will make the failure mode clearer, but it does not fix a body that is truncated at the source.
Could this be my antivirus scanning downloads?
Yes. Products that buffer and scan responses can cut long ones. The test is another machine on the same network without the product, or the same machine on another network.