multica-ai/multica · error

%s: empty input; pass 'null' to clear or a JSON object to se

Error message

%s: empty input; pass 'null' to clear or a JSON object to set

What it means

Error "%s: empty input; pass 'null' to clear or a JSON object to set" thrown in multica-ai/multica.

Source

Thrown at server/cmd/multica/cmd_agent.go:1327

// the secret-safe flag channels. A top-level array or primitive is rejected
// because it can never be a valid MCP payload — this mirrors the agent-settings
// UI (mcp-config-tab.tsx). Empty/whitespace input is rejected rather than
// treated as a clear: for the stdin/file channels it almost always signals an
// upstream failure (missing file, unset pipe) rather than a deliberate clear,
// and silently wiping a secret-bearing field is the wrong default.
//
// allowNull controls whether the literal `null` is accepted as the clear
// sentinel. It is not for a single server entry, where removing something has
// its own command and `null` is far more likely to be a mistake.
//
// The payload is treated as secret material (MCP entries routinely carry API
// tokens), so parse errors never wrap the underlying json error, which can
// echo short fragments of malformed input.
func parseMcpJSONObject(flag, raw string, allowNull bool) (json.RawMessage, error) {
	trimmed := strings.TrimSpace(raw)
	if trimmed == "" {
		if allowNull {
			return nil, fmt.Errorf("%s: empty input; pass 'null' to clear or a JSON object to set", flag)
		}
		return nil, fmt.Errorf("%s: empty input; pass a JSON object", flag)
	}
	var probe any
	if err := json.Unmarshal([]byte(trimmed), &probe); err != nil {
		if allowNull {
			return nil, fmt.Errorf("%s must be a valid JSON object, or 'null' to clear", flag)
		}
		return nil, fmt.Errorf("%s must be a valid JSON object", flag)
	}
	if probe == nil {
		if allowNull {
			// null → clear (NULL column server-side; on create it is a no-op).
			return json.RawMessage("null"), nil
		}
		return nil, fmt.Errorf("%s must be a JSON object, not null", flag)
	}
	if _, ok := probe.(map[string]any); !ok {

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Provide non-empty input: a JSON object to set or 'null' to clear.

When it happens

Trigger: Thrown at server/cmd/multica/cmd_agent.go:1327 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/bb25758068575f1e. Report an issue: GitHub.