{"record":{"id":"e98e67605a7f0619","repo":"argoproj/argo-workflows","slug":"no-template-found-for-name-q-associated-with-node","errorCode":null,"errorMessage":"no template found for name %q associated with nodeID %q","messagePattern":"no template found for name %q associated with nodeID %q","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/artifacts/artifact_server.go","lineNumber":709,"sourceCode":"\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\n\terr = art.Relocate(archiveLocation) // if the Artifact defines the location (case 1), it will be used; otherwise whatever archiveLocation is set to\n\tif err != nil {\n\t\treturn art, nil, err\n\t}\n\tif fileName != nil {\n\t\terr = art.AppendToKey(*fileName)","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/server/artifacts/artifact_server.go#L691-L727","documentation":"getArtifactAndDriver reads the template name stored on the node and looks it up with wf.GetTemplateByName to find the template's ArchiveLocation. If the node references a template name that is not present in the Workflow object (spec.templates / stored templates), the server cannot resolve the artifact location and returns 'no template found for name %q associated with nodeID %q'. This typically means the workflow status and its template set are inconsistent or truncated (inline templates stored on nodes not kept in the workflow), commonly after archive/offload or a partially-persisted workflow.","triggerScenarios":"Requesting an artifact for a node whose GetTemplateFromNode returns a template name absent from wf (wf.Status.StoredTemplates or spec.Templates) — e.g. archived workflow fetched with stored templates not hydrated, workflow with offloaded/truncated status, requesting artifacts from a workflow version that predates the template (resubmit replaced templates), or hand-edited/workflow template-name mismatches in Status.Nodes.","commonSituations":"Downloading artifacts from the archive UI for an old workflow; upgrading Argo between versions that changed inline-template storage; workflows with very large status where nodes/templates were compressed/offloaded and hydration failed; using a custom client that fetches the Workflow without full status.","solutions":["Check the workflow: `argo get <wf> -o json | jq '.status.storedTemplates, .spec.templates'` — confirm the template name on the node exists there.","Re-fetch or unarchive the full workflow (ensure the archive/hydrator returns complete status) and retry the artifact download.","Upgrade Argo Workflows to a version fixing stored-template/offload hydration issues if you use very large workflows or SQL archive.","Verify templates were not removed by a resubmit/retry — download artifacts from the original workflow that produced them.","As a workaround, set an explicit artifactRepository (controller configmap or spec.artifactRepositoryRef) so artifact location resolution does not depend on the inline template's ArchiveLocation."],"exampleFix":"// before: requesting artifact from a partially-hydrated archived workflow\nwf, _ := archiver.GetWorkflow(ctx, uid)\nsvc.GetArtifactFile(ctx, nodeID, artName, false, nil) // template missing -> error\n// after: use the archive's own artifact access or ensure full hydration\nwf, err := archiver.GetWorkflow(ctx, uid)\nif err != nil { return err }\nfor _, n := range wf.Status.Nodes {\n    if n.ID == nodeID && util.GetTemplateFromNode(n) != \"\" {\n        if wf.GetTemplateByName(util.GetTemplateFromNode(n)) == nil {\n            return fmt.Errorf(\"workflow %s is missing stored templates; re-export archive\", uid)\n        }\n    }\n}\nsvc.GetArtifactFile(ctx, nodeID, artName, false, nil)","handlingStrategy":"validation","validationCode":"wf, err := wfClient.ArgoprojV1alpha1().Workflows(ns).Get(ctx, wfName, metav1.GetOptions{})\nif err != nil { return err }\nnode, ok := wf.Status.Nodes[nodeID]\nif !ok { return fmt.Errorf(\"node %q missing\", nodeID) }\nif tn := util.GetTemplateFromNode(node); tn != \"\" && wf.GetTemplateByName(tn) == nil {\n    return fmt.Errorf(\"workflow %s lacks stored template %q; archive may be incomplete\", wfName, tn)\n}","typeGuard":"func templateResolvable(wf *wfv1.Workflow, nodeID string) bool {\n    node, ok := wf.Status.Nodes[nodeID]\n    if !ok { return false }\n    tn := util.GetTemplateFromNode(node)\n    return tn == \"\" || wf.GetTemplateByName(tn) != nil\n}","tryCatchPattern":"art, err := svc.GetArtifact(ctx, nodeID, artName, isInput)\nif err != nil {\n    if strings.Contains(err.Error(), \"no template found for name\") {\n        return fmt.Errorf(\"workflow status incomplete (missing stored templates); re-fetch from archive or upgrade Argo: %w\", err)\n    }\n    return err\n}","preventionTips":["Avoid resubmitting/replacing workflows you still need artifacts from — download artifacts before modifying templates.","Keep workflow status under offload thresholds or upgrade to versions with reliable template hydration.","Verify archived workflows export storedTemplates before relying on artifact downloads from archive.","Configure a default artifactRepository so location resolution does not depend solely on template ArchiveLocation."],"tags":["kubernetes","argo-workflows","artifacts","templates","workflow-archive"],"backgroundTag":"stored-template-missing","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"}