{"record":{"id":"830c258ca8dcc571","repo":"multica-ai/multica","slug":"custom-env-file-q-empty-contents-pass-to","errorCode":null,"errorMessage":"--custom-env-file %q: empty contents; pass '{}' to clear","messagePattern":"--custom-env-file %q: empty contents; pass '(.+?)' to clear","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1290,"sourceCode":"\t\t\treturn nil, false, fmt.Errorf(\"read --custom-env-stdin: %w\", err)\n\t\t}\n\t\traw = string(buf)\n\t\tif strings.TrimSpace(raw) == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-stdin: empty input; pass '{}' to clear\")\n\t\t}\n\tcase fromFile:\n\t\tif filePath == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-file: path must not be empty\")\n\t\t}\n\t\tbuf, err := os.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\t// Filesystem errors may include the path but not the contents —\n\t\t\t// safe to surface via %w.\n\t\t\treturn nil, false, fmt.Errorf(\"read --custom-env-file: %w\", err)\n\t\t}\n\t\traw = string(buf)\n\t\tif strings.TrimSpace(raw) == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-file %q: empty contents; pass '{}' to clear\", filePath)\n\t\t}\n\t}\n\n\tce, err := parseCustomEnv(raw)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\treturn ce, true, nil\n}\n\n// parseMcpConfig validates the --mcp-config value and returns the raw JSON to\n// send. It accepts a JSON object (the MCP config, e.g. {\"mcpServers\": {…}}) or\n// the literal `null` to clear the agent's config.\nfunc parseMcpConfig(raw string) (json.RawMessage, error) {\n\treturn parseMcpJSONObject(\"--mcp-config\", raw, true)\n}\n\n// parseMcpJSONObject validates a JSON-object payload supplied through one of","sourceCodeStart":1272,"sourceCodeEnd":1308,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1272-L1308","documentation":"Error \"--custom-env-file %q: empty contents; pass '{}' to clear\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_agent.go:1290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The file is empty; add JSON content or pass '{}' to clear."],"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-15T22:17:37.221Z"}