{"record":{"id":"fba7954bf36ff6ac","repo":"conductor-oss/conductor","slug":"file-path-is-required","errorCode":null,"errorMessage":"File path is required","messagePattern":"File path is required","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":263,"sourceCode":"                                () ->\n                                        new IllegalArgumentException(\n                                                \"Skill not found: \"\n                                                        + name\n                                                        + \"@\"\n                                                        + resolvedVersion));\n        return detail;\n    }\n\n    public byte[] packageBytes(String name, String version) {\n        requireSkillStorage();\n        SkillDetail detail = get(name, version);\n        return packageBytes(detail);\n    }\n\n    public SkillFileContent readFile(String name, String version, String path) {\n        requireSkillStorage();\n        if (path == null || path.isBlank()) {\n            throw new IllegalArgumentException(\"File path is required\");\n        }\n        String cleanPath = normalizeEntryName(path);\n        SkillDetail detail = get(name, version);\n        byte[] packageBytes = packageBytes(detail);\n        try (ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(packageBytes))) {\n            ZipEntry entry;\n            while ((entry = zip.getNextEntry()) != null) {\n                if (entry.isDirectory()) {\n                    continue;\n                }\n                String entryName = normalizeEntryName(entry.getName());\n                if (!entryName.equals(cleanPath)) {\n                    continue;\n                }\n                if (entry.getSize() > maxPreviewBytes) {\n                    throw new IllegalArgumentException(\n                            \"Skill file is too large to preview: \" + cleanPath);\n                }","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L245-L281","documentation":"Thrown by readFile() when the path argument is null or blank. The path query parameter is required to identify which file inside the skill's zip package to return. This is a simple precondition check before any storage or zip access occurs.","triggerScenarios":"GET /api/skills/{name}/versions/{version}/files with no path query param, or path=  (empty), or path=%20. Also when a programmatic caller passes null directly to SkillRegistryService.readFile.","commonSituations":"Frontend that builds the URL but omits path when no row is selected; a client SDK that sends an empty string default; URL encoding stripping the value.","solutions":["Supply a non-empty path query param: GET /api/skills/foo/versions/1.0.0/files?path=SKILL.md.","Validate on the client that path is non-blank before issuing the request.","Use the skill detail's files list to pick a valid path first."],"exampleFix":"// before\nGET /api/skills/foo/versions/1.0.0/files\n// after\nGET /api/skills/foo/versions/1.0.0/files?path=SKILL.md","handlingStrategy":"validation","validationCode":"// Client-side before calling readFile\nif (path == null || path.isBlank()) {\n    throw new IllegalArgumentException(\"path required\");\n}\nskillRegistryService.readFile(name, version, path);","typeGuard":"static boolean isValidFilePath(String path) {\n    return path != null && !path.isBlank() && !path.startsWith(\"/\") && !path.contains(\"\\0\");\n}","tryCatchPattern":null,"preventionTips":["Always pass a concrete file path sourced from the skill detail's files[] list.","Treat a missing path as a programming error on the caller side, not a retryable condition."],"tags":["java","conductor","skill-registry","validation","rest-api"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}