Skip to content

Commit fcae06b

Browse files
dmsnellclaude
andcommitted
HTML API: Check CommonCrawl access around the fetch.
CommonCrawl refused every WARC record the runner requested with HTTP 403, while serving the index throughout sampling. That fits either a block on the runner's address after sampling's burst of requests, or a refusal of byte-range requests for records from GitHub's network. Temporarily request a known record by range, the same file without a range, and the index, before the fetch and again if the fetch fails, printing each status, the CDN's headers, and the body of any refusal. See #66430. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 510a1de commit fcae06b

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎.github/workflows/html-api-commoncrawl.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ jobs:
118118
extensions: curl, mbstring, pdo_sqlite, zlib
119119
ini-values: memory_limit=1G
120120

121+
# Temporary: shows whether CommonCrawl serves WARC records to this runner before anything else is requested.
122+
- name: Check CommonCrawl access
123+
run: bash "$SCRIPTS/check-commoncrawl-access.sh"
124+
121125
# Samples successful HTML captures from random blocks of the crawl's URL index, from many hosts across the whole crawl,
122126
# and downloads only those records, four at a time. When CommonCrawl asks to slow down, with HTTP 429 or 503, no
123127
# request is sent until its Retry-After or the backoff has passed. A record which still can't be downloaded is listed
@@ -135,6 +139,11 @@ jobs:
135139
--duration "$HTML_API_BENCH_FETCH_DURATION" \
136140
--progress text
137141
142+
# Temporary: shows whether CommonCrawl still serves this runner after a failed fetch.
143+
- name: Check CommonCrawl access after the fetch
144+
if: ${{ failure() }}
145+
run: bash "$SCRIPTS/check-commoncrawl-access.sh"
146+
138147
- name: Time parsing with both checkouts
139148
run: |
140149
for round in $( seq 1 "$HTML_API_BENCH_ROUNDS" ); do
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Temporary: reports whether CommonCrawl serves this runner, to tell whether a 403 for WARC records comes from a block on
4+
# this address after too many requests, or from a refusal of byte-range requests for records from this network.
5+
#
6+
# Requests one known WARC record by range, the same file without a range (stopped once its size is known), and a range of
7+
# the URL index, with the same User-Agent as cc-analyzer. Prints each status, the CDN's headers, and the start of any
8+
# response which is not a success.
9+
10+
set -u
11+
12+
data='https://data.commoncrawl.org'
13+
record="$data/crawl-data/CC-MAIN-2026-43/segments/1791170054432.19/warc/CC-MAIN-20261010041422-20261010071422-00381.warc.gz"
14+
index="$data/cc-index/collections/CC-MAIN-2026-43/indexes/cluster.idx"
15+
16+
probe() {
17+
local label=$1
18+
shift
19+
local body
20+
body=$( mktemp )
21+
22+
curl -sS -o "$body" -D "$body.headers" -A 'cc-analyzer/0.1 PHP-cURL' --max-time 5 --max-filesize 65536 \
23+
-w "${label}: HTTP %{http_code}, %{size_download} bytes\n" "$@" || true
24+
grep -iE '^(server|x-cache|x-amz-cf-pop|retry-after|content-type):' "$body.headers" | sed 's/^/ /'
25+
if ! grep -qE '^HTTP/[0-9.]+ 2' "$body.headers"; then
26+
head -c 600 "$body" | sed 's/^/ | /'
27+
echo
28+
fi
29+
30+
rm -f "$body" "$body.headers"
31+
}
32+
33+
probe 'WARC record by range' -r 5766330-5777984 "$record"
34+
probe 'WARC file without a range' "$record"
35+
probe 'URL index by range' -r 0-4095 "$index"

0 commit comments

Comments
 (0)