{"record":{"id":"f589987f7ab61116","repo":"spring-projects/spring-ai","slug":"error-removing-embedding-e-getmessage","errorCode":null,"errorMessage":"Error removing embedding: ${e.getMessage()}","messagePattern":"Error removing embedding: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"vector-stores/spring-ai-gemfire-store/src/main/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStore.java","lineNumber":262,"sourceCode":"\t\t\t.retrieve()\n\t\t\t.bodyToMono(Void.class)\n\t\t\t.onErrorMap(WebClientException.class, this::handleHttpClientException)\n\t\t\t.block();\n\t}\n\n\t@Override\n\tpublic void doDelete(List<String> idList) {\n\t\ttry {\n\t\t\tthis.client.method(HttpMethod.DELETE)\n\t\t\t\t.uri(\"/\" + this.indexName + EMBEDDINGS)\n\t\t\t\t.body(BodyInserters.fromValue(idList))\n\t\t\t\t.retrieve()\n\t\t\t\t.bodyToMono(Void.class)\n\t\t\t\t.block();\n\t\t}\n\t\tcatch (RuntimeException e) {\n\t\t\tif (logger.isWarnEnabled()) {\n\t\t\t\tlogger.warn(\"Error removing embedding: \" + e.getMessage(), e);\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic List<Document> doSimilaritySearch(SearchRequest request) {\n\t\tString filterQuery = null;\n\t\tif (request.hasFilterExpression()) {\n\t\t\tAssert.notNull(request.getFilterExpression(), \"filterExpression should not be null\");\n\t\t\tfilterQuery = this.filterExpressionConverter.convertExpression(request.getFilterExpression());\n\t\t}\n\t\tfloat[] floatVector = this.embeddingModel.embed(request.getQuery());\n\t\tList<Document> result = this.client.post()\n\t\t\t.uri(\"/\" + this.indexName + QUERY)\n\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t.bodyValue(new QueryRequest(floatVector, request.getTopK(), request.getTopK(), // TopKPerBucket\n\t\t\t\t\ttrue, filterQuery))\n\t\t\t.retrieve()","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/spring-projects/spring-ai/blob/98a7beda4f29d80a71c5837eb4053b03a93a46f7/vector-stores/spring-ai-gemfire-store/src/main/java/org/springframework/ai/vectorstore/gemfire/GemFireVectorStore.java#L244-L280","documentation":"GemFireVectorStore.doDelete issues an HTTP DELETE to the GemFire REST endpoint to remove a document's embedding and swallows any RuntimeException, logging it at WARN level. The delete is best-effort: the method returns normally even when removal failed, so the vector may still exist in the store. This message means the HTTP removal of an embedding did not succeed.","triggerScenarios":"Calling vectorStore.delete(List.of(id)) (or delete by filter that routes to doDelete) when the GemFire REST call throws a RuntimeException: connection refused, HTTP 4xx/5xx via WebClient (WebClientResponseException), timeouts, or an unreachable locator/region.","commonSituations":"GemFire server down or restarted; wrong gemfire.host/port configuration; the region does not exist; network/firewall blocking the REST API; authentication changes on the server.","solutions":["Verify the GemFire server is reachable and the REST endpoint (host/port) configured in GemFireVectorStore.builder() is correct","Check the logged cause (stack trace attached at WARN) for the concrete WebClientResponseException status","Confirm the target region/index exists and the document id was previously added","Retry the delete after restoring connectivity, since the exception is swallowed and never surfaced to the caller"],"exampleFix":"// before\ngemFireVectorStore.delete(List.of(docId)); // silently ignored on failure\n\n// after\ntry {\n    gemFireVectorStore.delete(List.of(docId));\n    if (logger.isDebugEnabled()) { logger.debug(\"deleted \" + docId); }\n} catch (Exception e) {\n    logger.error(\"delete reported failure in logs; verify GemFire connectivity\", e);\n}","handlingStrategy":"try-catch","validationCode":"// before deleting, check the store is reachable\n// e.g. perform a cheap similaritySearch to validate connectivity\nList<Document> probe = gemFireVectorStore.similaritySearch(SearchRequest.query(\"ping\").withTopK(1));","typeGuard":null,"tryCatchPattern":"try {\n    gemFireVectorStore.delete(List.of(id));\n} catch (RuntimeException e) {\n    logger.error(\"GemFire delete failed (store logs WARN internally)\", e);\n}","preventionTips":["Health-check GemFire REST endpoint at startup","Pin host/port config in one place and validate early","Remember the store swallows delete failures; verify deletions independently","Monitor WARN logs for 'Error removing embedding'"],"tags":["http","delete","rest","vector-store"],"backgroundTag":"http-error-response","analyzedSha":"98a7beda4f29d80a71c5837eb4053b03a93a46f7","analyzedAt":"2026-09-11T14:15:49.441Z","contentChangedAt":"2026-09-11T14:15:49.441Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}