{"record":{"id":"a2e4eb1fbca45707","repo":"pulumi/pulumi","slug":"unknown-node-type-t","errorCode":null,"errorMessage":"unknown node type: %T","messagePattern":"unknown node type: %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/pcl/runtime/interpreter.go","lineNumber":697,"sourceCode":"\t\t\t\treturn fmt.Errorf(\"failed to read resource %s: %w\", node.Name(), err)\n\t\t\t}\n\t\tcase *pcl.Component:\n\t\t\tif err := i.registerComponent(ctx, node); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to register component %s: %w\", node.Name(), err)\n\t\t\t}\n\t\tcase *pcl.OutputVariable:\n\t\t\tvalue, poison, diags := i.evalContext.Evaluate(node.Value)\n\t\t\tif poison != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif diags.HasErrors() {\n\t\t\t\treturn diags\n\t\t\t}\n\t\t\toutputsLock.Lock()\n\t\t\toutputs[resource.PropertyKey(node.LogicalName())] = value\n\t\t\toutputsLock.Unlock()\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown node type: %T\", node)\n\t\t}\n\t\treturn nil\n\t}, pdag.MaxProcs(int(i.info.Parallel)))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn outputs, nil\n}\n\nfunc (i *Interpreter) lookupResource(ctx context.Context, token string) (*schema.Resource, error) {\n\tpkg, mod, typ, diags := pcl.DecomposeToken(token, hcl.Range{})\n\tcontract.Assertf(!diags.HasErrors(), \"invalid token format for resource token %s\", token)\n\n\ttoken = fmt.Sprintf(\"%s:%s:%s\", pkg, mod, typ)\n\tpkgName := pkg\n\tif pkg == \"pulumi\" && mod == \"providers\" {\n\t\tpkgName = typ","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/pcl/runtime/interpreter.go#L679-L715","documentation":"The interpreter's DAG walk switches on pcl.Node concrete types (ConfigVariable, LocalVariable, Resource, ReadResource, Component, OutputVariable, etc.). If a node's concrete type is not one of the handled cases, the default branch throws \"unknown node type: %T\" embedding the Go type. This indicates the PCL binder produced a node type the interpreter does not know how to execute — usually a version mismatch or an unimplemented program construct.","triggerScenarios":"A pcl.Node implementation newer than the interpreter's switch is fed into Interpreter.Run (e.g. a newly added node kind in pkg/pcl like Invoke or Import not handled by this switch), or a custom/foreign Node implementation is injected into the program's node list.","commonSituations":"Upgrading Pulumi sources so programs bind to new node types while using an older interpreter; using the interpreter library programmatically and constructing a custom pcl.Node; PCL features (e.g. imports/invoke nodes) not yet supported by the runtime interpreter.","solutions":["Read the %T in the message to identify the unhandled node type","Upgrade the pulumi/pulumi dependency so interpreter and pcl binder versions match","Rewrite the program to avoid the unsupported construct (e.g. inline the invoke/import instead of using the newer syntax)","Add a case for the node type in the walk switch if you own the interpreter code"],"exampleFix":"// before: relying on an unsupported new node type\n// pcl program uses `import` statement the interpreter can't execute\n// after: inline the equivalent code\n// replace the import with the component/resource declarations inline","handlingStrategy":"type-guard","validationCode":"// pre-scan program nodes for types the interpreter cannot handle\nfor _, node := range program.Nodes {\n    switch node.(type) {\n    case *pcl.ConfigVariable, *pcl.LocalVariable, *pcl.Resource,\n        *pcl.ReadResource, *pcl.Component, *pcl.OutputVariable,\n        *pcl.PulumiBlock, *pcl.Hook:\n    default:\n        return fmt.Errorf(\"unsupported node %T\", node)\n    }\n}","typeGuard":"func isSupportedNode(n pcl.Node) bool {\n    switch n.(type) {\n    case *pcl.ConfigVariable, *pcl.LocalVariable, *pcl.Resource,\n        *pcl.ReadResource, *pcl.Component, *pcl.OutputVariable,\n        *pcl.PulumiBlock, *pcl.Hook:\n        return true\n    default:\n        return false\n    }\n}","tryCatchPattern":"if err := interp.Run(ctx, program); err != nil {\n    if strings.HasPrefix(err.Error(), \"unknown node type: \") {\n        return fmt.Errorf(\"program uses a construct unsupported by this interpreter: %w\", err)\n    }\n    return err\n}","preventionTips":["Keep the pcl package and the runtime interpreter on the same pulumi/pulumi version","Pre-validate program nodes before interpretation","Track PCL language additions (import/invoke nodes) and upgrade the interpreter accordingly"],"tags":["pcl","interpreter","unsupported-node"],"backgroundTag":"unknown-node-type","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}