{"record":{"id":"e1dafe3a8e6ff380","repo":"multica-ai/multica","slug":"s-must-be-a-json-object-not-null","errorCode":null,"errorMessage":"%s must be a JSON object, not null","messagePattern":"(.+?) must be a JSON object, not null","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1343,"sourceCode":"\tif trimmed == \"\" {\n\t\tif allowNull {\n\t\t\treturn nil, fmt.Errorf(\"%s: empty input; pass 'null' to clear or a JSON object to set\", flag)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s: empty input; pass a JSON object\", flag)\n\t}\n\tvar probe any\n\tif err := json.Unmarshal([]byte(trimmed), &probe); err != nil {\n\t\tif allowNull {\n\t\t\treturn nil, fmt.Errorf(\"%s must be a valid JSON object, or 'null' to clear\", flag)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s must be a valid JSON object\", flag)\n\t}\n\tif probe == nil {\n\t\tif allowNull {\n\t\t\t// null → clear (NULL column server-side; on create it is a no-op).\n\t\t\treturn json.RawMessage(\"null\"), nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s must be a JSON object, not null\", flag)\n\t}\n\tif _, ok := probe.(map[string]any); !ok {\n\t\tif allowNull {\n\t\t\treturn nil, fmt.Errorf(\"%s must be a JSON object, or 'null' to clear\", flag)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s must be a JSON object\", flag)\n\t}\n\treturn json.RawMessage(trimmed), nil\n}\n\n// resolveMcpConfig collects the --mcp-config, --mcp-config-stdin, and\n// --mcp-config-file flags and returns the raw JSON value to send, a bool\n// indicating whether the caller supplied any of them, and any error. Mirrors\n// resolveCustomEnv; the only behavioural difference is the clear sentinel\n// (`null` here vs `{}` for custom_env), because mcp_config distinguishes an\n// explicit empty object from an absent config server-side.\nfunc resolveMcpConfig(cmd *cobra.Command) (json.RawMessage, bool, error) {\n\treturn resolveMcpJSONObject(cmd, \"mcp-config\", true)","sourceCodeStart":1325,"sourceCodeEnd":1361,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1325-L1361","documentation":"Error \"%s must be a JSON object, not null\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_agent.go:1343 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a JSON object; null is not allowed here."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}