{"record":{"id":"085d71e1d456f77f","repo":"conductor-oss/conductor","slug":"failed-to-read-skill-file-e-getmessage","errorCode":null,"errorMessage":"Failed to read skill file: {e.getMessage()}","messagePattern":"Failed to read skill file: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":299,"sourceCode":"                }\n                byte[] data =\n                        readBounded(\n                                zip,\n                                maxPreviewBytes,\n                                \"Skill file is too large to preview: \" + cleanPath);\n                boolean binary = isBinary(cleanPath, data);\n                return SkillFileContent.builder()\n                        .path(cleanPath)\n                        .contentType(contentType(cleanPath))\n                        .size(data.length)\n                        .binary(binary)\n                        .content(binary ? null : new String(data, StandardCharsets.UTF_8))\n                        .contentBase64(binary ? Base64.getEncoder().encodeToString(data) : null)\n                        .build();\n            }\n            throw new IllegalArgumentException(\"Skill file not found: \" + cleanPath);\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Failed to read skill file: \" + e.getMessage(), e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    public Map<String, Object> resolveRawConfig(Map<String, Object> skillRef) {\n        requireSkillStorage();\n        if (skillRef == null) {\n            throw new IllegalArgumentException(\"skillRef is required\");\n        }\n        String name = requiredString(skillRef, \"name\");\n        String version = stringValue(skillRef.get(\"version\"));\n        SkillDetail detail = get(name, version);\n        Map<String, Object> rawConfig = rawConfigForDetail(detail, new HashSet<>());\n        Object model = skillRef.get(\"model\");\n        if (model instanceof String s && !s.isBlank()) {\n            rawConfig.put(\"model\", s);\n        }\n        Object agentModels = skillRef.get(\"agentModels\");","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L281-L317","documentation":"Thrown by readFile() as an IllegalStateException when an IOException occurs while streaming the skill's zip package. Unlike the IllegalArgumentExceptions around it, this indicates an unexpected I/O failure (e.g. corrupt or truncated zip data read back from the package store, stream closed mid-read) rather than a caller input mistake. The original IOException is attached as the cause.","triggerScenarios":"GET /api/skills/{name}/versions/{version}/files?path=SKILL.md when the stored package bytes are corrupt or partially written, or when the underlying packageStore.read() returns truncated data that breaks ZipInputStream.","commonSituations":"Package store corruption after an interrupted write; a backend restart mid-store; filesystem or object-storage returning partial bytes; a zip that was never validly closed at upload time.","solutions":["Re-register the skill package so a fresh, intact zip is stored (DELETE then POST /register, or POST with the same checksum to restore).","Check the package store / storage backend health and the stored handle's integrity.","Inspect the caused-by IOException message for the specific read failure location."],"exampleFix":"// no code fix — recover by re-uploading the package\nDELETE /api/skills/foo/versions/1.0.0\nPOST /api/skills/register  (manifest + fresh package zip)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return skillRegistryService.readFile(name, version, path); }\ncatch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Failed to read skill file\")) {\n        // package storage corrupt: re-register the package, then retry\n        log.error(\"skill file read failed; package may be corrupt\", e);\n    }\n    throw e;\n}","preventionTips":["Monitor package store health and free space to avoid truncated writes.","Re-register packages that fail to read so a known-good copy is stored."],"tags":["java","conductor","skill-registry","io","zip","runtime-error"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}