{"record":{"id":"0a24b13fca1480a6","repo":"jd-opensource/joyagent-jdgenie","slug":"error-0a24b1","errorCode":null,"errorMessage":"向量集合为空！","messagePattern":"向量集合为空！","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"genie-backend/src/main/java/com/jd/genie/service/QdrantService.java","lineNumber":139,"sourceCode":"                        .setWithPayload(enable(true))\n                        .build()).get();\n    }\n\n    public void deletePointsSync(String collectionName, List<Points.PointId> ids) throws ExecutionException, InterruptedException {\n        client.deleteAsync(collectionName, ids).get();\n    }\n\n    public void deleteByFilterSync(String collectionName, Points.Filter filter) throws ExecutionException, InterruptedException {\n        client.deleteAsync(collectionName, filter).get();\n    }\n\n    public Points.UpdateResult upsertVectors(String collectionName, List<List<Float>> vectors, List<Map<String, JsonWithInt.Value>> payloads) throws ExecutionException, InterruptedException {\n        if (StringUtils.isBlank(collectionName)) {\n            throw new RuntimeException(\"集合名为空！\");\n        }\n\n        if (CollectionUtils.isEmpty(vectors)) {\n            throw new RuntimeException(\"向量集合为空！\");\n        }\n\n        if (CollectionUtils.isEmpty(payloads)) {\n            throw new RuntimeException(\"元数据集合为空！\");\n        }\n\n        if (vectors.size() != payloads.size()) {\n            throw new RuntimeException(\"向量集合大小与元数据集合大小不一致，vectorSize：\" + vectors.size() + \"，payloadSize：\" + payloads.size());\n        }\n\n        List<Points.PointStruct> pointStructList = new ArrayList<>();\n        for (int i = 0; i < vectors.size(); i++) {\n            Points.PointStruct pointStruct = Points.PointStruct.newBuilder()\n                    .setId(id(UUID.randomUUID()))\n                    .setVectors(vectors(vectors.get(i)))\n                    .putAllPayload(payloads.get(i))\n                    .build();\n            pointStructList.add(pointStruct);","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/jd-opensource/joyagent-jdgenie/blob/2417e0b8b636d941ad5fb14c59b20dddfef5375d/genie-backend/src/main/java/com/jd/genie/service/QdrantService.java#L121-L157","documentation":"Parameter validation in QdrantService.upsertVectors: a batch upsert was requested against the Qdrant vector database but the collectionName argument is blank, so there is no target collection to write to. It is one of a series of per-argument guards (collection name, vectors, payloads) that fail fast with a Chinese-language RuntimeException before any RPC is attempted; fires when callers pass an unset or empty collection identifier.","triggerScenarios":"Calling upsertVectors with an empty vectors list: the batch producer produced no records, an upstream embedding step returned nothing, or data was filtered out before the call.","commonSituations":"Empty input dataset or empty batch after filtering; embedding failures silently dropping all items; loop bug leaving the list unpopulated.","solutions":["Check upstream data pipeline for why zero vectors were produced","Skip the call gracefully when the batch is empty instead of treating it as an error","Log batch sizes at each pipeline stage to find where items were dropped"],"exampleFix":"// before\nqdrantService.upsertVectors(collection, vectors, payloads);\n// after\nif (!vectors.isEmpty()) {\n    qdrantService.upsertVectors(collection, vectors, payloads);\n} else {\n    log.warn(\"skip upsert: no vectors to write\");\n}","handlingStrategy":"validation","validationCode":"if (vectors == null || vectors.isEmpty()) {\n    return; // nothing to upsert, skip instead of erroring\n}","typeGuard":null,"tryCatchPattern":"try {\n    qdrantService.upsertVectors(collectionName, vectors, payloads);\n} catch (RuntimeException e) {\n    if (\"向量集合为空！\".equals(e.getMessage())) {\n        log.warn(\"empty vector batch skipped\");\n    } else throw e;\n}","preventionTips":["Check batch size before calling upsert; treat empty batches as no-ops","Log item counts at each pipeline stage to spot silent drops","Verify embedding failures are propagated, not swallowed"],"tags":["java","qdrant","vector-database","validation"],"backgroundTag":"empty-required-field","analyzedSha":"2417e0b8b636d941ad5fb14c59b20dddfef5375d","analyzedAt":"2026-09-08T11:28:19.414Z","contentChangedAt":"2026-09-08T11:28:19.414Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}