{"record":{"id":"5be89b04e0d444f6","repo":"multica-ai/multica","slug":"subscriber-cannot-be-empty","errorCode":null,"errorMessage":"--subscriber cannot be empty","messagePattern":"--subscriber cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_autopilot.go","lineNumber":747,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve trigger: %w\", err)\n\t}\n\n\tpath := \"/api/autopilots/\" + autopilotRef.ID + \"/triggers/\" + triggerRef.ID\n\tif err := client.DeleteJSON(ctx, path); err != nil {\n\t\treturn fmt.Errorf(\"delete trigger: %w\", err)\n\t}\n\tfmt.Printf(\"Trigger %s deleted.\\n\", triggerRef.ID)\n\treturn nil\n}\n\nfunc resolveAutopilotSubscriberInputs(ctx context.Context, client *cli.APIClient, refs []string) ([]map[string]string, error) {\n\tinputs := make([]map[string]string, 0, len(refs))\n\tseen := map[string]struct{}{}\n\tmemberOnly := assigneeKinds{member: true}\n\tfor _, ref := range refs {\n\t\tif strings.TrimSpace(ref) == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"--subscriber cannot be empty\")\n\t\t}\n\t\tuserType, userID, err := resolveAssignee(ctx, client, ref, memberOnly)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"resolve subscriber %q: %w\", ref, err)\n\t\t}\n\t\tif userType != \"member\" {\n\t\t\treturn nil, fmt.Errorf(\"subscriber %q resolved to %s; autopilot subscribers must be members\", ref, userType)\n\t\t}\n\t\tif _, ok := seen[userID]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tseen[userID] = struct{}{}\n\t\tinputs = append(inputs, map[string]string{\n\t\t\t\"user_type\": \"member\",\n\t\t\t\"user_id\":   userID,\n\t\t})\n\t}\n\treturn inputs, nil","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_autopilot.go#L729-L765","documentation":"Thrown by resolveAutopilotSubscriberInputs when a --subscriber flag value is empty or only whitespace. The autopilot trigger-create command validates each subscriber reference up front before calling resolveAssignee, so an empty string never reaches the API. This is pure client-side argument validation in the multica CLI.","triggerScenarios":"Running `multica autopilot trigger create --subscriber \"\"` or passing a subscriber list where one element is blank (e.g. repeated flags like `--subscriber alice --subscriber \"\"`, or shell expansion producing an empty variable like $EMPTY_USER).","commonSituations":"Shell scripts passing unset environment variables as subscriber refs; copy-pasting command templates with placeholder values; trailing commas in a loop that feeds empty strings.","solutions":["Remove the empty --subscriber argument or fix the shell variable that expanded to empty (check with `echo \"[$SUB]\"`).","If scripting, guard each ref: skip or fail with context before invoking the CLI.","Re-run with only non-empty subscriber references."],"exampleFix":"# before\nmultica autopilot trigger create --name t1 --subscriber \"$SUB\"\n# after\nmultica autopilot trigger create --name t1 --subscriber \"${SUB:?SUB must be set}\"","handlingStrategy":"validation","validationCode":"# shell: fail fast on empty subscriber refs before calling the CLI\nfor sub in \"${SUBS[@]}\"; do\n  [ -n \"$(printf '%s' \"$sub\" | tr -d '[:space:]')\" ] || { echo \"empty subscriber ref\" >&2; exit 2; }\ndone\nmultica autopilot trigger create --name t1 \"${SUBS[@]/#/--subscriber }\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote every --subscriber value and expand unset variables with ${VAR:?msg} so an empty string aborts before the CLI runs.","In scripts, filter refs through a non-empty check in a preflight loop."],"tags":["cli","validation","autopilot","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}