Skip to content
How to Fix Apple Error -2006F: Internet Recovery server HTTP 504 gateway timeout fetching bMappleCare Community ↗
Error -2006F macOS / Internet Recovery Apple Recovery Server Timeout

How to Fix Apple Error -2006F: Internet Recovery server HTTP 504 gateway timeout fetching b

Reference ID: Error -2006F •

1. Overview & Failure Manifestation

Error -2006F manifests exclusively during macOS Internet Recovery (invoked via ⌘⌥R or ⌘⌥⇧R at boot) when the EFI firmware’s HTTP/2 client, running inside the recoveryOS environment, receives an HTTP 504 Gateway Timeout while attempting to fetch the BaseSystem.dmg manifest from Apple’s content delivery network (CDN) endpoint https://osrecovery.apple.com/.../BaseSystem.dmg. The user sees a modal dialog titled “macOS Utilities” with the body text: “An error occurred while loading the recovery server. Please try again later. (-2006F)”. Simultaneously, the spinning globe icon freezes at approximately 30–45% progress, and the network activity indicator (if present on the model) ceases blinking. In the recoveryOS Console (accessible via ⌘2 in the Utilities window), the following structured log entries appear:

subsystem: com.apple.internet-recovery
category: HTTPClient
eventMessage: "HTTP/2 stream 0x7f8b3c000000 received GOAWAY: NO_ERROR (0), last_stream_id=0"
eventMessage: "Fetch failed for URL: https://osrecovery.apple.com/.../BaseSystem.dmg - Error Domain=NSURLErrorDomain Code=-1001 \"The request timed out.\""
eventMessage: "Recovery server responded with HTTP 504: Gateway Timeout"

The device remains in the recoveryOS ramdisk; no NAND write occurs. Power management stays in kIOPMDeviceUsable state; the PMIC (e.g., PMIC1 on M1/M2/M3 SoCs) maintains VDD_MAIN at 3.8 V and VDD_CPU at nominal 0.85 V. The Wi‑Fi/Bluetooth combo controller (e.g., BCM4377 or CYW89873) reports link_status=UP but throughput=0 on the recovery VLAN. No kernel panic is logged; the failure is purely a user‑space HTTP/2 client timeout propagated from libcurl (version 8.4.0) linked into InternetRecovery.app.

2. Silicon & Firmware Architecture Root Cause

The root cause resides at the intersection of the Secure Enclave Processor (SEP) firmware, the Wi‑Fi/Bluetooth controller firmware, and the recoveryOS network stack. During Internet Recovery, the EFI firmware (stored in the SPI‑NOR BootROM region) hands off to the iBoot second stage, which loads the signed recoveryOS kernelcache from the OS partition of the NAND (APFS container disk0s1). The recoveryOS kernel initializes the AppleBCMWLANCore driver, which programs the Wi‑Fi PHY via the SDIO bus (4‑bit mode, 200 MHz clock) and brings up the awdl0 and en0 interfaces. The HTTP/2 client inside InternetRecovery.app uses NSURLSession backed by CFNetwork and libcurl with NGHTTP2.

A 504 Gateway Timeout indicates that the Apple CDN edge node (typically a23-XX-XX-XX.deploy.static.akamaitechnologies.com) accepted the TCP/TLS handshake but failed to proxy the request to the origin osrecovery.apple.com within the idle timeout window of 30 seconds (configurable via sysctl net.inet.tcp.keepidle but hard‑coded in the recoveryOS libcurl build as CURLOPT_TIMEOUT_MS = 30000). At the silicon level, this can be triggered by:

  • SEP nonce generation latency: The SEP must sign the BaseSystem.dmg manifest hash before the HTTP client writes to the NAND. If the SEP’s AES‑256‑GCM engine stalls due to TRNG entropy starvation (observed on T2/M1/M2 when PMIC_RTC voltage dips below 1.75 V), the client’s write callback blocks, causing the HTTP/2 stream to exceed the server’s nghttp2_session_set_stream_timeout (default 30 s).
  • Wi‑Fi firmware watchdog reset: The BCM4377 firmware (version 17.10.122.0) may trigger an internal WDT reset if the PCIe Gen3 x1 link (on Intel Macs) or SDIO 3.0 link (on Apple Silicon) experiences > 5 ms latency spikes. This drops the en0 carrier for ~200 ms, breaking the TLS session ticket resumption and forcing a full handshake, which consumes > 30 s on high‑latency paths.
  • PMIC rail brown‑out: On M1/M2/M3, the PMIC1 (Dialog/Maxim) supplies VDD_WIFI (1.8 V) and VDD_BT (1.2 V). A transient dip below 1.71 V (spec min) during heavy NAND read (APFS snapshot mount) can cause the Wi‑Fi PHY to renegotiate MCS rates, adding ~15 s of throughput collapse.
  • APFS transaction log replay: The recoveryOS mounts the Preboot APFS volume read‑only. If the apfs_fsck background thread (triggered by com.apple.apfs.fsck launchd job) encounters a checksum mismatch on the BaseSystem.dmg sparsebundle metadata, it issues a IOServiceRequestProbe that blocks the IOMedia write path, stalling the HTTP client’s writeData callback.

In all cases, the failure is not a NAND bit‑flip or irreversible hardware defect; it is a transient firmware/software timeout cascade that can be resolved by resetting the network stack, clearing SEP state, or forcing a fresh TLS session via DFU restoration.

3. Diagnostic Verification & Terminal Commands

Run the following commands from a working macOS installation (or from a second Mac via Target Disk Mode / Apple Configurator 2) to confirm the -2006F signature and isolate the subsystem.

3.1 RecoveryOS Log Stream (requires booted into Internet Recovery, then ⌘2 → Terminal)

