{"record":{"id":"f0cc4f7664a75743","repo":"argoproj/argo-workflows","slug":"resolve-uid-w-f0cc4f","errorCode":null,"errorMessage":"resolve UID: %w","messagePattern":"resolve UID: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/archive/retry.go","lineNumber":142,"sourceCode":"func retryArchivedWorkflows(ctx context.Context, archiveServiceClient workflowarchivepkg.ArchivedWorkflowServiceClient, serviceClient workflowpkg.WorkflowServiceClient, retryOpts retryOps, cliSubmitOpts common.CliSubmitOpts, args []string) error {\n\tselector, err := fields.ParseSelector(retryOpts.nodeFieldSelector)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse node field selector '%s': %w\", retryOpts.nodeFieldSelector, err)\n\t}\n\tvar wfs wfv1.Workflows\n\tif retryOpts.hasSelector() {\n\t\twfs, err = listArchivedWorkflows(ctx, archiveServiceClient, retryOpts.fieldSelector, retryOpts.labelSelector, 0)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Add workflows from args - auto-detect UID vs NAME\n\tfor _, identifier := range args {\n\t\tvar uid string\n\t\tuid, err = resolveUID(ctx, archiveServiceClient, identifier, retryOpts.namespace, retryOpts.forceUID, retryOpts.forceName)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"resolve UID: %w\", err)\n\t\t}\n\t\twf := wfv1.Workflow{\n\t\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\t\tNamespace: retryOpts.namespace,\n\t\t\t\tUID:       types.UID(uid),\n\t\t\t},\n\t\t}\n\t\twfs = append(wfs, wf)\n\t}\n\n\tvar lastRetried *wfv1.Workflow\n\tretriedIdentifiers := make(map[string]bool)\n\tfor _, wf := range wfs {\n\t\t// Use UID if available, otherwise use namespace/name for deduplication\n\t\tvar identifier string\n\t\tif wf.UID != \"\" {\n\t\t\tidentifier = \"uid:\" + string(wf.UID)\n\t\t} else {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/archive/retry.go#L124-L160","documentation":"Thrown by `argo archive retry` (retryArchivedWorkflows) when `resolveUID` cannot resolve a CLI argument to a unique archived-workflow UID before building the Workflow for retry. The wrapped cause after the prefix identifies the real failure (list error, not found, or multiple matches).","triggerScenarios":"`argo archive retry <identifier>` where the identifier matches no archived workflow, matches several, or ListArchivedWorkflows inside resolveUID fails.","commonSituations":"Retrying by name when the archive holds multiple runs with the same name; wrong namespace; using an ID that is neither a UID nor an exact name without --force-uid/--force-name.","solutions":["Use the full workflow UID (from `argo archive list`) instead of the name.","Set the correct -n namespace for the archived workflow.","Resolve ambiguity by picking the exact UID of the run you want to retry.","If the cause is a server error, verify argo server connectivity and that the archive database is healthy."],"exampleFix":"// before\nargo archive retry nightly-job\n\n// after\nargo archive retry e1234567-89ab-cdef-0123-456789abcdef","handlingStrategy":"validation","validationCode":"res, _ := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{\n    ListOptions: &metav1.ListOptions{FieldSelector: \"metadata.name=\" + identifier},\n})\nif len(res.Items) != 1 {\n    return fmt.Errorf(\"expected exactly 1 archived workflow for %q, got %d\", identifier, len(res.Items))\n}\nuid := string(res.Items[0].UID)","typeGuard":null,"tryCatchPattern":"if err := retryArchivedWorkflows(...); err != nil {\n    if strings.Contains(err.Error(), \"resolve UID:\") {\n        // prompt for/lookup the exact UID and retry once\n    }\n    return err\n}","preventionTips":["Use UIDs for automated retry jobs.","Confirm the namespace before resolving names.","Handle archives with duplicate names by listing first."],"tags":["argo-workflows","cli","archive","retry"],"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"}