{"record":{"id":"05ae9402fd11131c","repo":"elastic/elasticsearch","slug":"unsupported-database-type-for-file","errorCode":null,"errorMessage":"Unsupported database type [{}] for file [{}]","messagePattern":"Unsupported database type \\[(.+?)\\] for file \\[(.+?)\\]","errorType":"validation","errorClass":"UnsupportedDatabaseTypeException","httpStatus":null,"severity":"error","filePath":"modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/IpDataLookupFactories.java","lineNumber":82,"sourceCode":"    /**\n     * Strips the {@code .mmdb} extension from a database filename to produce a type-like string.\n     * This is a heuristic fallback for when the actual database metadata is not available.\n     * For standard databases (e.g. \"GeoLite2-City.mmdb\"), the stripped name matches the metadata type.\n     * For non-standard databases (e.g. ipinfo), the stripped name may not match, and callers\n     * should prefer reading the type from the database metadata when possible.\n     */\n    static String guessDatabaseType(String databaseFile) {\n        String name = databaseFile;\n        if (name.endsWith(\".mmdb\")) {\n            name = name.substring(0, name.length() - 5);\n        }\n        return name;\n    }\n\n    static IpDataLookupFactory get(final String databaseType, final String databaseFile) {\n        final Database database = getDatabase(databaseType);\n        if (database == null) {\n            throw new UnsupportedDatabaseTypeException(\"Unsupported database type [\" + databaseType + \"] for file [\" + databaseFile + \"]\");\n        }\n\n        final Function<Set<DatabaseProperty>, InternalIpDataLookup> factoryMethod;\n        final String databaseTypeLowerCase = databaseType.toLowerCase(Locale.ROOT);\n        if (databaseTypeLowerCase.startsWith(IPINFO_PREFIX)) {\n            factoryMethod = getIpinfoLookup(database);\n        } else {\n            // for historical reasons, fall back to assuming maxmind-like types\n            factoryMethod = getMaxmindLookup(database);\n        }\n\n        if (factoryMethod == null) {\n            throw new UnsupportedDatabaseTypeException(\"Unsupported database type [\" + databaseType + \"] for file [\" + databaseFile + \"]\");\n        }\n\n        return new IpDataLookupFactory() {\n            @Override\n            public InternalIpDataLookup create(List<String> properties) {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/IpDataLookupFactories.java#L64-L100","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the mmdb file's database_type metadata (e.g. with mmdblookup or the metadata tool) to see the actual type string.","Use a supported database type/edition (City, Country, ASN, etc., or a recognized Ipinfo variant).","If the type is legitimately new, extend the Database enum and getDatabase mapping (code change).","Re-download the database in case the type string was corrupted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"boolean isKnownDatabaseType(String t) {\n    return IpDataLookupFactories.getDatabase(t) != null;\n}","typeGuard":null,"tryCatchPattern":"try {\n    IpDataLookupFactory f = IpDataLookupFactories.get(type, file);\n} catch (UnsupportedDatabaseTypeException e) {\n    // inspect the mmdb metadata type string; switch to a supported edition or extend the Database enum\n}","preventionTips":["Use supported Maxmind/Ipinfo editions only.","Inspect the mmdb database_type metadata before pointing a processor at it.","Re-download if the type string looks corrupted.","Extend the Database enum when introducing a new legitimate edition."],"tags":["geoip","mmdb","database-type","lookup","configuration"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}