{"record":{"id":"84e452bfc1bbddfe","repo":"multica-ai/multica","slug":"create-property-w","errorCode":null,"errorMessage":"create property: %w","messagePattern":"create property: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":333,"sourceCode":"\tdescription, _ := cmd.Flags().GetString(\"description\")\n\ticon, _ := cmd.Flags().GetString(\"icon\")\n\toptionFlags, _ := cmd.Flags().GetStringArray(\"option\")\n\n\tbody := map[string]any{\"name\": name, \"type\": propType, \"description\": description, \"icon\": icon}\n\tif len(optionFlags) > 0 {\n\t\tbody[\"config\"] = map[string]any{\"options\": parseOptionFlags(optionFlags, nil)}\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\tvar created propertyDTO\n\tif err := client.PostJSON(ctx, \"/api/properties\", body, &created); err != nil {\n\t\treturn fmt.Errorf(\"create property: %w\", err)\n\t}\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, created)\n\t}\n\tfmt.Fprintf(os.Stdout, \"Property %q created.\\n\", created.Name)\n\tprintPropertyTable([]propertyDTO{created})\n\treturn nil\n}\n\nfunc runPropertyUpdate(cmd *cobra.Command, args []string) error {\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","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L315-L351","documentation":"Returned by the `multica property create` CLI command when its POST to `/api/properties` fails. The underlying error is wrapped with %w, so the message includes the HTTP layer's detail (connection refused, 4xx/5xx body, auth failure). This is a transport/server-side failure, not local validation.","triggerScenarios":"Running `multica property create --name X ...` when the multica server is unreachable, the API token is invalid/expired (401), the request body is rejected by the server (400, e.g. duplicate property name or invalid type), or the server returns 5xx.","commonSituations":"Server not running or wrong `--api-url`/base URL configured; expired CLI token; creating a property with a name that already exists server-side; sending a property `type` the server rejects.","solutions":["Verify the server is up and the CLI points at it (check the configured API URL with `multica` config/flags), e.g. hit `/api/health` or run `multica property list`.","Read the wrapped error text: a 401/403 means re-authenticate the CLI; a 400 means fix the payload (name uniqueness, valid `type`, well-formed `--option` flags).","If the error is a connection failure, start the server or fix the URL/token, then re-run the same create command.","For scripted use, capture the error and inspect `errors.Unwrap` / the status code before retrying."],"exampleFix":"// before\nmultica property create --name \"Priority\" --type select --option \"P0\"\n// fails: create property: request failed: 401 unauthorized\n\n// after\nmultica auth login   # or set correct --api-url / token\nmultica property create --name \"Priority\" --type select --option \"P0\"","handlingStrategy":"try-catch","validationCode":"# bash: verify server reachability and auth before creating\nmultica property list >/dev/null 2>&1 || { echo \"CLI/server not ready\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"if err := runPropertyCreate(cmd, args); err != nil {\n    var httpErr *cli.HTTPError // if the API client exposes a typed error\n    if errors.As(err, &httpErr) && httpErr.StatusCode == 401 {\n        // re-authenticate and retry once\n    }\n    return fmt.Errorf(\"create property: %w\", err)\n}","preventionTips":["Smoke-test the CLI target (`multica property list`) before running create commands in scripts.","Keep the API token fresh; wrap long-running automation with an auth check.","Treat wrapped errors as structured: unwrap to the status code before deciding to retry."],"tags":["go","cli","api","network","property"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}