jackwener/OpenCLI · critical · CommandExecutionError
${label} request failed: ${err?.message ?? err}. Check that
Error message
${label} request failed: ${err?.message ?? err}. Check that hub.docker.com is reachable from this network. What it means
hubFetch wraps fetch calls to hub.docker.com and converts network-level failures into CommandExecutionError with the label prefix. Thrown when the HTTP request itself fails (DNS failure, connection refused, timeout, TLS error) before a response is received.
Source
Thrown at clis/dockerhub/utils.js:75
`dockerhub image "${input}" is not a valid repository slug`,
'Use lowercase letters / digits / "._-", optionally prefixed with "<owner>/".',
);
}
if (name.length < 2 || name.length > 255) {
throw new ArgumentError(
`dockerhub image "${input}" name must be 2-255 chars`,
);
}
return { owner, name };
}
export async function hubFetch(url, label) {
let resp;
try {
resp = await fetch(url, { headers: { 'user-agent': UA, accept: 'application/json' } });
}
catch (err) {
throw new CommandExecutionError(
`${label} request failed: ${err?.message ?? err}`,
'Check that hub.docker.com is reachable from this network.',
);
}
if (resp.status === 404) {
throw new EmptyResultError(label, `Docker Hub returned 404 for ${url}.`);
}
if (resp.status === 429) {
throw new CommandExecutionError(
`${label} returned HTTP 429 (rate limited)`,
'Docker Hub throttles anonymous traffic; wait a few seconds and retry.',
);
}
if (!resp.ok) {
throw new CommandExecutionError(`${label} returned HTTP ${resp.status}`);
}
let body;
try {View on GitHub (pinned to 49907e53dc)
Solutions
- Verify network connectivity: curl -I https://hub.docker.com
- Check/fix HTTP(S)_PROXY / NO_PROXY env vars for the environment
- Retry after transient network issues or add backoff/retry around the command
- Check firewall/DNS rules allowing egress to hub.docker.com
Example fix
// before
await hubFetch(url, 'dockerhub search'); // no retry
// after
for (let i = 0; i < 3; i++) {
try { return await hubFetch(url, 'dockerhub search'); }
catch (e) { if (i === 2) throw e; await new Promise(r => setTimeout(r, 2 ** i * 500)); }
} Defensive patterns
Strategy: retry
Validate before calling
// preflight
const ok = await fetch('https://hub.docker.com/v2/', { method: 'HEAD' }).then(r => r.ok).catch(() => false); if (!ok) throw new Error('hub.docker.com unreachable from this network'); Try / catch
try { body = await hubFetch(url, 'dockerhub search'); } catch (e) { if (e instanceof CommandExecutionError && e.message.includes('request failed')) { await backoff(3); body = await hubFetch(url, 'dockerhub search'); } else throw e; } Prevention
- Check egress/proxy settings in CI and containers
- Set HTTP(S)_PROXY correctly for restricted networks
- Implement exponential-backoff retries for transient failures
- Monitor Docker Hub reachability before batch jobs
When it happens
Trigger: Calling any dockerhub command (search, tags, info) while offline or behind a blocking firewall/proxy; hub.docker.com DNS not resolving; corporate proxy rejecting HTTPS; fetch aborting on timeout.
Common situations: CI runners without internet egress; Docker Hub rate-limit/block via network appliance; VPN changes breaking DNS; misconfigured HTTP(S)_PROXY environment variables.
Related errors
- Failed to fetch Chess.com callback ${url}: ${error?.message
- ${label} request failed: ${err?.message ?? err}
- mdn search request failed: ${err?.message ?? err}
- network error fetching signed URL: ${e.message}
- Trip.com poiSearch fetch failed: ${err instanceof Error ? er
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/57bbbc93db90b9e9.
Report an issue: GitHub.