elastic/elasticsearch · error · UnsupportedDatabaseTypeException

Unsupported database type [{}] for file [{}]

Error message

Unsupported database type [{}] for file [{}]

What it means

Thrown by IpDataLookupFactories.get when getDatabase(databaseType) returns null, i.e. the database type string does not correspond to any known Database enum value. It is an UnsupportedDatabaseTypeException carrying both the type and the file name, surfaced when an ingest geoip processor tries to load a lookup for a database file whose type is unrecognized.

Source

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

    /**
     * Strips the {@code .mmdb} extension from a database filename to produce a type-like string.
     * This is a heuristic fallback for when the actual database metadata is not available.
     * For standard databases (e.g. "GeoLite2-City.mmdb"), the stripped name matches the metadata type.
     * For non-standard databases (e.g. ipinfo), the stripped name may not match, and callers
     * should prefer reading the type from the database metadata when possible.
     */
    static String guessDatabaseType(String databaseFile) {
        String name = databaseFile;
        if (name.endsWith(".mmdb")) {
            name = name.substring(0, name.length() - 5);
        }
        return name;
    }

    static IpDataLookupFactory get(final String databaseType, final String databaseFile) {
        final Database database = getDatabase(databaseType);
        if (database == null) {
            throw new UnsupportedDatabaseTypeException("Unsupported database type [" + databaseType + "] for file [" + databaseFile + "]");
        }

        final Function<Set<DatabaseProperty>, InternalIpDataLookup> factoryMethod;
        final String databaseTypeLowerCase = databaseType.toLowerCase(Locale.ROOT);
        if (databaseTypeLowerCase.startsWith(IPINFO_PREFIX)) {
            factoryMethod = getIpinfoLookup(database);
        } else {
            // for historical reasons, fall back to assuming maxmind-like types
            factoryMethod = getMaxmindLookup(database);
        }

        if (factoryMethod == null) {
            throw new UnsupportedDatabaseTypeException("Unsupported database type [" + databaseType + "] for file [" + databaseFile + "]");
        }

        return new IpDataLookupFactory() {
            @Override
            public InternalIpDataLookup create(List<String> properties) {

View on GitHub (pinned to db6a809a66)

Solutions

  1. Inspect the mmdb file's database_type metadata (e.g. with mmdblookup or the metadata tool) to see the actual type string.
  2. Use a supported database type/edition (City, Country, ASN, etc., or a recognized Ipinfo variant).
  3. If the type is legitimately new, extend the Database enum and getDatabase mapping (code change).
  4. Re-download the database in case the type string was corrupted.
Defensive patterns

Strategy: validation

Validate before calling

boolean isKnownDatabaseType(String t) {
    return IpDataLookupFactories.getDatabase(t) != null;
}

Try / catch

try {
    IpDataLookupFactory f = IpDataLookupFactories.get(type, file);
} catch (UnsupportedDatabaseTypeException e) {
    // inspect the mmdb metadata type string; switch to a supported edition or extend the Database enum
}

Prevention

When it happens

Trigger: IpDataLookupFactories.get(databaseType, databaseFile) -> Database database = getDatabase(databaseType); database == null -> throw. Happens when an mmdb file's type header yields a string that is not a known database type.

Common situations: Custom/third-party mmdb whose database_type metadata is not in the supported set; a renamed or future Maxmind edition; a corrupt type string extracted from the mmdb; using an unsupported Ipinfo subtype.

Related errors


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