{"record":{"id":"68a8edfc584cd60c","repo":"conductor-oss/conductor","slug":"invalid-skill-manifest-json-e-getmessage","errorCode":null,"errorMessage":"Invalid skill manifest JSON: {e.getMessage()}","messagePattern":"Invalid skill manifest JSON: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":407,"sourceCode":"                if (detail.getChecksum() != null && detail.getChecksum().startsWith(version)) {\n                    return detail.getVersion();\n                }\n            }\n            return version;\n        }\n        return metadataDao\n                .latestVersion(name)\n                .orElseThrow(() -> new IllegalArgumentException(\"Skill not found: \" + name));\n    }\n\n    private Map<String, Object> parseManifest(String manifestJson) {\n        if (manifestJson == null || manifestJson.isBlank()) {\n            throw new IllegalArgumentException(\"Skill manifest is required\");\n        }\n        try {\n            return MAPPER.readValue(manifestJson, MAP_TYPE);\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\"Invalid skill manifest JSON: \" + e.getMessage(), e);\n        }\n    }\n\n    private byte[] readPackage(MultipartFile packageFile) {\n        try {\n            byte[] bytes = packageFile.getBytes();\n            if (bytes.length > maxPackageBytes) {\n                throw new IllegalArgumentException(\n                        \"Skill package exceeds max size of \" + maxPackageBytes + \" bytes\");\n            }\n            return bytes;\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\n                    \"Failed to read skill package: \" + e.getMessage(), e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L389-L425","documentation":"Thrown by register() (via parseManifest) when the manifest JSON cannot be parsed by Jackson — the manifest part was non-blank but not valid JSON (or not a JSON object/map). The original IOException from Jackson is attached as the cause.","triggerScenarios":"POST /api/skills/register with manifest='{name: foo}' (unquoted), manifest='[1,2,3]' (array, not object), or manifest containing a trailing comma / syntax error. Also a manifest sent as form-encoded key=value instead of raw JSON.","commonSituations":"Hand-writing manifest JSON without quoting keys; a templating layer producing malformed JSON; sending YAML or form data where raw JSON is expected; encoding issues (BOM, double-escaped quotes).","solutions":["Validate the manifest string with a JSON parser on the client before uploading.","Ensure the manifest is a JSON object (starts with { and ends with }), not an array or scalar.","Check the caused-by message for the exact Jackson parse location (line/column)."],"exampleFix":"// before\n{\"name\":\"foo\", \"version\":\"1.0.0\",}\n// after (remove trailing comma)\n{\"name\":\"foo\",\"version\":\"1.0.0\"}","handlingStrategy":"try-catch","validationCode":"// Validate JSON on the client before upload\ntry { new ObjectMapper().readValue(manifestJson, Map.class); }\ncatch (Exception e) { throw new IllegalArgumentException(\"manifest is not valid JSON: \" + e.getMessage()); }","typeGuard":"static boolean isValidManifestJson(String json) {\n    try { Object o = new ObjectMapper().readValue(json, Object.class); return o instanceof Map; }\n    catch (Exception e) { return false; }\n}","tryCatchPattern":"try { skillRegistryService.register(manifest, pkg); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid skill manifest JSON\")) { /* fix JSON, retry */ }\n    else throw e;\n}","preventionTips":["Build manifest JSON with a JSON library rather than string concatenation.","Run the manifest through a linter in CI before publishing."],"tags":["java","conductor","skill-registry","json","validation","multipart-upload"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}