{"record":{"id":"c44df9f6862e2df1","repo":"argoproj/argo-workflows","slug":"resolve-uid-w","errorCode":null,"errorMessage":"resolve UID: %w","messagePattern":"resolve UID: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/archive/delete.go","lineNumber":48,"sourceCode":"  argo archive delete my-workflow --name\n\n# Delete an archived workflow by UID (forced):\n  argo archive delete a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 --uid\n`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx, apiClient, err := client.NewAPIClient(cmd.Context())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tserviceClient, err := apiClient.NewArchivedWorkflowServiceClient()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tnamespace := client.Namespace(ctx)\n\t\t\tfor _, identifier := range args {\n\t\t\t\tuid, err := resolveUID(ctx, serviceClient, identifier, namespace, forceUID, forceName)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"resolve UID: %w\", err)\n\t\t\t\t}\n\t\t\t\tif _, err = serviceClient.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: uid}); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"Archived workflow '%s' deleted\\n\", identifier)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tcommand.Flags().BoolVar(&forceName, \"name\", false, \"force the argument to be treated as a name\")\n\tcommand.Flags().BoolVar(&forceUID, \"uid\", false, \"force the argument to be treated as a UID\")\n\tcommand.MarkFlagsMutuallyExclusive(\"name\", \"uid\")\n\treturn command\n}\n","sourceCodeStart":30,"sourceCodeEnd":63,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/archive/delete.go#L30-L63","documentation":"Thrown by `argo archive delete` (cmd/argo/commands/archive/delete.go) when `resolveUID` fails to convert a CLI argument into a unique archived-workflow UID. resolveUID lists archived workflows by exact name (or uses the arg directly with --force-uid/--force-name) and errors when lookup, listing, ambiguity, or not-found occurs; the underlying cause is wrapped with this prefix.","triggerScenarios":"Running `argo archive delete <identifier>` where the identifier is neither a valid UID nor an existing archived workflow name, or where multiple archived workflows share the name, or where the ListArchivedWorkflows gRPC call fails.","commonSituations":"Typos in workflow names; the workflow was archived in a namespace different from the one the CLI is pointed at; expired/deleted archives; ambiguous short names colliding across archive entries.","solutions":["Read the wrapped cause after 'resolve UID:' — if 'not found', verify the name/UID with `argo archive list`.","If 'Multiple archived workflows found', re-run with the full workflow UID instead of the name.","Check the -n namespace flag matches the namespace the workflow was archived from.","If the underlying error is a gRPC/server error, confirm the argo server and archive database (Postgres/MySQL) are reachable and archival is enabled."],"exampleFix":"// before\nargo archive delete my-wf   // ambiguous or not found\n\n// after\nargo archive list | grep my-wf   # get the UID\nargo archive delete <uid>","handlingStrategy":"validation","validationCode":"// resolve the UID up front with the same API the CLI uses\nresp, _ := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{\n    ListOptions: &metav1.ListOptions{FieldSelector: \"metadata.name=my-wf\"},\n})\nif len(resp.Items) == 0 { return fmt.Errorf(\"archived workflow my-wf not found\") }\nuid := string(resp.Items[0].UID)","typeGuard":null,"tryCatchPattern":"if _, err := client.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: uid}); err != nil {\n    if strings.Contains(err.Error(), \"resolve UID: archived workflow\") {\n        // wrong identifier/namespace — list to find the right UID\n    }\n    return err\n}","preventionTips":["Always prefer full UIDs over names in scripts driving archive commands.","Pin the -n namespace explicitly in automation.","Run `argo archive list` to confirm the entry exists before destructive commands.","Use --force-name only when you are certain the name is unique."],"tags":["argo-workflows","cli","archive","identifier-resolution"],"backgroundTag":"resource-not-found","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}