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

  1. Verify network connectivity to the resolver host (curl the URL with the accept header).
  2. Switch to the other built-in resolver (Google vs Cloudflare) in case one is blocked.
  3. Ensure CyberChef is served over https if the page is public, to avoid mixed-content blocking.
  4. Confirm the custom resolver actually returns application/dns-json for the query; if it returns wireformat, it is the wrong endpoint.
  5. 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

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


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/7d002da569b11dfc. Report an issue: GitHub.