---
title: "“curl: (56) Failure when receiving data” on Mac · Kilobat Guides"
url: "https://kilobat.app/guides/curl-56-failure-receiving-data"
description: "curl on your Mac stops with (56) Failure when receiving data. The connection broke during the transfer. Check the proxy, the VPN and the server."
---

# “curl: (56) Failure when receiving data” on Mac

curl exit code 56 reports a failed step. The curl documentation says: “Failure with receiving network data.”

**Fix this with your agent**Copies a prompt for Claude Code, Codex or any agent that can use Terminal.

My Mac has this problem: “curl: (56) Failure when receiving data” on Mac. Read https://kilobat.app/guides/curl-56-failure-receiving-data.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.

Applies to: The curl that comes with macOS and the Homebrew curl, on all current macOS versions. · Checked: 29 October 2026

## Symptoms

- Terminal shows `curl: (56) Failure when receiving data from the peer` or a similar line.
- A download starts, then stops.
- The text can add “Connection reset by peer”.

## Likely causes

- **A reset connection.** A server, proxy or firewall closed the connection while data flowed.
- **A VPN or network change.** A VPN reconnect or a Wi-Fi change drops the transfer.
- **A proxy that blocks the content.** A filter can cut a response it does not allow.
- **A server fault.** The server can fail during a long response.

## How to check

1. Run curl with details. Note when the failure starts.

   ```
   curl -v https://example.com
   ```
2. Retry on another network, such as a phone hotspot.
3. Show the proxy variables.

   ```
   env | grep -i proxy
   ```
4. Check the Wi-Fi link while the transfer runs.

   ```
   kilobat wifi
   ```

## How to fix it

1. Retry the transfer. Add retries to scripts.

   ```
   curl --retry 3 -O https://example.com/file.zip
   ```
2. Turn off the VPN, proxy or security app for a short test. Turn it on again after.
3. Resume a download with `-C -`.

   ```
   curl -C - -O https://example.com/file.zip
   ```
4. If it fails on one network only, ask its administrator about filtering.

## With Kilobat

1. Kilobat's connection doctor tests the address layer by layer: network, proxy, DNS, rules, IPv4, IPv6, TLS and the server. It names the layer that failed.

   ```
   kilobat why https://example.com
   ```
2. These Kilobat checks are free. AI agents run them through MCP with `diagnose_connection` and `diagnose_network`. See [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect).

## Questions

**Is (56) the same as ECONNRESET?**

A reset connection is one possible cause. See [“npm error code ECONNRESET” on Mac](https://kilobat.app/guides/npm-econnreset).

**Does it prove the server is faulty?**

No. A device on the path can also close the connection.

## Sources

- [curl: libcurl error codes](https://curl.se/libcurl/c/libcurl-errors.html)

Checked on 29 October 2026.

## Related guides

- [“curl: (7) Failed to connect” on Mac](https://kilobat.app/guides/curl-7-failed-to-connect): curl exit code 7 reports a failed step.
- [“npm error code ECONNRESET” on Mac](https://kilobat.app/guides/npm-econnreset): ECONNRESET reports a forcibly reset connection.
- [ERR_CONNECTION_RESET in Chrome on Mac](https://kilobat.app/guides/err-connection-reset): ERR_CONNECTION_RESET is a Chrome network error.
- [Homebrew fails with “curl: (28)” on Mac](https://kilobat.app/guides/homebrew-curl-28-timed-out): Homebrew downloads with curl.
