{"record":{"id":"8bd75e707b7da172","repo":"elastic/elasticsearch","slug":"invalid-database-configuration-id-id-is-too","errorCode":null,"errorMessage":"invalid database configuration id [{}]: id is too long, ({} > 127)","messagePattern":"invalid database configuration id \\[(.+?)\\]: id is too long, \\((.+?) > 127\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/DatabaseConfiguration.java","lineNumber":177,"sourceCode":"        builder.endObject();\n        return builder;\n    }\n\n    /**\n     * An id is intended to be alphanumerics, dashes, and underscores (only), but we're reserving leading dashes and underscores for\n     * ourselves in the future, that is, they're not for the ones that users can PUT.\n     */\n    static void validateId(String id) throws IllegalArgumentException {\n        if (Strings.isNullOrEmpty(id)) {\n            throw new IllegalArgumentException(\"invalid database configuration id [\" + id + \"]: must not be null or empty\");\n        }\n        MetadataCreateIndexService.validateIndexOrAliasName(\n            id,\n            (id1, description) -> new IllegalArgumentException(\"invalid database configuration id [\" + id1 + \"]: \" + description)\n        );\n        int byteCount = id.getBytes(StandardCharsets.UTF_8).length;\n        if (byteCount > 127) {\n            throw new IllegalArgumentException(\n                \"invalid database configuration id [\" + id + \"]: id is too long, (\" + byteCount + \" > \" + 127 + \")\"\n            );\n        }\n        if (ID_PATTERN.matcher(id).matches() == false) {\n            throw new IllegalArgumentException(\n                \"invalid database configuration id [\"\n                    + id\n                    + \"]: id doesn't match required rules (alphanumerics, dashes, and underscores, only)\"\n            );\n        }\n    }\n\n    public ActionRequestValidationException validate() {\n        ActionRequestValidationException err = new ActionRequestValidationException();\n\n        // how do we cross the id validation divide here? or do we? it seems unfortunate to not invoke it at all.\n\n        // name validation","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/DatabaseConfiguration.java#L159-L195","documentation":"Thrown by DatabaseConfiguration.validateId when the id exceeds 127 bytes when encoded as UTF-8. The 127-byte ceiling is a hard limit (note ID_PATTERN also caps at 127 characters) chosen to keep ids filesystem- and index-name-safe. Multi-byte characters (e.g. Unicode) count by byte length, not character count.","triggerScenarios":"PUT _ingest/geoip/database/<id> with an id longer than 127 UTF-8 bytes. Non-ASCII characters inflate the byte count faster than the character count, so a visually short Unicode id can still exceed the limit.","commonSituations":"Auto-generated ids that concatenate long prefixes/suffixes; templated ids that embed tenant + region + timestamp; Unicode ids that look short but are multi-byte.","solutions":["Shorten the id to 127 UTF-8 bytes or fewer; prefer concise, human-readable names like 'city-db'.","If ids are generated, truncate or hash long inputs to a fixed short length before sending.","Count bytes (not chars) when validating client-side: id.getBytes(StandardCharsets.UTF_8).length <= 127."],"exampleFix":"// before\nPUT _ingest/geoip/database/my-very-long-geoip-database-configuration-identifier-that-exceeds-the-allowed-byte-limit-of-one-hundred-twenty-seven\n\n// after\nPUT _ingest/geoip/database/city-db","handlingStrategy":"validation","validationCode":"String id = requestConfig.getId();\nint byteLen = id.getBytes(StandardCharsets.UTF_8).length;\nif (byteLen > 127) {\n    throw new IllegalArgumentException(\"id is \" + byteLen + \" UTF-8 bytes; max is 127\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep ids short and ASCII-only to avoid byte-vs-char surprises.","If ids are generated, cap their source length and hash/truncate to a safe bound.","Validate byte length client-side, not character length, for non-ASCII names."],"tags":["elasticsearch","geoip","validation","configuration-id","length-limit"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}