{"record":{"id":"25f3f0ff318e2558","repo":"alibaba/spring-ai-alibaba","slug":"error-25f3f0","errorCode":null,"errorMessage":"评估器版本不存在","messagePattern":"评估器版本不存在","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/impl/EvaluatorVersionServiceImpl.java","lineNumber":93,"sourceCode":"    }\n\n    @Override\n    public EvaluatorVersion getById(Long id) {\n        log.info(\"查询评估器版本详情: {}\", id);\n\n        return EvaluatorVersion.fromDO(evaluatorVersionMapper.selectById(id));\n    }\n\n    @Override\n    public EvaluatorVersion update(EvaluatorVersionUpdateRequest request) {\n        log.info(\"更新评估器版本: {}\", request.getEvaluatorVersionId());\n\n\n        // 检查版本是否已存在及状态验证\n        EvaluatorVersionDO exists = evaluatorVersionMapper.selectById(request.getEvaluatorVersionId());\n\n        if (Objects.isNull(exists)){\n            throw new RuntimeException(\"评估器版本不存在\");\n        }\n\n        evaluatorVersionMapper.update(request.getEvaluatorVersionId(), request.getDescription(), request.getStatus());\n\n        return getById(request.getEvaluatorVersionId());\n    }\n}\n","sourceCodeStart":75,"sourceCodeEnd":101,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-start/src/main/java/com/alibaba/cloud/ai/studio/admin/service/impl/EvaluatorVersionServiceImpl.java#L75-L101","documentation":"Thrown by EvaluatorVersionServiceImpl.update when selectById(request.getEvaluatorVersionId()) returns null — no evaluator version exists for the supplied ID. The service refuses to update a non-existent row and fails fast with this RuntimeException.","triggerScenarios":"Calling the update API with an evaluatorVersionId that was deleted, never created, or belongs to another environment; also triggered when the client sends the evaluator ID instead of the version ID.","commonSituations":"Frontend holding a stale list after a delete; confusing evaluatorId with evaluatorVersionId in the request payload; switching dev/prod datasources; IDs reused from an old database snapshot.","solutions":["Verify the evaluatorVersionId exists (GET list or getById) before updating","Distinguish evaluatorId vs evaluatorVersionId in the request — update expects the version's ID","Throw a typed EvaluatorVersionNotFoundException so the API returns 404 not 500","Check you are connected to the environment where the version was created"],"exampleFix":"// before\nif (Objects.isNull(exists)) {\n    throw new RuntimeException(\"评估器版本不存在\");\n}\n// after\nif (Objects.isNull(exists)) {\n    throw new EvaluatorVersionNotFoundException(request.getEvaluatorVersionId()); // -> 404\n}","handlingStrategy":"validation","validationCode":"if (request.getEvaluatorVersionId() == null) throw new IllegalArgumentException(\"evaluatorVersionId required\");\nif (evaluatorVersionService.getById(request.getEvaluatorVersionId()) == null) throw new EvaluatorVersionNotFoundException(request.getEvaluatorVersionId());","typeGuard":"boolean versionExists(Long id) { return id != null && evaluatorVersionService.getById(id) != null; }","tryCatchPattern":"try { return evaluatorVersionService.update(request); } catch (RuntimeException e) { return ResponseEntity.notFound().build(); }","preventionTips":["Refresh the version list before showing update forms","Don't confuse evaluatorId with evaluatorVersionId","Re-fetch after deletes to purge stale IDs from client state"],"tags":["database","not-found","update"],"backgroundTag":"record-not-found","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}