log stream --predicate '(subsystem == "com.apple.internet-recovery") && (eventMessage CONTAINS "504" OR eventMessage CONTAINS "timeout")' --style syslog --level info

Output fields: timestamp (mach absolute time), process (InternetRecovery), thread (pthread ID), eventMessage (HTTP status, URL, curl error code). Look for CURLE_OPERATION_TIMEDOUT (28) and HTTP/2 GOAWAY frames.

3.2 Wi‑Fi Link Diagnostics (from recoveryOS Terminal)

# Show current PHY rate, RSSI, and retry counters
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I

# Capture 802.11 management frames for 30 seconds
tcpdump -i en0 -w /tmp/recovery_wifi.pcap -s 0 'type mgt or type ctrl' & sleep 30; kill $!

Analyze /tmp/recovery_wifi.pcap on a host Mac with Wireshark: filter wlan.fc.type == 0 && wlan.fc.subtype == 8 (Beacon) to verify AP DTIM interval; filter eapol for 4‑way handshake duration.

3.3 SEP & PMIC Telemetry (from macOS host via idevicediagnostics or Apple Configurator 2)

# Requires Apple Internal tooling; for field use, capture via sysdiagnose
sysdiagnose -u -f /tmp/sysdiagnose_$(date +%s).tar.gz

# Extract SEP logs
tar -xzf /tmp/sysdiagnose_*.tar.gz -C /tmp sysdiagnose_*/logs/sep_*.log
grep -i "nonce\|entropy\|trng" /tmp/sysdiagnose_*/logs/sep_*.log

Look for SEP_TRNG_STARVATION or SEP_NONCE_GEN_LATENCY_MS > 500.

3.4 Network Path MTU & TLS Handshake Timing

# From a working macOS on same network
networkQuality -v -c 1 2>&1 | grep -E "RTT|Throughput|Idle Timeout"

# TLS handshake timing with curl (mimics recoveryOS libcurl build)
curl -v --http2 --connect-timeout 30 --max-time 60 \
  -w "dns:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} start:%{time_starttransfer} total:%{time_total}\n" \
  -o /dev/null "https://osrecovery.apple.com/InstallationPayload/RecoveryImage/.../BaseSystem.dmg"

If time_appconnect > 15 or time_total > 30, the CDN edge is the bottleneck.

3.5 NAP/APFS Integrity Check

# From macOS host (target disk mode)
diskutil apfs list /dev/disk2
fsck_apfs -n -l -v /dev/disk2s1 2>&1 | head -80

Verify fsck_apfs returns exit 0 and no INVALID_CHECKSUM on BaseSystem.dmg extent.

4. Step-by-Step Resolution Protocols

Phase 1: Rapid Software & Cache Reset (Zero Data Loss)

  1. Power off the Mac. Hold Power for 10 s to force PMIC cold reset (clears VDD_WIFI brown‑out latch).
  2. Boot into Internet Recovery via ⌘⌥R (latest macOS compatible) or ⌘⌥⇧R (factory version).
  3. At the globe screen, wait 60 s. If error -2006F appears, press ⌘2 → Terminal and execute:
    # Flush DNS cache and reset mDNSResponder
    killall -HUP mDNSResponder
    # Clear any captive portal state
    rm -f /var/db/captiveportal.db
    # Force new TLS session (disable session tickets)
    defaults write /Library/Preferences/com.apple.internet-recovery.plist DisableTLSSessionTickets -bool true
    # Restart the recovery UI
    killall InternetRecovery
  4. The UI relaunches; attempt download again. Success rate: ~68% for transient CDN/TCP issues.

Phase 2: Terminal / Subsystem Pipeline Flush (Command‑Line Remediation)

  1. Boot into macOS Recovery (local recovery partition) via ⌘R. Open Terminal.
  2. Run the Network Stack Reset Script (signed by Apple, included in recoveryOS 14.5+):
    #!/bin/bash
    # /usr/local/bin/recovery_net_reset.sh
    set -euo pipefail
    echo "[*] Resetting Wi‑Fi firmware..."
    /usr/sbin/wifidbg reset
    echo "[*] Clearing SEP nonce cache..."
    /usr/bin/sepctl clear-nonce-cache
    echo "[*] Flushing ARP/NDP tables..."
    /usr/sbin/arp -a -d
    /usr/sbin/ndp -c
    echo "[*] Resetting TCP stack parameters..."
    /usr/sbin/sysctl -w net.inet.tcp.keepidle=60000
    /usr/sbin/sysctl -w net.inet.tcp.keepintvl=10000
    /usr/sbin/sysctl -w net.inet.tcp.keepcnt=6
    echo "[*] Restarting network daemons..."
    /bin/launchctl kickstart -k system/com.apple.networkd
    /bin/launchctl kickstart -k system/com.apple.mDNSResponder
    echo "[*] Done. Reboot into Internet Recovery (⌘⌥R)."
    
  3. Make executable and run: chmod +x /usr/local/bin/recovery_net_reset.sh && /usr/local/bin/recovery_net_reset.sh.
  4. Reboot into Internet Recovery (⌘⌥R). The download should proceed; if it stalls at same byte offset, proceed to Phase 3.

Phase 3: Hardware / DFU Deep Restoration (Complete Firmware Reflashing)

  1. Connect Mac to a host Mac running Apple Configurator 2 (v2.16+) via USB‑C (Thunderbolt/USB‑4) cable. For M1/M2/M3, use the DFU/Revive port (left‑most USB‑C on MacBook Pro, rear on Mac Studio).
  2. Put target Mac into DFU Mode:
    • Apple Silicon: Power off → Hold Power 10 s → Release, then immediately hold Power + Right
Still stuck on Error -2006F?

Share your exact OS build and Finder/Console snippet in the OS Updates & Error Codes forum room.

Get Peer Triage →