{"record":{"id":"54b17dbc282d6a21","repo":"conductor-oss/conductor","slug":"invalid-skill-package-zip-e-getmessage","errorCode":null,"errorMessage":"Invalid skill package zip: {e.getMessage()}","messagePattern":"Invalid skill package zip: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":478,"sourceCode":"                        throw new IllegalArgumentException(\n                                \"Skill package exceeds max uncompressed size of \"\n                                        + maxUncompressedBytes\n                                        + \" bytes\");\n                    }\n                }\n                contentByPath.put(path, content.toByteArray());\n                files.add(\n                        SkillFileEntry.builder()\n                                .path(path)\n                                .size(size)\n                                .sha256(hex(digest.digest()))\n                                .contentType(contentType(path))\n                                .build());\n            }\n        } catch (IllegalArgumentException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\"Invalid skill package zip: \" + e.getMessage(), e);\n        }\n\n        byte[] skillMdBytes = contentByPath.get(\"SKILL.md\");\n        if (skillMdBytes == null) {\n            throw new IllegalArgumentException(\"Skill package is missing SKILL.md\");\n        }\n        files.sort(Comparator.comparing(SkillFileEntry::getPath));\n\n        String skillMd = decodeUtf8(\"SKILL.md\", skillMdBytes);\n        Map<String, Object> frontmatter = parseSkillFrontmatter(skillMd);\n        String name = requiredString(frontmatter, \"name\");\n        validateSkillName(name);\n        String description = stringValue(frontmatter.get(\"description\"));\n        if (description == null || description.isBlank()) {\n            description = stringValue(manifest.get(\"description\"));\n        }\n\n        Map<String, String> agentFiles = new LinkedHashMap<>();","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L460-L496","documentation":"Thrown by parseSkillPackage as a catch-all IllegalArgumentException for any non-IllegalArgumentException Exception raised during zip streaming — most commonly java.util.zip.ZipException when the package is not a valid zip or is truncated. The original exception is attached as the cause. IllegalArgumentExceptions thrown inside the loop are re-thrown unchanged (the catch (IllegalArgumentException e) rethrows them).","triggerScenarios":"POST /api/skills/register where the 'package' part is not a zip at all (e.g. a tar, a raw file, an HTML error page), or a zip that is truncated/corrupt so ZipInputStream.getNextEntry() fails.","commonSituations":"Client uploading the wrong file type; a download/CI step that produced a partial zip; double-compression or a content-encoding mismatch corrupting the bytes; an upstream proxy rewriting the body.","solutions":["Verify the uploaded file is a valid zip locally: unzip -t skill.zip.","Re-export the zip from source and re-upload.","Inspect the caused-by exception (ZipException message) for the structural failure point."],"exampleFix":"# before: uploading a .tar.gz as the package\ncurl -F 'package=@skill.tar.gz' ...\n# after: upload a real zip\ncurl -F 'package=@skill.zip' ...","handlingStrategy":"validation","validationCode":"// Before uploading, verify the package is a structurally valid zip\ntry (var z = new ZipFile(packageFile)) { z.stream().count(); } // throws ZipException if invalid\n","typeGuard":"static boolean isValidZip(java.io.File f) {\n    try (var z = new ZipFile(f)) { z.stream().count(); return true; }\n    catch (java.io.IOException e) { return false; }\n}","tryCatchPattern":"try { skillRegistryService.register(manifest, pkg); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid skill package zip\")) { /* re-export a valid zip, retry */ }\n    else throw e;\n}","preventionTips":["Validate the zip with unzip -t or a ZipFile open before uploading.","Ensure the build step writes a properly closed, non-truncated zip."],"tags":["java","conductor","skill-registry","zip","package-integrity","validation"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}