{"record":{"id":"3725a0cf3c8e6015","repo":"alibaba/nacos","slug":"resource-not-found-3725a0","errorCode":"RESOURCE_NOT_FOUND","errorMessage":"{type} version not found: {name}@{version}","messagePattern":"(.+?) version not found: (.+?)@(.+?)","errorType":"exception","errorClass":"NacosApiException","httpStatus":404,"severity":"error","filePath":"ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java","lineNumber":962,"sourceCode":"    public AiResourceVersion doPublish(String namespaceId, String name, String type, String version,\n        boolean updateLatestLabel) throws NacosException {\n        return doPublish(namespaceId, name, type, version, true,\n            VisibilityHelper.resolveCurrentIdentity(), VisibilityHelper.resolveClientIp());\n    }\n    \n    private AiResourceVersion doPublish(String namespaceId, String name, String type,\n        String version, boolean checkVisibility, String operator, String clientIp)\n        throws NacosException {\n        AiResource meta = requireMeta(namespaceId, name, type);\n        if (checkVisibility) {\n            VisibilityHelper.checkWritableResource(meta);\n        }\n        ResourceVersionInfo info = requireVersionInfo(meta);\n        \n        AiResourceVersion v =\n            aiResourceVersionPersistService.find(namespaceId, name, type, version);\n        if (v == null) {\n            throw new NacosApiException(NacosException.NOT_FOUND, ErrorCode.RESOURCE_NOT_FOUND,\n                type + \" version not found: \" + name + \"@\" + version);\n        }\n        if (!AiResourceConstants.VERSION_STATUS_REVIEWING.equalsIgnoreCase(v.getStatus())\n            && !AiResourceConstants.VERSION_STATUS_REVIEWED.equalsIgnoreCase(v.getStatus())\n            && !AiResourceConstants.VERSION_STATUS_ONLINE.equalsIgnoreCase(v.getStatus())) {\n            throw new NacosApiException(NacosException.INVALID_PARAM,\n                ErrorCode.PARAMETER_VALIDATE_ERROR,\n                \"Only reviewing version can be published: \" + version);\n        }\n        \n        PublishPipelineInfo pipelineInfo = parsePublishPipelineInfo(v.getPublishPipelineInfo());\n        if (pipelineInfo != null && StringUtils.isNotBlank(pipelineInfo.getExecutionId())) {\n            PipelineExecution execution =\n                pipelineExecutionRepository.findById(pipelineInfo.getExecutionId());\n            if (execution == null) {\n                throw new NacosApiException(NacosException.INVALID_PARAM,\n                    ErrorCode.PARAMETER_VALIDATE_ERROR,\n                    \"Pipeline execution not found, cannot publish: \" + version);","sourceCodeStart":944,"sourceCodeEnd":980,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai/src/main/java/com/alibaba/nacos/ai/service/resource/AiResourceManager.java#L944-L980","documentation":"Thrown inside doPublish when the version row to publish cannot be found by persistService.find. Maps to RESOURCE_NOT_FOUND (NOT_FOUND). The publish target version must exist before its status and pipeline can be validated.","triggerScenarios":"Publish API called with a version identifier that does not exist for the resource — wrong name, deleted version, or namespace/type mismatch.","commonSituations":"Publishing a version name from a different resource; version hard-deleted between submit and publish; client-side stale reference.","solutions":["Confirm the version exists via a list/get before invoking publish.","Correct the version identifier to the actual reviewing/reviewed version.","Check that namespace, name, and type all match the resource that owns the version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"AiResourceVersion v = aiResourceVersionPersistService.find(ns, name, type, version);\nif (v == null) { return notFound(version); }","typeGuard":null,"tryCatchPattern":"try {\n    return manager.doPublish(ns, name, type, version, ...);\n} catch (NacosApiException e) {\n    if (e.getErrCode() == NacosException.NOT_FOUND) { /* re-list versions */ }\n    else { throw e; }\n}","preventionTips":["Confirm the reviewing/reviewed version exists before publish.","Carry the version identifier returned by the submit flow into publish."],"tags":["ai-registry","version-lifecycle","publish","not-found"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}