argoproj/argo-workflows · error

resolve UID: %w

Error message

resolve UID: %w

What it means

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.

Source

Thrown at cmd/argo/commands/archive/resubmit.go:137

func resubmitArchivedWorkflows(ctx context.Context, archiveServiceClient workflowarchivepkg.ArchivedWorkflowServiceClient, serviceClient workflowpkg.WorkflowServiceClient, resubmitOpts resubmitOps, cliSubmitOpts common.CliSubmitOpts, args []string) error {
	var (
		wfs wfv1.Workflows
		err error
	)

	if resubmitOpts.hasSelector() {
		wfs, err = listArchivedWorkflows(ctx, archiveServiceClient, resubmitOpts.fieldSelector, resubmitOpts.labelSelector, 0)
		if err != nil {
			return err
		}
	}

	// Add workflows from args - auto-detect UID vs NAME
	for _, identifier := range args {
		var uid string
		uid, err = resolveUID(ctx, archiveServiceClient, identifier, resubmitOpts.namespace, resubmitOpts.forceUID, resubmitOpts.forceName)
		if err != nil {
			return fmt.Errorf("resolve UID: %w", err)
		}
		wf := wfv1.Workflow{
			ObjectMeta: metav1.ObjectMeta{
				Namespace: resubmitOpts.namespace,
				UID:       types.UID(uid),
			},
		}
		wfs = append(wfs, wf)
	}

	var lastResubmitted *wfv1.Workflow
	resubmittedIdentifiers := make(map[string]bool)

	for _, wf := range wfs {
		// Use UID if available, otherwise use namespace/name for deduplication
		var identifier string
		if wf.UID != "" {
			identifier = "uid:" + string(wf.UID)

View on GitHub (pinned to 35bff19146)

Solutions

  1. Pass the full workflow UID instead of the name to avoid ambiguity.
  2. Run `argo archive list --selector ...` to find the exact archived entry, then resubmit that UID.
  3. Correct the -n namespace flag if the workflow was archived under another namespace.
  4. If the cause is an RPC failure, check argo server reachability and archive backend health before retrying.

Example fix

// before
argo archive resubmit nightly-job   # multiple matches

// after
argo archive resubmit e1234567-89ab-cdef-0123-456789abcdef
Defensive patterns

Strategy: validation

Validate before calling

res, err := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{
    ListOptions: &metav1.ListOptions{FieldSelector: "metadata.name=" + identifier},
})
if err != nil || len(res.Items) != 1 {
    return fmt.Errorf("identifier %q must resolve to exactly one archived workflow (got %d)", identifier, len(res.Items))
}
uid := string(res.Items[0].UID)

Try / catch

wfs, err := resubmitArchivedWorkflows(ctx, ...)
if err != nil {
    if strings.Contains(err.Error(), "resolve UID:") {
        // fall back to explicit UID selection from `argo archive list`
    }
    return err
}

Prevention

When it happens

Trigger: `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:').

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/73b97d2a9499e35a. Report an issue: GitHub.