{"record":{"id":"86241208004c3338","repo":"hashicorp/packer","slug":"unhandled-node-type-s","errorCode":null,"errorMessage":"unhandled node type %s","messagePattern":"unhandled node type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/hcl2_upgrade.go","lineNumber":354,"sourceCode":"\t\t// Escape anything that isn't in the func map\n\t\tfmt.Fprintf(out, \"{{ \\\"{{\\\" }} %s {{ \\\"}}\\\" }}\", cmd.String())\n\n\t// TODO maybe node.Pipe.Decls? Though in Packer templates they're not\n\t// supported officially so they can be left aside for now\n\tcase *parse.ListNode:\n\t\tfor _, child := range node.Nodes {\n\t\t\terr := reTemplate(child, out, funcs)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase *parse.TextNode:\n\t\t_, err := fmt.Fprintf(out, \"%s\", node.Text)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unhandled node type %s\", reflect.TypeOf(nd))\n\t}\n\treturn nil\n}\n\n// transposeTemplatingCalls executes parts of blocks as go template files and replaces\n// their result with their hcl2 variant. If something goes wrong the template\n// containing the go template string is returned.\nfunc transposeTemplatingCalls(s []byte) []byte {\n\tfuncErrors := &multierror.Error{\n\t\tErrorFormat: func(es []error) string {\n\t\t\tif len(es) == 1 {\n\t\t\t\treturn fmt.Sprintf(\"# 1 error occurred upgrading the following block:\\n\\t# %s\\n\", es[0])\n\t\t\t}\n\n\t\t\tpoints := make([]string, len(es))\n\t\t\tfor i, err := range es {\n\t\t\t\tif i == len(es)-1 {\n\t\t\t\t\tpoints[i] = fmt.Sprintf(\"# %s\", err)","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/command/hcl2_upgrade.go#L336-L372","documentation":"Internal error from the HCL2 upgrade command's Go template walker (reTemplate): the parsed template AST contains a text/template node type the converter does not handle (anything other than Action/Command/List/Text nodes). Indicates unsupported Go templating syntax in the legacy JSON template.","triggerScenarios":"Thrown at command/hcl2_upgrade.go:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Simplify the Go template expressions in the legacy template (remove branches, pipes, or variables not supported by the converter)","Hand-migrate the offending template section to HCL2 after upgrading the rest"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}