{"record":{"id":"75f6d6ec37be9f55","repo":"alibaba/nacos","slug":"20002-75f6d6","errorCode":"20002","errorMessage":"Invalid Agent Version status: %s","messagePattern":"Invalid Agent Version status: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/form/agent/admin/AgentVersionListForm.java","lineNumber":43,"sourceCode":" *\n * @author Nacos\n */\npublic class AgentVersionListForm extends AgentAdminForm {\n    \n    private static final long serialVersionUID = 1L;\n    \n    private String status;\n    \n    @Override\n    public void validate() throws NacosApiException {\n        super.validate();\n        if (StringUtils.isNotBlank(status)\n            && !AiConstants.Agent.VERSION_STATUS_DRAFT.equals(status)\n            && !AiConstants.Agent.VERSION_STATUS_REVIEWING.equals(status)\n            && !AiConstants.Agent.VERSION_STATUS_REVIEWED.equals(status)\n            && !AiConstants.Agent.VERSION_STATUS_ONLINE.equals(status)\n            && !AiConstants.Agent.VERSION_STATUS_OFFLINE.equals(status)) {\n            throw new IllegalArgumentException(\"Invalid Agent Version status: \" + status);\n        }\n    }\n    \n    public String getStatus() {\n        return status;\n    }\n    \n    public void setStatus(String status) {\n        this.status = status;\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":55,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/form/agent/admin/AgentVersionListForm.java#L25-L55","documentation":"Thrown by AgentValidationUtils.validateContentDigest when contentDigest is null or does not match 'sha256:' followed by exactly 64 lowercase hex digits (pattern sha256:[0-9a-f]{64}). Only lowercase hex is accepted; uppercase, a missing 'sha256:' prefix, a wrong hash length, or a different algorithm all fail.","triggerScenarios":"Publishing a Version result (RadModelValidator line 283) or a revision (line 471) with a digest that is null, uses uppercase hex, a different prefix ('sha256:'), or a non-64-hex body. Common when computing a digest with a different algorithm or hex-casing.","commonSituations":"Hashing with SHA-512 or MD5 instead of SHA-256; uppercase hex output from a formatter; truncating or padding the hex string; forgetting to prefix with 'sha256:'.","solutions":["Compute SHA-256 and format as lowercase hex with a 'sha256:' prefix (69 chars total).","Use the same digest routine the server uses when materializing a Version.","Verify length is exactly 64 hex chars after the prefix and lowercase."],"exampleFix":"// before\nresult.setContentDigest(\"SHA256:\" + Hex.upper(sha256));\n// after\nresult.setContentDigest(\"sha256:\" + Hex.lower(sha256));","handlingStrategy":"validation","validationCode":"if (contentDigest == null\n        || !contentDigest.matches(\"^sha256:[0-9a-f]{64}$\")) {\n    throw new IllegalArgumentException(\"Invalid contentDigest\");\n}","typeGuard":"static boolean isValidContentDigest(String s) {\n    return s != null && s.matches(\"^sha256:[0-9a-f]{64}$\");\n}","tryCatchPattern":"try {\n    AgentValidationUtils.validateContentDigest(digest);\n} catch (IllegalArgumentException e) {\n    // return 400, field 'contentDigest'\n}","preventionTips":["Always SHA-256, lowercase hex, with the 'sha256:' prefix.","Reuse the server's digest routine when materializing a Version."],"tags":["ai-agent","validation","content-digest","fingerprint","illegal-argument"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}