{"record":{"id":"e5c55006e065836f","repo":"argoproj/argo-workflows","slug":"could-not-get-node-status-for-node-id-s","errorCode":null,"errorMessage":"could not get node status for node ID %s","messagePattern":"could not get node status for node ID (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/cp.go","lineNumber":86,"sourceCode":"\n\t\t\tworkflowName = workflow.Name\n\t\t\tartifactSearchQuery := v1alpha1.ArtifactSearchQuery{\n\t\t\t\tArtifactName: artifactName,\n\t\t\t\tTemplateName: templateName,\n\t\t\t\tNodeId:       nodeID,\n\t\t\t}\n\t\t\tartifactSearchResults := workflow.SearchArtifacts(&artifactSearchQuery)\n\n\t\t\tc, err := newArtifactHTTPClient(client.ArgoServerOpts)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tfor _, artifact := range artifactSearchResults {\n\t\t\t\toutputPath := filepath.Join(outputDir, customPath)\n\t\t\t\tnodeInfo := workflow.Status.Nodes.Find(func(n v1alpha1.NodeStatus) bool { return n.ID == artifact.NodeID })\n\t\t\t\tif nodeInfo == nil {\n\t\t\t\t\treturn fmt.Errorf(\"could not get node status for node ID %s\", artifact.NodeID)\n\t\t\t\t}\n\t\t\t\toutputPath = strings.Replace(outputPath, \"{templateName}\", wfutil.GetTemplateFromNode(*nodeInfo), 1)\n\t\t\t\toutputPath = strings.Replace(outputPath, \"{namespace}\", namespace, 1)\n\t\t\t\toutputPath = strings.Replace(outputPath, \"{workflowName}\", workflowName, 1)\n\t\t\t\toutputPath = strings.Replace(outputPath, \"{nodeId}\", artifact.NodeID, 1)\n\t\t\t\toutputPath = strings.Replace(outputPath, \"{artifactName}\", artifact.Name, 1)\n\t\t\t\terr = os.MkdirAll(outputPath, os.ModePerm)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to create folder path: %w\", err)\n\t\t\t\t}\n\t\t\t\tkey, err := artifact.GetKey()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error getting key for artifact: %w\", err)\n\t\t\t\t}\n\t\t\t\terr = getAndStoreArtifactData(ctx, namespace, workflowName, artifact.NodeID, artifact.Name, path.Base(key), outputPath, c, client.ArgoServerOpts)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to get and store artifact data: %w\", err)\n\t\t\t\t}","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/cp.go#L68-L104","documentation":"After searching artifacts, `argo cp` looks up each artifact's NodeID in workflow.Status.Nodes to render path variables like {templateName}. This error is returned when a matching NodeStatus cannot be found for an artifact's NodeID, so path substitution cannot proceed.","triggerScenarios":"An ArtifactSearchResult references a NodeID absent from the fetched workflow's Status.Nodes — typically when node status has been offloaded/compressed and not hydrated, or when the search returns nodes from a prior (retried/resubmitted) generation whose node IDs no longer appear in current status.","commonSituations":"Copying artifacts from a retried workflow where artifacts belong to nodes from a previous attempt; very large workflows where node status was offloaded to the database; controller pruning or boundary-node state that removed the node entry.","solutions":["Retry against the workflow generation that actually owns the artifact (use the original workflow name for retried runs).","Narrow the search with --node-id/--template-name/--artifact-name so stale results are skipped.","Upgrade to a version where artifact search results are guaranteed to reference current node status; report if reproducible on latest.","As a workaround, fetch artifacts directly by name via `argo artifact get`."],"exampleFix":"// before (copies everything incl. stale-generation artifacts)\nargo cp retried-wf ./out\n// after (target a specific node)\nargo cp retried-wf ./out --node-id=retried-wf-1234567890","handlingStrategy":"fallback","validationCode":"// pre-check: artifact node IDs exist in status (Go client)\nfor _, a := range workflow.SearchArtifacts(q) {\n  if workflow.Status.Nodes.Find(func(n v1alpha1.NodeStatus) bool { return n.ID == a.NodeID }) == nil {\n    fmt.Printf(\"skipping artifact %s: node %s not in status\\n\", a.Name, a.NodeID)\n  }\n}","typeGuard":"func nodeExists(wf *v1alpha1.Workflow, nodeID string) bool {\n  return wf != nil && wf.Status.Nodes.Find(func(n v1alpha1.NodeStatus) bool { return n.ID == nodeID }) != nil\n}","tryCatchPattern":"if strings.Contains(err.Error(), \"could not get node status\") {\n  log.Printf(\"skipping artifacts from pruned/previous-generation nodes\")\n  return nil\n}","preventionTips":["Use --node-id/--template-name filters to target current-generation artifacts.","Avoid copying artifacts from retried/resubmitted workflows by their original name.","Keep node status offloading limits in mind for very large workflows."],"tags":["cli","artifacts","workflow-status"],"backgroundTag":"missing-node-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"}