{"record":{"id":"17212c0427439491","repo":"alibaba/nacos","slug":"data-access-error-17212c","errorCode":"DATA_ACCESS_ERROR","errorMessage":"Failed to create ARD Skill artifact","messagePattern":"Failed to create ARD Skill artifact","errorType":"exception","errorClass":"NacosApiException","httpStatus":500,"severity":"error","filePath":"ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/ard/ArdArtifactService.java","lineNumber":105,"sourceCode":"        if (AiResourceConstants.RESOURCE_TYPE_MCP.equals(resourceType)) {\n            McpServerDetailInfo detail = mcpServerOperationService.getMcpServerDetail(namespaceId,\n                resourceName, mcpName, version);\n            return new ArdArtifact(ArdProtocolConstants.MEDIA_TYPE_MCP, detail);\n        }\n        throw new NacosApiException(NacosException.INVALID_PARAM,\n            ErrorCode.PARAMETER_VALIDATE_ERROR,\n            \"Unsupported ARD artifact resourceType: \" + resourceType);\n    }\n    \n    private ArdArtifact skillArtifact(String namespaceId, String resourceName, String version)\n        throws NacosException {\n        SkillQueryResult result =\n            skillClientOperationService.querySkill(namespaceId, resourceName, version, null, null);\n        try {\n            return new ArdArtifact(ArdProtocolConstants.MEDIA_TYPE_SKILL_PACKAGE,\n                SkillUtils.toZipBytes(result.getSkill()));\n        } catch (Exception e) {\n            throw new NacosApiException(NacosException.SERVER_ERROR,\n                ErrorCode.DATA_ACCESS_ERROR, e, \"Failed to create ARD Skill artifact\");\n        }\n    }\n    \n    private ArdArtifact promptArtifact(String namespaceId, String resourceType,\n        String resourceName, String version) throws NacosException {\n        AiResourceVersion resourceVersion =\n            readableOnlineVersion(namespaceId, resourceType, resourceName, version);\n        byte[] bytes = readResourceFile(resourceVersion, namespaceId, resourceType, resourceName,\n            version, PromptUtils.PROMPT_MAIN_DATA_ID);\n        PromptVersionInfo prompt = JacksonUtils.toObj(new String(bytes, StandardCharsets.UTF_8),\n            PromptVersionInfo.class);\n        return new ArdArtifact(ArdProtocolConstants.MEDIA_TYPE_PROMPT, prompt);\n    }\n    \n    private AiResourceVersion readableOnlineVersion(String namespaceId, String resourceType,\n        String resourceName, String version) throws NacosException {\n        AiResource meta = resourceManager.findMeta(namespaceId, resourceName, resourceType);","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/ai-registry-adaptor/src/main/java/com/alibaba/nacos/airegistry/service/ard/ArdArtifactService.java#L87-L123","documentation":"Thrown when packaging a Skill into a ZIP artifact fails. skillArtifact() first queries the skill, then calls SkillUtils.toZipBytes(result.getSkill()) inside a try/catch. Any Exception (typically IOException from ZIP serialization or a malformed skill model) is wrapped as DATA_ACCESS_ERROR with HTTP 500. This is a server-side processing failure, not a client input error.","triggerScenarios":"Requesting an ARD artifact for a skill whose underlying Skill object cannot be serialized to a ZIP (e.g., a skill with missing required artifact files, a null/binary-incompatible skill model, or a filesystem/encoding error during zip construction). The skill must already exist (querySkill succeeded) but its content is malformed.","commonSituations":"A skill was registered with incomplete or corrupted artifact data; a version upgrade changed the Skill model shape so toZipBytes hits a null field; transient I/O pressure on the server during ZIP streaming; a skill published through a buggy importer.","solutions":["Check the server logs for the wrapped cause (the original Exception is attached) to identify the serialization failure.","Re-publish or repair the skill whose resourceName@version triggered the error, ensuring all required skill files are present.","Verify the skill model version matches the SkillUtils.toZipBytes implementation (no client/server model skew).","If transient I/O, retry the artifact request once."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ArdArtifact artifact = ardArtifactService.get(ns, \"skill\", name, version, null);\n} catch (NacosApiException e) {\n    if (ErrorCode.DATA_ACCESS_ERROR.equals(e.getErrorCode())) {\n        log.error(\"Skill artifact packaging failed for {}@{}\", name, version, e);\n        // surface a retry or re-publish guidance to the operator\n    } else {\n        throw e;\n    }\n}","preventionTips":["Publish skills through the validated publisher API so required artifact files are always present.","Monitor server logs for the wrapped cause to catch model skew early.","Add a health check that packages one skill per version to detect serialization regressions."],"tags":["ard","ai-registry","skill","data-access","server-error"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}