{"record":{"id":"3371d8e9384070e9","repo":"multica-ai/multica","slug":"archive-property-w","errorCode":null,"errorMessage":"archive property: %w","messagePattern":"archive property: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_property.go","lineNumber":415,"sourceCode":"\t\tclient, err := newAPIClient(cmd)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tctx, cancel := cli.APIContext(context.Background())\n\t\tdefer cancel()\n\n\t\tproperties, err := fetchProperties(ctx, client)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tproperty, err := resolvePropertyRef(properties, args[0])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar updated propertyDTO\n\t\tif err := client.PatchJSON(ctx, \"/api/properties/\"+property.ID, map[string]any{\"archived\": archive}, &updated); err != nil {\n\t\t\tif archive {\n\t\t\t\treturn fmt.Errorf(\"archive property: %w\", err)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unarchive property: %w\", err)\n\t\t}\n\t\toutput, _ := cmd.Flags().GetString(\"output\")\n\t\tif output == \"json\" {\n\t\t\treturn cli.PrintJSON(os.Stdout, updated)\n\t\t}\n\t\tif archive {\n\t\t\tfmt.Fprintf(os.Stdout, \"Property %q archived.\\n\", updated.Name)\n\t\t} else {\n\t\t\tfmt.Fprintf(os.Stdout, \"Property %q restored.\\n\", updated.Name)\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// issue property {list|set|unset}","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_property.go#L397-L433","documentation":"Returned by `multica property archive` when the PATCH sending `{\"archived\": true}` to `/api/properties/<id>` fails. The archive/unarchive closure (`makePropertyArchiveRun`) picks this message when `archive` is true; the wrapped error carries the real HTTP cause.","triggerScenarios":"Archiving a property the server refuses to archive (e.g. it is the last non-archived property, or a protected/system property), auth failure, or the server being unreachable.","commonSituations":"Archiving the last active property in a workspace; server-side business rules rejecting archival; expired token in long-running automation.","solutions":["Read the wrapped error body — a 400/422 indicates a server-side rule (e.g. cannot archive this property); adjust accordingly.","401/403 → refresh CLI credentials.","Network error → verify server URL and that the backend is running, then retry."],"exampleFix":"// before\nmultica property archive \"Priority\"\n// error: archive property: request failed: 422 ...\n\n// after\nmultica property archive \"Priority\"  # after resolving the server-side constraint reported in the wrapped message","handlingStrategy":"try-catch","validationCode":"# bash: confirm the property is currently unarchived before archiving\nmultica property list | grep -qw \"$PROP\" || echo \"note: $PROP may already be archived or missing\"","typeGuard":null,"tryCatchPattern":"if err := client.PatchJSON(ctx, path, map[string]any{\"archived\": true}, &updated); err != nil {\n    switch {\n    case isNotFound(err): // property gone; refresh refs\n    case isAuthError(err): // re-auth\n    default: return fmt.Errorf(\"archive property: %w\", err)\n    }\n}","preventionTips":["Re-fetch the property list before archive operations in automation.","Respect server-side constraints surfaced in the wrapped error body."],"tags":["go","cli","api","property","archive"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}