{"record":{"id":"9da0b288c84d7e4d","repo":"multica-ai/multica","slug":"value-is-required-9da0b2","errorCode":null,"errorMessage":"--value is required","messagePattern":"--value is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_issue_metadata.go","lineNumber":257,"sourceCode":"\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, value)\n\t}\n\theaders := []string{\"KEY\", \"VALUE\", \"TYPE\"}\n\trows := [][]string{{key, formatMetadataValue(value), metadataValueType(value)}}\n\tcli.PrintTable(os.Stdout, headers, rows)\n\treturn nil\n}\n\nfunc runIssueMetadataSet(cmd *cobra.Command, args []string) error {\n\tkey, _ := cmd.Flags().GetString(\"key\")\n\tif key == \"\" {\n\t\treturn fmt.Errorf(\"--key is required\")\n\t}\n\tif !cmd.Flags().Changed(\"value\") {\n\t\treturn fmt.Errorf(\"--value is required\")\n\t}\n\trawValue, _ := cmd.Flags().GetString(\"value\")\n\tforcedType, _ := cmd.Flags().GetString(\"type\")\n\tvalue, err := parseMetadataValue(rawValue, forcedType)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tissueRef, err := resolveIssueRef(ctx, client, args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"resolve issue: %w\", err)","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue_metadata.go#L239-L275","documentation":"Thrown by `multica issue metadata set` when the --value flag was never passed on the command line. The code uses cmd.Flags().Changed(\"value\") rather than comparing the string, so an explicitly empty `--value \"\"` IS accepted — the error only fires when the flag is absent entirely.","triggerScenarios":"Running the command with --key but no --value at all. Note `--value \"\"` (explicitly empty) passes this check; omitting the flag does not.","commonSituations":"Scripts building flags conditionally where the value branch is skipped, users expecting the CLI to prompt for a missing value, or a copied command line with the value truncated.","solutions":["Always pass --value, even when storing an empty string: `--value \"\"` is valid and distinct from omitting the flag","In scripts, verify the flag presence (`[[ $# --value present ]]`) before calling the command"],"exampleFix":"# before\nmultica issue metadata set MUL-1 --key priority\n# after (set to empty string explicitly)\nmultica issue metadata set MUL-1 --key priority --value \"\"","handlingStrategy":"validation","validationCode":"# distinguish 'flag absent' from 'empty value' in wrappers\nif ! grep -q -- '--value' <<< \"$*\"; then echo \"--value is required\" >&2; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember Changed(\"value\") semantics: --value \"\" is legal, omitting the flag is not","Build command lines with explicit flag arrays so --value is always present"],"tags":["cli","flag-validation","metadata"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}