{"record":{"id":"73b97d2a9499e35a","repo":"argoproj/argo-workflows","slug":"resolve-uid-w-73b97d","errorCode":null,"errorMessage":"resolve UID: %w","messagePattern":"resolve UID: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/archive/resubmit.go","lineNumber":137,"sourceCode":"func resubmitArchivedWorkflows(ctx context.Context, archiveServiceClient workflowarchivepkg.ArchivedWorkflowServiceClient, serviceClient workflowpkg.WorkflowServiceClient, resubmitOpts resubmitOps, cliSubmitOpts common.CliSubmitOpts, args []string) error {\n\tvar (\n\t\twfs wfv1.Workflows\n\t\terr error\n\t)\n\n\tif resubmitOpts.hasSelector() {\n\t\twfs, err = listArchivedWorkflows(ctx, archiveServiceClient, resubmitOpts.fieldSelector, resubmitOpts.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, resubmitOpts.namespace, resubmitOpts.forceUID, resubmitOpts.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: resubmitOpts.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 lastResubmitted *wfv1.Workflow\n\tresubmittedIdentifiers := make(map[string]bool)\n\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)","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/archive/resubmit.go#L119-L155","documentation":"Thrown by `argo archive resubmit` (resubmitArchivedWorkflows in cmd/argo/commands/archive/resubmit.go) when resolving an argument to a unique archived-workflow UID fails. The UID is needed to reconstruct the archived Workflow object before resubmitting it via the workflow service.","triggerScenarios":"`argo archive resubmit <identifier>` where the identifier matches no archived workflow, matches multiple names, or the ListArchivedWorkflows call inside resolveUID errors (wrapped cause after 'resolve UID:').","commonSituations":"Resubmitting by shorthand name when several archived copies exist (e.g. from previous resubmits); wrong namespace flag; identifier is neither a UID nor a name and no --force-uid/--force-name was supplied.","solutions":["Pass the full workflow UID instead of the name to avoid ambiguity.","Run `argo archive list --selector ...` to find the exact archived entry, then resubmit that UID.","Correct the -n namespace flag if the workflow was archived under another namespace.","If the cause is an RPC failure, check argo server reachability and archive backend health before retrying."],"exampleFix":"// before\nargo archive resubmit nightly-job   # multiple matches\n\n// after\nargo archive resubmit e1234567-89ab-cdef-0123-456789abcdef","handlingStrategy":"validation","validationCode":"res, err := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{\n    ListOptions: &metav1.ListOptions{FieldSelector: \"metadata.name=\" + identifier},\n})\nif err != nil || len(res.Items) != 1 {\n    return fmt.Errorf(\"identifier %q must resolve to exactly one archived workflow (got %d)\", identifier, len(res.Items))\n}\nuid := string(res.Items[0].UID)","typeGuard":null,"tryCatchPattern":"wfs, err := resubmitArchivedWorkflows(ctx, ...)\nif err != nil {\n    if strings.Contains(err.Error(), \"resolve UID:\") {\n        // fall back to explicit UID selection from `argo archive list`\n    }\n    return err\n}","preventionTips":["Resubmit by UID in CI pipelines.","Check `argo archive list` for name collisions from prior resubmits.","Set --force-uid when passing UIDs to skip ambiguity detection."],"tags":["argo-workflows","cli","archive","resubmit"],"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"}