gchq/CyberChef · error · OperationError
Error making request to ${url} ${e.toString()}
Error message
Error making request to ${url}
${e.toString()} What it means
Thrown by DNS over HTTPS run() inside the fetch promise chain's .catch(), wrapping any network/fetch failure during the DoH request or its response.json() parse. The error includes the resolved URL and the stringified exception. Because the operation runs in a browser/worker context, this is where CORS aborts, DNS failures of the resolver itself, timeouts, and non-JSON responses surface.
Source
Thrown at src/core/operations/DNSOverHTTPS.mjs:117
url = new URL(resolver);
} catch (error) {
throw new OperationError(error.toString() +
"\n\nThis error could be caused by one of the following:\n" +
" - An invalid Resolver URL\n");
}
const params = {name: input, type: requestType, cd: DNSSEC};
url.search = new URLSearchParams(params);
return fetch(url, {headers: {"accept": "application/dns-json"}}).then(response => {
return response.json();
}).then(data => {
if (justAnswer) {
return extractData(data.Answer);
}
return data;
}).catch(e => {
throw new OperationError(`Error making request to ${url}\n${e.toString()}`);
});
}
}
/**
* Construct an array of just data from a DNS Answer section
*
* @private
* @param {JSON} data
* @returns {JSON}
*/
function extractData(data) {
if (typeof(data) == "undefined") {
return [];
} else {
const dataValues = [];
data.forEach(element => {View on GitHub (pinned to 4290ea7539)
Solutions
- Verify network connectivity to the resolver host (curl the URL with the accept header).
- Switch to the other built-in resolver (Google vs Cloudflare) in case one is blocked.
- Ensure CyberChef is served over https if the page is public, to avoid mixed-content blocking.
- Confirm the custom resolver actually returns application/dns-json for the query; if it returns wireformat, it is the wrong endpoint.
- Check for proxy/firewall rules blocking the DoH endpoint.
Example fix
// before - resolver returns wireformat (RFC8484), not dns-json Resolver: https://dns.example/dns-query (wireformat) // after - use a dns-json (RFC8484 GET-json) endpoint Resolver: https://cloudflare-dns.com/dns-query
Defensive patterns
Strategy: retry
Validate before calling
// cannot fully validate network reachability pre-call, but can sanity-check the URL
function canAttemptFetch(resolver) {
try {
const u = new URL(resolver);
return (u.protocol === "https:" || u.protocol === "http:") && /^https:\/\/(dns\.google\.com|cloudflare-dns\.com)/.test(u.origin);
} catch {
return false;
}
} Type guard
/** @returns {boolean} */
function isKnownDohOrigin(resolver) {
try {
const u = new URL(String(resolver));
return ["https://dns.google.com", "https://cloudflare-dns.com"].includes(u.origin);
} catch {
return false;
}
} Try / catch
try {
result = await dnsOverHttps.run(input, args);
} catch (e) {
if (e instanceof OperationError && /Error making request/.test(e.message)) {
// fall back to the alternate resolver, then surface a network error to the user
args[0] = "https://cloudflare-dns.com/dns-query"; // alternate default
result = await dnsOverHttps.run(input, args);
} else throw e;
} Prevention
- Ensure outbound network access to the DoH endpoint (no proxy/firewall block).
- Serve CyberChef over https to avoid mixed-content fetch blocks.
- Confirm the resolver returns application/dns-json (not wireformat) for GET requests.
- Keep a fallback resolver (Google vs Cloudflare) in the recipe for resilience.
When it happens
Trigger: fetch() rejects (network down, resolver hostname unresolvable, CORS blocked, certificate error, mixed-content block on http page) OR response.json() rejects (resolver returned HTML/non-JSON, 4xx/5xx body that is not valid JSON). The .catch wraps both stages.
Common situations: Running CyberChef on an airgapped/offline network; a corporate proxy blocking the DoH endpoint; the resolver returning an error page (HTML) instead of application/dns-json; browser mixed-content policy blocking https fetch from an http origin; the chosen resolver URL being unreachable.
Related errors
- ${error.toString()} This error could be caused by one of th
- Error: Null response. Try setting the connection mode to COR
- ${e.toString()}\n\nThis error could be caused by one of the
- Unsupported input IP format
- Unsupported output IP format
AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13).
Data as JSON: /api/errors/7d002da569b11dfc.
Report an issue: GitHub.