{"record":{"id":"a047dcfed7401d6d","repo":"multica-ai/multica","slug":"on-conflict-must-be-one-of-fail-overwrite-ren","errorCode":null,"errorMessage":"--on-conflict must be one of: fail, overwrite, rename, skip","messagePattern":"--on-conflict must be one of: fail, overwrite, rename, skip","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":466,"sourceCode":"}\n\nfunc runSkillImport(cmd *cobra.Command, _ []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\timportURL, _ := cmd.Flags().GetString(\"url\")\n\timportFile, _ := cmd.Flags().GetString(\"file\")\n\tswitch {\n\tcase importURL == \"\" && importFile == \"\":\n\t\treturn fmt.Errorf(\"either --url or --file is required\")\n\tcase importURL != \"\" && importFile != \"\":\n\t\treturn fmt.Errorf(\"--url and --file are mutually exclusive\")\n\t}\n\tonConflict, _ := cmd.Flags().GetString(\"on-conflict\")\n\tif !validSkillImportConflictStrategy(onConflict) {\n\t\treturn fmt.Errorf(\"--on-conflict must be one of: fail, overwrite, rename, skip\")\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(60*time.Second))\n\tdefer cancel()\n\n\tvar result map[string]any\n\tif importFile != \"\" {\n\t\tfileData, readErr := os.ReadFile(importFile)\n\t\tif readErr != nil {\n\t\t\treturn fmt.Errorf(\"read skill archive: %w\", readErr)\n\t\t}\n\t\tif err := client.ImportSkillFile(ctx, fileData, filepath.Base(importFile), onConflict, &result); err != nil {\n\t\t\tif handledErr := handleSkillImportError(cmd, err); handledErr != nil {\n\t\t\t\treturn handledErr\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"import skill: %w\", err)\n\t\t}\n\t\treturn printSkillImportResult(cmd, result)","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L448-L484","documentation":"Client-side validation in `multica skill import`: the `--on-conflict` flag (strategy for when an imported skill name already exists) must be one of the enumerated values `fail`, `overwrite`, `rename`, `skip`, and the provided string matched none. The check is a simple Go switch over the literal values, so any typo, casing change, or abbreviation fails.","triggerScenarios":"Passing `--on-conflict error`, `--on-conflict FAIL`, `--on-conflict replace`, or an empty value from an unset script variable; assuming a strategy name from a different tool's vocabulary.","commonSituations":"Unset env var in CI expanding to empty string; using a synonym like `replace`/`ignore` instead of `overwrite`/`skip`; upgrading from an older CLI whose accepted set differed.","solutions":["Use one of the four literal values exactly: fail, overwrite, rename, or skip.","If the value comes from a variable, default it in the script: `ON_CONFLICT=${ON_CONFLICT:-fail}`.","Note values are case-sensitive lowercase — `FAIL` is rejected."],"exampleFix":"# before\nmultica skill import --file s.zip --on-conflict replace\n\n# after\nmultica skill import --file s.zip --on-conflict overwrite","handlingStrategy":"validation","validationCode":"case \"${ON_CONFLICT:-fail}\" in fail|overwrite|rename|skip) ;; *) echo \"invalid ON_CONFLICT: $ON_CONFLICT\"; exit 1 ;; esac\nmultica skill import --file s.zip --on-conflict \"${ON_CONFLICT:-fail}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default the variable in scripts; never pass it through unset.","Remember the exact vocabulary: fail, overwrite, rename, skip — lowercase only.","When upgrading the CLI, re-check the accepted set in --help."],"tags":["cli","validation","enum","flags"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}