{"record":{"id":"b560e9b48ac1a331","repo":"argoproj/argo-workflows","slug":"unable-to-get-artifact-and-driver-could-not-get-n","errorCode":null,"errorMessage":"unable to get artifact and driver; could not get node for %s: %w","messagePattern":"unable to get artifact and driver; could not get node for (.+?): %w","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/artifacts/artifact_server.go","lineNumber":703,"sourceCode":"\t} else {\n\t\tart = nodeStatus.Outputs.GetArtifactByName(artifactName)\n\t}\n\tif art == nil {\n\t\treturn nil, nil, fmt.Errorf(\"artifact not found: %s, isInput=%t, Workflow Status=%+v\", artifactName, isInput, wf.Status)\n\t}\n\n\t// Artifact Location can be defined in various places:\n\t// 1. In the Artifact itself\n\t// 2. Defined by Controller configmap\n\t// 3. Workflow spec defines artifactRepositoryRef which is a ConfigMap which defines the location\n\t// 4. Template defines ArchiveLocation\n\t// 5. Inline Template\n\n\tvar archiveLocation *wfv1.ArtifactLocation\n\ttemplateNode, err := wf.Status.Nodes.Get(nodeID)\n\tif err != nil {\n\t\tlogger.WithError(err).WithField(\"nodeID\", nodeID).Error(ctx, \"was unable to retrieve node\")\n\t\treturn nil, nil, fmt.Errorf(\"unable to get artifact and driver; could not get node for %s: %w\", nodeID, err)\n\t}\n\ttemplateName := util.GetTemplateFromNode(*templateNode)\n\tif templateName != \"\" {\n\t\ttemplate := wf.GetTemplateByName(templateName)\n\t\tif template == nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"no template found for name %q associated with nodeID %q\", templateName, nodeID)\n\t\t}\n\t\tarchiveLocation = template.ArchiveLocation // this is case 4\n\t}\n\n\tif templateName == \"\" || !archiveLocation.HasLocation() {\n\t\tar, arErr := a.artifactRepositories.Get(ctx, wf.Status.ArtifactRepositoryRef) // this should handle cases 2, 3 and 5\n\t\tif arErr != nil {\n\t\t\treturn art, nil, arErr\n\t\t}\n\t\tarchiveLocation = ar.ToArtifactLocation()\n\t}\n","sourceCodeStart":685,"sourceCodeEnd":721,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/server/artifacts/artifact_server.go#L685-L721","documentation":"During artifact retrieval the Argo Server re-reads the node from wf.Status.Nodes (a second lookup after the artifact itself was found). If the nodeID cannot be resolved in the Workflow status node map, getArtifactAndDriver aborts with 'unable to get artifact and driver; could not get node for <nodeID>'. Because the earlier lookup at line 678 already succeeded, hitting this wrapped error almost always means the node was removed or the workflow status shrank between the two reads (e.g. large-node offloading/hydration issues), or the caller passed an invalid nodeID in a race.","triggerScenarios":"Calling GET artifact endpoints (GetArtifactFile, getArtifact, getArtifactByUID via `argo artifact get` or the UI artifact links) with a pod/node ID that no longer exists in wf.Status.Nodes — e.g. the Workflow was resubmitted/deleted and recreated, artifact GC or status pruning removed the node, the workflow was archived and the node map offloaded without hydration, or a stale UID-based lookup raced with workflow deletion.","commonSituations":"Fetching artifacts for an old workflow after `argo resubmit`/retry; artifact links opened from a stale UI page while the workflow was being deleted; workflows whose node status was offloaded (very large workflows) and the server failed to hydrate; passing a workflow-level ID instead of a pod node ID.","solutions":["Verify the nodeID exists: `argo get <wf> -o json | jq '.status.nodes | keys'` and confirm the node ID used in the artifact request is present.","Re-fetch the workflow (it may have changed under you) and retry the artifact request — a transient race usually resolves on a fresh read.","Check `argo archive get` / the UI for the correct current workflow UID; if the workflow was deleted, the artifact is no longer addressable.","If nodes are missing from status on large workflows, upgrade Argo Workflows (hydration/offload bugs) and check the controller logs for offload errors.","Confirm the artifact has not been garbage collected (artifactGC) — deleted artifacts/nodes return node lookup failures."],"exampleFix":"// before: caching a nodeID from a deleted workflow\nnodeID := oldWf.Status.Nodes[...] // stale\nart, err := artifactSvc.GetArtifactFile(ctx, nodeID, ...)\n// after: re-fetch the live workflow and validate the node first\nwf, err := wfClient.ArgoprojV1alpha1().Workflows(ns).Get(ctx, wfName, metav1.GetOptions{})\nif _, ok := wf.Status.Nodes[nodeID]; !ok {\n    return fmt.Errorf(\"node %s not present in workflow %s; re-fetch or check GC\", nodeID, wfName)\n}\nart, err := artifactSvc.GetArtifactFile(ctx, nodeID, ...)","handlingStrategy":"validation","validationCode":"wf, err := wfClient.ArgoprojV1alpha1().Workflows(ns).Get(ctx, wfName, metav1.GetOptions{})\nif err != nil { return err }\nif _, ok := wf.Status.Nodes[nodeID]; !ok {\n    return fmt.Errorf(\"node %q not in workflow %s status; refetch or check artifact GC\", nodeID, wfName)\n}","typeGuard":"func nodeExists(wf *wfv1.Workflow, nodeID string) bool {\n    _, ok := wf.Status.Nodes[nodeID]\n    return ok\n}","tryCatchPattern":"art, err := svc.GetArtifactFile(ctx, nodeID, artName, isInput, nil)\nif err != nil {\n    if strings.Contains(err.Error(), \"could not get node for\") {\n        // stale node reference: re-fetch workflow and retry once\n        return retryWithFreshWorkflow(ctx, wfName, nodeID, artName)\n    }\n    return err\n}","preventionTips":["Always resolve node IDs from a freshly fetched Workflow object, not cached/stale UI state.","Check artifact GC settings — GC'd artifacts leave dangling node references.","For very large workflows, prefer the archive API which hydrates full status.","Wrap nodeID extraction in an existence check before requesting artifacts."],"tags":["kubernetes","argo-workflows","artifacts","node-lookup"],"backgroundTag":"node-not-found-in-workflow-status","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"}