{"record":{"id":"ba793c3d710652ba","repo":"kubernetes/kops","slug":"error-rendering-instance-metadata-q-v","errorCode":null,"errorMessage":"error rendering Instance metadata %q: %v","messagePattern":"error rendering Instance metadata %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instance.go","lineNumber":276,"sourceCode":"\tif e.ServiceAccount != nil {\n\t\tif e.Scopes != nil {\n\t\t\tvar scopes []string\n\t\t\tfor _, s := range e.Scopes {\n\t\t\t\ts = scopeToLongForm(s)\n\t\t\t\tscopes = append(scopes, s)\n\t\t\t}\n\t\t\tserviceAccounts = append(serviceAccounts, &compute.ServiceAccount{\n\t\t\t\tEmail:  fi.ValueOf(e.ServiceAccount.Email),\n\t\t\t\tScopes: scopes,\n\t\t\t})\n\t\t}\n\t}\n\n\tvar metadataItems []*compute.MetadataItems\n\tfor key, r := range e.Metadata {\n\t\tv, err := fi.ResourceAsString(r)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error rendering Instance metadata %q: %v\", key, err)\n\t\t}\n\t\tmetadataItems = append(metadataItems, &compute.MetadataItems{\n\t\t\tKey:   key,\n\t\t\tValue: new(v),\n\t\t})\n\t}\n\n\ti := &compute.Instance{\n\t\tCanIpForward: *e.CanIPForward,\n\n\t\tDisks: disks,\n\n\t\tMachineType: BuildMachineTypeURL(project, zone, *e.MachineType),\n\n\t\tMetadata: &compute.Metadata{\n\t\t\tItems: metadataItems,\n\t\t},\n","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instance.go#L258-L294","documentation":"Wrapped error from Instance.mapToGCE when fi.ResourceAsString fails for one of the instance's metadata entries. The offending key is included; the resource (typically a template or file asset) could not be rendered to a string — e.g. missing template data or a failing asset loader.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/instance.go:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Look at the wrapped error and the named metadata key to find the failing resource/template","Check that all template variables referenced by the nodeup/config assets are defined in the cluster spec","Regenerate the cluster config if assets were changed out-of-band"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}