argoproj/argo-workflows · error

archived workflow '%s' not found

Error message

archived workflow '%s' not found

What it means

resolveUID (cmd/argo/commands/archive/util.go) errors when a name-based lookup finds zero archived workflows matching the exact name. The CLI cannot disambiguate and refuses to proceed, telling you the identifier that was searched.

Source

Thrown at cmd/argo/commands/archive/util.go:58

	}

	resp, err := serviceClient.ListArchivedWorkflows(ctx, req)
	if err != nil {
		return "", fmt.Errorf("list archived workflows: %w", err)
	}

	matches := resp.Items
	for len(matches) < 2 && resp.Continue != "" {
		req.ListOptions = &metav1.ListOptions{Continue: resp.Continue}
		resp, err = serviceClient.ListArchivedWorkflows(ctx, req)
		if err != nil {
			return "", fmt.Errorf("list archived workflows: %w", err)
		}
		matches = append(matches, resp.Items...)
	}

	if len(matches) == 0 {
		return "", fmt.Errorf("archived workflow '%s' not found", identifier)
	}

	if len(matches) > 1 {
		var msg strings.Builder
		fmt.Fprintf(&msg, "Multiple archived workflows found with name '%s':\n", identifier)
		for _, wf := range matches {
			fmt.Fprintf(&msg, "  %s (Created: %s, Finished: %s)\n", wf.UID, humanize.Timestamp(wf.CreationTimestamp.Time), humanize.Timestamp(wf.Status.FinishedAt.Time))
		}
		msg.WriteString("Please specify the UID.")
		return "", errors.New(msg.String())
	}

	return string(matches[0].UID), nil
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Run `argo archive list -n <ns> | grep <name>` (or `argo list --archived`) to confirm the entry exists and copy its exact name/UID.
  2. Fix the -n namespace flag to the namespace where the workflow actually ran.
  3. If the workflow is still running (not archived), use `argo get <name>` instead of the archive commands.
  4. If the entry was evicted, restore from database backups or resubmit from the original manifest — it cannot be recovered from the archive.

Example fix

// before
argo archive get nightly-job   # not found

// after
argo archive list -n default | grep nightly-job
argo archive get <uid-of-nightly-job>
Defensive patterns

Strategy: validation

Validate before calling

res, _ := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{
    ListOptions: &metav1.ListOptions{FieldSelector: "metadata.name=" + name},
})
if len(res.Items) == 0 {
    return fmt.Errorf("%s is not in the archive; is it complete/archived and in the right namespace?", name)
}

Try / catch

if err := act(ctx, identifier); err != nil {
    if strings.Contains(err.Error(), "archived workflow") && strings.Contains(err.Error(), "not found") {
        // fall back to live workflow commands: argo get/argo delete
    }
    return err
}

Prevention

When it happens

Trigger: Calling archive get/delete/retry/resubmit with a workflow name that has no exact match in the archive for the given namespace — e.g. the workflow never completed-and-archived, was purged by TTL/retention, or the name has trailing whitespace/case mismatch.

Common situations: Querying a workflow archived in a different namespace; workflows deleted before archival settings captured them; retention policies evicting old entries; assuming a running (not yet archived) workflow is queryable via archive commands.

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/329cd6f5d7cc2768. Report an issue: GitHub.