{"record":{"id":"46818bcc2449376c","repo":"elastic/elasticsearch","slug":"database-configuration-not-found","errorCode":null,"errorMessage":"Database configuration not found: {}","messagePattern":"Database configuration not found: (.+?)","errorType":"http","errorClass":"ResourceNotFoundException","httpStatus":404,"severity":"error","filePath":"modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/TransportDeleteDatabaseConfigurationAction.java","lineNumber":98,"sourceCode":"        );\n        this.deleteDatabaseConfigurationTaskQueue = clusterService.createTaskQueue(\n            \"delete-geoip-database-configuration-state-update\",\n            Priority.NORMAL,\n            DELETE_TASK_EXECUTOR\n        );\n        this.projectResolver = projectResolver;\n    }\n\n    @Override\n    protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<AcknowledgedResponse> listener)\n        throws Exception {\n        final String id = request.getDatabaseId();\n        final ProjectId projectId = projectResolver.getProjectId();\n        final IngestGeoIpMetadata geoIpMeta = state.metadata()\n            .getProject(projectId)\n            .custom(IngestGeoIpMetadata.TYPE, IngestGeoIpMetadata.EMPTY);\n        if (geoIpMeta.getDatabases().containsKey(id) == false) {\n            throw new ResourceNotFoundException(\"Database configuration not found: {}\", id);\n        } else if (geoIpMeta.getDatabases().get(id).database().isReadOnly()) {\n            throw new IllegalArgumentException(\"Database \" + id + \" is read only\");\n        }\n        deleteDatabaseConfigurationTaskQueue.submitTask(\n            Strings.format(\"delete-geoip-database-configuration-[%s]\", id),\n            new DeleteDatabaseConfigurationTask(projectId, listener, id),\n            null\n        );\n    }\n\n    private record DeleteDatabaseConfigurationTask(ProjectId projectId, ActionListener<AcknowledgedResponse> listener, String databaseId)\n        implements\n            ClusterStateTaskListener {\n\n        ClusterState execute(ClusterState currentState) throws Exception {\n            final var project = currentState.metadata().getProject(projectId);\n            final IngestGeoIpMetadata geoIpMeta = project.custom(IngestGeoIpMetadata.TYPE, IngestGeoIpMetadata.EMPTY);\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ip-location/src/main/java/org/elasticsearch/ingest/geoip/direct/TransportDeleteDatabaseConfigurationAction.java#L80-L116","documentation":"Thrown as ResourceNotFoundException by TransportDeleteDatabaseConfigurationAction.masterOperation when the requested database id is not present in the project's IngestGeoIpMetadata cluster state. DELETE is idempotent-failing here: a missing id is an error, not a silent success.","triggerScenarios":"DELETE _ingest/geoip/database/<id> where <id> was never created, was already deleted, or belongs to a different project. The lookup goes through the project resolver, so cross-project deletes also miss.","commonSituations":"Retrying a delete after it already succeeded; deleting by an id from a stale config list; typos in the id; deleting in the wrong project/namespace; the database was a read-only Local/Web entry that cannot be deleted and was concurrently removed.","solutions":["Verify the id exists first with GET _ingest/geoip/database/<id> and copy the exact id.","If the delete already completed, treat the 404 as success and stop retrying.","Ensure the client targets the correct project if multiple projects are in use."],"exampleFix":"// before\nDELETE _ingest/geoip/database/typo-id\n\n// after\nDELETE _ingest/geoip/database/my-city-db   // (confirmed via GET first)","handlingStrategy":"try-catch","validationCode":"// Optional pre-check (still race-prone; the 404 is authoritative)\nboolean exists = client.geoipDatabases().get(id) != null; // pseudo\nif (!exists) { /* nothing to delete */ }","typeGuard":null,"tryCatchPattern":"// Treat 404 on delete as acceptable when double-deleting\ntry {\n    client.deleteDatabaseConfig(id);\n} catch (ResourceNotFoundException e) {\n    // already gone - treat as success\n}","preventionTips":["GET the id first to confirm it exists before DELETE.","Make delete-retry logic tolerant of 404 (treat as already-deleted).","Copy the exact id from GET output rather than retyping."],"tags":["elasticsearch","geoip","not-found","rest-api","delete"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}