{"record":{"id":"69c05028269f3f28","repo":"argoproj/argo-workflows","slug":"resolve-uid-w-69c050","errorCode":null,"errorMessage":"resolve UID: %w","messagePattern":"resolve UID: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/archive/get.go","lineNumber":61,"sourceCode":"# Get information about an archived workflow by UID (forced):\n  argo archive get a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 --uid\n`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tidentifier := args[0]\n\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\n\t\t\tnamespace := client.Namespace(ctx)\n\t\t\tuid, err := resolveUID(ctx, serviceClient, identifier, namespace, forceUID, forceName)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"resolve UID: %w\", err)\n\t\t\t}\n\n\t\t\twf, err := serviceClient.GetArchivedWorkflow(ctx, &workflowarchivepkg.GetArchivedWorkflowRequest{Uid: uid})\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprintWorkflow(wf, output.String())\n\t\t\treturn nil\n\t\t},\n\t}\n\tcommand.Flags().VarP(&output, \"output\", \"o\", \"Output format. \"+output.Usage())\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\nfunc printWorkflow(wf *wfv1.Workflow, output string) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/archive/get.go#L43-L79","documentation":"Thrown by `argo archive get` (cmd/argo/commands/archive/get.go) when `resolveUID` cannot turn the given identifier into a single archived-workflow UID before calling GetArchivedWorkflow. The wrapped cause distinguishes: listing failure, no match, or multiple matches for a name.","triggerScenarios":"Running `argo archive get <name-or-uid>` where the name does not exactly match any archived workflow, matches more than one, or the ListArchivedWorkflows RPC fails; also when neither --force-uid nor --force-name is set and the identifier is ambiguous.","commonSituations":"Using a partial/prefixed name where several archived workflows share the prefix; querying a workflow archived in another namespace; stale names after resubmission created multiple archived copies.","solutions":["Use the full UID (visible in `argo archive list`) instead of the name.","Fix the -n namespace flag to match where the workflow ran.","If ambiguous, disambiguate with --force-name plus a more exact name, or pass --force-uid with a true UID.","If the cause is a server/list error, verify connectivity to the argo server and that workflow archival is enabled."],"exampleFix":"// before\nargo archive get my-wf\n\n// after\nargo archive get e1234567-89ab-cdef-0123-456789abcdef","handlingStrategy":"validation","validationCode":"res, _ := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{\n    ListOptions: &metav1.ListOptions{FieldSelector: \"metadata.name=\" + name},\n})\nswitch len(res.Items) {\ncase 0: return fmt.Errorf(\"no archived workflow named %s\", name)\ncase 1: uid = string(res.Items[0].UID)\ndefault: return fmt.Errorf(\"%d archived workflows named %s; use UID\", len(res.Items), name)\n}","typeGuard":null,"tryCatchPattern":"wf, err := serviceClient.GetArchivedWorkflow(ctx, &workflowarchivepkg.GetArchivedWorkflowRequest{Uid: uid})\nif err != nil {\n    if strings.Contains(err.Error(), \"resolve UID:\") {\n        // re-list and pick the exact UID\n    }\n    return err\n}","preventionTips":["Use UIDs in scripts; reserve name lookups for interactive use.","Verify the namespace matches where the workflow ran.","List before get when names may be reused across resubmissions."],"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"}