elastic/elasticsearch · error · ResourceNotFoundException

{} not found

Error message

{} not found

What it means

Thrown by HttpClient.get when the server returns HTTP 404 for the requested URL. It is a ResourceNotFoundException carrying the URL, surfaced during a geoip database or checksum download. Distinct from other HTTP errors (which become error during downloading) so callers can treat 404 as 'the resource does not exist right now'.

Source

Thrown at modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/HttpClient.java:118

                    // deal with redirections (including relative urls)
                    final String location = conn.getHeaderField("Location");
                    final URL base = new URL(innerUrl);
                    final URL next = new URL(base, location);
                    innerUrl = next.toExternalForm();

                    // compare the *original* authority and the next authority to determine whether to include auth details.
                    // this means that the host and port (if it is provided explicitly) are considered. it also means that if we
                    // were to ping-pong back to the original authority, then we'd start including the auth details again.
                    final String nextAuthority = next.getAuthority();
                    if (originalAuthority.equals(nextAuthority)) {
                        conn = createConnection(auth, innerUrl);
                    } else {
                        conn = createConnection(NO_AUTH, innerUrl);
                    }
                    break;
                case HTTP_NOT_FOUND:
                    throw new ResourceNotFoundException("{} not found", url);
                default:
                    int responseCode = conn.getResponseCode();
                    throw new ElasticsearchStatusException("error during downloading {}", RestStatus.fromCode(responseCode), url);
            }
        }
    }

    @SuppressForbidden(reason = "we need socket connection to download data from internet")
    private static InputStream getInputStream(final HttpURLConnection conn) throws IOException {
        return conn.getInputStream();
    }

    private static HttpURLConnection createConnection(final PasswordAuthentication auth, final String url) throws IOException {
        final HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
        if (auth != NO_AUTH) {
            conn.setAuthenticator(new Authenticator() {
                protected PasswordAuthentication getPasswordAuthentication() {
                    return auth;

View on GitHub (pinned to db6a809a66)

Solutions

  1. Open the URL from the message in a browser/curl with the same credentials to confirm it is genuinely missing.
  2. Correct the database name / edition in the configuration to a value the provider offers.
  3. Confirm the endpoint base URL setting is correct for the provider.
  4. Verify the account entitlement includes the requested edition; retry later if it may be a transient publish-window 404.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    byte[] b = httpClient.getBytes(auth, url);
} catch (ResourceNotFoundException e) {
    // url is genuinely missing: fix database name/edition, confirm entitlement, or retry later
    logger.warn("geoip resource not found [{}]", url);
}

Prevention

When it happens

Trigger: HttpClient.get switch hits case HTTP_NOT_FOUND -> throw new ResourceNotFoundException("{} not found", url). Happens for the tar.gz, tar.gz.sha256, mmdb, or checksums JSON URL when the provider has no such file.

Common situations: Database name typo in the configuration; the provider renamed or removed the edition; pointing at the wrong endpoint base; the edition is not entitled for the account; transient provider 404 during a publish window.

Related errors


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/db8132f838034304. Report an issue: GitHub.