{"record":{"id":"197039ec1ce9eff8","repo":"argoproj/argo-workflows","slug":"deleting-archived-workflows-not-supported","errorCode":null,"errorMessage":"deleting archived workflows not supported","messagePattern":"deleting archived workflows not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"persist/sqldb/null_workflow_archive.go","lineNumber":47,"sourceCode":"\nfunc (r *nullWorkflowArchive) CountWorkflows(ctx context.Context, options sutils.ListOptions) (int64, error) {\n\treturn 0, nil\n}\n\nfunc (r *nullWorkflowArchive) HasMoreWorkflows(ctx context.Context, options sutils.ListOptions) (bool, error) {\n\treturn false, nil\n}\n\nfunc (r *nullWorkflowArchive) GetWorkflow(ctx context.Context, uid string, namespace string, name string) (*wfv1.Workflow, error) {\n\treturn nil, fmt.Errorf(\"getting archived workflows not supported\")\n}\n\nfunc (r *nullWorkflowArchive) GetWorkflowForEstimator(ctx context.Context, namespace string, requirements []labels.Requirement) (*wfv1.Workflow, error) {\n\treturn nil, fmt.Errorf(\"getting archived workflow for estimator not supported\")\n}\n\nfunc (r *nullWorkflowArchive) DeleteWorkflow(ctx context.Context, uid string) error {\n\treturn fmt.Errorf(\"deleting archived workflows not supported\")\n}\n\nfunc (r *nullWorkflowArchive) DeleteExpiredWorkflows(ctx context.Context, ttl time.Duration) error {\n\treturn nil\n}\n\nfunc (r *nullWorkflowArchive) ListWorkflowsLabelKeys(ctx context.Context) (*wfv1.LabelKeys, error) {\n\treturn &wfv1.LabelKeys{}, nil\n}\n\nfunc (r *nullWorkflowArchive) ListWorkflowsLabelValues(ctx context.Context, key string) (*wfv1.LabelValues, error) {\n\treturn &wfv1.LabelValues{}, nil\n}\n","sourceCodeStart":29,"sourceCodeEnd":61,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/persist/sqldb/null_workflow_archive.go#L29-L61","documentation":"nullWorkflowArchive.DeleteWorkflow is the no-op archive implementation's delete method, used when archiving is disabled. Since there is no archive store, deletion is impossible and it always returns this error (unlike DeleteExpiredWorkflows, which silently no-ops).","triggerScenarios":"Calling DeleteWorkflow (e.g. `argo archive delete <uid>`, archived-workflow delete API, or retention code) while the workflow archive is not configured.","commonSituations":"Cleanup scripts or cron jobs targeting a cluster where persistence/archive was never enabled; UI delete action on an installation without the archive database.","solutions":["Enable persistence with archive: true in the workflow-controller-configmap if archiving (and deletion) should work.","Skip archive deletion calls when archiving is disabled — there is nothing to delete.","Use `kubectl delete workflow` for live (non-archived) workflow deletion instead.","Configure TTL-based cleanup (workflowTTL / archived TTL) only after the archive is actually enabled."],"exampleFix":"// before\n// err := archive.DeleteWorkflow(ctx, uid) // errors when archive off\n// after\n// if archiveEnabled {\n//     err := archive.DeleteWorkflow(ctx, uid)\n// } else {\n//     kubectl.Delete(ctx, \"workflows\", uid) // delete the live object\n// }","handlingStrategy":"try-catch","validationCode":"// verify archiving is configured before attempting delete\nif !archivingEnabled(ctx) {\n    return errors.New(\"cannot delete archived workflow: archive is not configured\")\n}","typeGuard":"func canDeleteArchived(archive workflowarchive.Archive) bool {\n    _, err := archive.GetWorkflow(ctx, \"\", \"\", \"\")\n    return !strings.Contains(fmt.Sprint(err), \"not supported\")\n}","tryCatchPattern":"if err := archive.DeleteWorkflow(ctx, uid); err != nil && strings.Contains(err.Error(), \"not supported\") {\n    logger.Info(ctx, \"archive disabled; nothing to delete\")\n    return nil\n}","preventionTips":["Only run archive cleanup jobs on clusters with persistence + archive enabled.","Use kubectl delete for non-archived workflows.","Make retention/delete tooling tolerant of the null archive (treat as no-op).","Verify archive configuration after upgrades, since null implementations replace the DB repo when persistence is absent."],"tags":["archive","database","server"],"backgroundTag":"archive-not-configured","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"}