{"record":{"id":"cde62325b5294dbb","repo":"kubernetes/kops","slug":"instancetemplate-not-yet-built-id-is-not-yet-know","errorCode":null,"errorMessage":"InstanceTemplate not yet built; ID is not yet known","messagePattern":"InstanceTemplate not yet built; ID is not yet known","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instancetemplate.go","lineNumber":514,"sourceCode":"\tnormalizedL := normalize(l)\n\tnormalizedR := normalize(r)\n\n\tif !reflect.DeepEqual(normalizedL, normalizedR) {\n\t\tif klog.V(10).Enabled() {\n\t\t\tls := fi.DebugAsJsonStringIndent(normalizedL)\n\t\t\trs := fi.DebugAsJsonStringIndent(normalizedR)\n\t\t\tklog.V(10).Info(\"Not equal\")\n\t\t\tklog.V(10).Info(diff.FormatDiff(ls, rs))\n\t\t}\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (e *InstanceTemplate) URL(project string) (string, error) {\n\tif e.ID == nil {\n\t\treturn \"\", fmt.Errorf(\"InstanceTemplate not yet built; ID is not yet known\")\n\t}\n\treturn fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%s/global/instanceTemplates/%s\", project, *e.ID), nil\n}\n\nfunc (_ *InstanceTemplate) RenderGCE(t *gce.GCEAPITarget, a, e, changes *InstanceTemplate) error {\n\tproject := t.Cloud.Project()\n\tregion := t.Cloud.Region()\n\n\ti, err := e.mapToGCE(project, region)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif a == nil {\n\t\tklog.V(4).Infof(\"Creating InstanceTemplate %v\", i)\n\n\t\tname := fi.ValueOf(e.NamePrefix) + \"-\" + strconv.FormatInt(time.Now().Unix(), 10)\n\t\te.ID = &name","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instancetemplate.go#L496-L532","documentation":"Sentinel-style validation error from InstanceTemplate.URL when the template's ID field is nil. URL is called to build a self-link before the template has been rendered/created — the ID (generated name) is only assigned inside RenderGCE, so this indicates a task ordering issue where a dependent task needs the URL first.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/instancetemplate.go:514 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure tasks that reference the instance template URL declare a dependency on the InstanceTemplate task so it is built first","Re-run the apply — if creation succeeded previously, Find() will populate the ID","Check for a deleted instance template that a dependent resource still references"],"exampleFix":null,"handlingStrategy":"validation","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"}