argoproj/argo-workflows · error

resolve UID: %w

Error message

resolve UID: %w

What it means

Thrown by `argo archive delete` (cmd/argo/commands/archive/delete.go) when `resolveUID` fails to convert a CLI argument into a unique archived-workflow UID. resolveUID lists archived workflows by exact name (or uses the arg directly with --force-uid/--force-name) and errors when lookup, listing, ambiguity, or not-found occurs; the underlying cause is wrapped with this prefix.

Source

Thrown at cmd/argo/commands/archive/delete.go:48

  argo archive delete my-workflow --name

# Delete an archived workflow by UID (forced):
  argo archive delete a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 --uid
`,
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx, apiClient, err := client.NewAPIClient(cmd.Context())
			if err != nil {
				return err
			}
			serviceClient, err := apiClient.NewArchivedWorkflowServiceClient()
			if err != nil {
				return err
			}
			namespace := client.Namespace(ctx)
			for _, identifier := range args {
				uid, err := resolveUID(ctx, serviceClient, identifier, namespace, forceUID, forceName)
				if err != nil {
					return fmt.Errorf("resolve UID: %w", err)
				}
				if _, err = serviceClient.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: uid}); err != nil {
					return err
				}
				fmt.Printf("Archived workflow '%s' deleted\n", identifier)
			}
			return nil
		},
	}
	command.Flags().BoolVar(&forceName, "name", false, "force the argument to be treated as a name")
	command.Flags().BoolVar(&forceUID, "uid", false, "force the argument to be treated as a UID")
	command.MarkFlagsMutuallyExclusive("name", "uid")
	return command
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Read the wrapped cause after 'resolve UID:' — if 'not found', verify the name/UID with `argo archive list`.
  2. If 'Multiple archived workflows found', re-run with the full workflow UID instead of the name.
  3. Check the -n namespace flag matches the namespace the workflow was archived from.
  4. If the underlying error is a gRPC/server error, confirm the argo server and archive database (Postgres/MySQL) are reachable and archival is enabled.

Example fix

// before
argo archive delete my-wf   // ambiguous or not found

// after
argo archive list | grep my-wf   # get the UID
argo archive delete <uid>
Defensive patterns

Strategy: validation

Validate before calling

// resolve the UID up front with the same API the CLI uses
resp, _ := archiveClient.ListArchivedWorkflows(ctx, &workflowarchivepkg.ListArchivedWorkflowRequest{
    ListOptions: &metav1.ListOptions{FieldSelector: "metadata.name=my-wf"},
})
if len(resp.Items) == 0 { return fmt.Errorf("archived workflow my-wf not found") }
uid := string(resp.Items[0].UID)

Try / catch

if _, err := client.DeleteArchivedWorkflow(ctx, &workflowarchivepkg.DeleteArchivedWorkflowRequest{Uid: uid}); err != nil {
    if strings.Contains(err.Error(), "resolve UID: archived workflow") {
        // wrong identifier/namespace — list to find the right UID
    }
    return err
}

Prevention

When it happens

Trigger: Running `argo archive delete <identifier>` where the identifier is neither a valid UID nor an existing archived workflow name, or where multiple archived workflows share the name, or where the ListArchivedWorkflows gRPC call fails.

Common situations: Typos in workflow names; the workflow was archived in a namespace different from the one the CLI is pointed at; expired/deleted archives; ambiguous short names colliding across archive entries.

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