elastic/elasticsearch · error · IllegalArgumentException

Unexpected provider [%s] for configuration [%s]

Error message

Unexpected provider [%s] for configuration [%s]

What it means

Thrown by EnterpriseGeoIpDownloader.downloaderFor when a DatabaseConfiguration's provider is neither Maxmind nor Ipinfo. The enterprise downloader only knows how to fetch from those two remote providers; any other provider subtype (Web, Local, or a future type) has no download strategy. This is an IllegalArgumentException surfaced during updateDatabases(), so it fails that database's update but the executor catches and logs it.

Source

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

            .filter(e -> e.getValue().isNewEnough(clusterService.state().metadata().settings()) == false)
            .map(entry -> Tuple.tuple(entry.getKey(), entry.getValue()))
            .toList();
        expiredDatabases.forEach(e -> {
            String name = e.v1();
            Metadata meta = e.v2();
            deleteOldChunks(name, meta.lastChunk() + 1);
            state = state.put(name, new Metadata(meta.lastUpdate(), meta.firstChunk(), meta.lastChunk(), meta.md5(), meta.lastCheck() - 1));
            updateTaskState();
        });
    }

    private ProviderDownload downloaderFor(DatabaseConfiguration database) {
        if (database.provider() instanceof DatabaseConfiguration.Maxmind maxmind) {
            return new MaxmindDownload(database.name(), maxmind);
        } else if (database.provider() instanceof DatabaseConfiguration.Ipinfo ipinfo) {
            return new IpinfoDownload(database.name(), ipinfo);
        } else {
            throw new IllegalArgumentException(
                Strings.format("Unexpected provider [%s] for configuration [%s]", database.provider().getClass(), database.id())
            );
        }
    }

    class MaxmindDownload implements ProviderDownload {

        final String name;
        final DatabaseConfiguration.Maxmind maxmind;
        HttpClient.PasswordAuthenticationHolder auth;

        MaxmindDownload(String name, DatabaseConfiguration.Maxmind maxmind) {
            this.name = name;
            this.maxmind = maxmind;
            this.auth = buildCredentials();
        }

        @Override

View on GitHub (pinned to db6a809a66)

Solutions

  1. Only register Maxmind or Ipinfo providers with the enterprise geoip downloader; use the local/Web code paths for other provider types.
  2. If you added a new provider subtype, extend downloaderFor with a branch returning a new ProviderDownload implementation.
  3. Audit the database configurations stored in the cluster state to find and remove/replace the offending configuration whose id is named in the message.
Defensive patterns

Strategy: validation

Validate before calling

boolean isRemoteDownloadSupported(DatabaseConfiguration db) {
    var p = db.provider();
    return p instanceof DatabaseConfiguration.Maxmind || p instanceof DatabaseConfiguration.Ipinfo;
}

Try / catch

try {
    ProviderDownload pd = downloader.downloaderFor(db);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unexpected provider")) {
        // skip or reroute non-remote providers; do not feed Web/Local to the enterprise path
        logger.warn("skipping non-remote provider [{}]", db.id());
    } else throw e;
}

Prevention

When it happens

Trigger: A DatabaseConfiguration created with a Web or Local provider is processed by the EnterpriseGeoIpDownloaderTaskExecutor (e.g. via updateDatabases -> downloadAndIndex -> downloaderFor). The instanceof chain falls through to the else branch.

Common situations: Mixing the enterprise downloader with non-remote providers; a future provider type added to DatabaseConfiguration without a matching branch here; a test fixture that constructs a Local/Web provider and routes it through the enterprise path.

Related errors


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