{"record":{"id":"9ae100f1e4ba94e5","repo":"elastic/elasticsearch","slug":"wildcard-only-supports-a-single-value-please-use","errorCode":null,"errorMessage":"wildcard only supports a single value, please use comma-separated values or a single wildcard value","messagePattern":"wildcard only supports a single value, please use comma-separated values or a single wildcard value","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/TransportGetDatabaseConfigurationAction.java","lineNumber":88,"sourceCode":"            actionFilters,\n            GetDatabaseConfigurationAction.NodeRequest::new,\n            threadPool.executor(ThreadPool.Names.MANAGEMENT)\n        );\n        this.databaseNodeService = databaseNodeService;\n        this.projectResolver = projectResolver;\n    }\n\n    protected List<DatabaseConfigurationMetadata> createActionContext(Task task, GetDatabaseConfigurationAction.Request request) {\n        final Set<String> ids;\n        if (request.getDatabaseIds().length == 0) {\n            // if we did not ask for a specific name, then return all databases\n            ids = Set.of(\"*\");\n        } else {\n            ids = new LinkedHashSet<>(Arrays.asList(request.getDatabaseIds()));\n        }\n\n        if (ids.size() > 1 && ids.stream().anyMatch(Regex::isSimpleMatchPattern)) {\n            throw new IllegalArgumentException(\n                \"wildcard only supports a single value, please use comma-separated values or a single wildcard value\"\n            );\n        }\n        List<DatabaseConfigurationMetadata> results = new ArrayList<>();\n        ProjectMetadata projectMetadata = projectResolver.getProjectMetadata(clusterService.state());\n        PersistentTasksCustomMetadata tasksMetadata = PersistentTasksCustomMetadata.get(projectMetadata);\n        String geoIpTaskId = GeoIpDownloaderTaskExecutor.getTaskId(projectMetadata.id(), projectResolver.supportsMultipleProjects());\n\n        for (String id : ids) {\n            results.addAll(getWebDatabases(geoIpTaskId, tasksMetadata, id));\n            results.addAll(getMaxmindDatabases(projectMetadata, id));\n        }\n        return results;\n    }\n\n    /*\n     * This returns read-only database information about the databases managed by the standard downloader\n     */","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/TransportGetDatabaseConfigurationAction.java#L70-L106","documentation":"Thrown by TransportGetDatabaseConfigurationAction.createActionContext (coordinating/master node) when the GET request supplies more than one id AND at least one of them is a wildcard pattern (contains '*', '?', or other Regex.isSimpleMatchPattern metacharacters). Mixing concrete ids with wildcards, or multiple wildcards, is disallowed; you must use either a single wildcard or a comma-separated list of concrete ids.","triggerScenarios":"GET _ingest/geoip/database/a,b* or GET _ingest/geoip/database/*,city-db. Any combination where ids.size() > 1 and any id matches a wildcard pattern trips the guard on the master/coordination path.","commonSituations":"Building a 'fetch these plus everything matching that prefix' query in one call; passing an array of ids that accidentally includes a glob; UI that appends '*' to a filter alongside selected names.","solutions":["Use a single wildcard by itself: GET _ingest/geoip/database/* or GET _ingest/geoip/database/city*.","Use a comma-separated list of concrete (non-wildcard) ids: GET _ingest/geoip/database/a,b,c.","Split into two requests: one wildcard call and one explicit-id call."],"exampleFix":"// before\nGET _ingest/geoip/database/city-db,*\n\n// after\nGET _ingest/geoip/database/*","handlingStrategy":"validation","validationCode":"// Before GET, ensure no wildcard mixing\nList<String> ids = Arrays.asList(requestIds);\nboolean hasWildcard = ids.stream().anyMatch(s -> s.matches(\".*[*?].*\"));\nif (ids.size() > 1 && hasWildcard) {\n    throw new IllegalArgumentException(\"Use a single wildcard OR a list of concrete ids, not both\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass either a single '*'/'prefix*' wildcard or a comma-separated list of exact ids.","Never append '*' alongside concrete ids in one request.","In UIs, make the wildcard and explicit-selection controls mutually exclusive."],"tags":["elasticsearch","geoip","validation","wildcard","rest-api","get"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}