{"record":{"id":"454feebc16f56c2c","repo":"kubernetes/kops","slug":"error-rendering-instances-w","errorCode":null,"errorMessage":"error rendering instances: %w","messagePattern":"error rendering instances: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/instance.go","lineNumber":183,"sourceCode":"\t\t\treturn fi.RequiredField(\"Zone\")\n\t\t}\n\t\tif expected.CommercialType == nil {\n\t\t\treturn fi.RequiredField(\"CommercialType\")\n\t\t}\n\t\tif expected.Image == nil {\n\t\t\treturn fi.RequiredField(\"Image\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *Instance) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *Instance) error {\n\tinstanceService := t.Cloud.InstanceService()\n\tzone := scw.Zone(fi.ValueOf(expected.Zone))\n\n\tuserData, err := fi.ResourceAsBytes(*expected.UserData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error rendering instances: %w\", err)\n\t}\n\n\tnewInstanceCount := expected.Count\n\tif actual != nil {\n\n\t\t// Add \"kops.k8s.io/needs-update\" label to servers needing update\n\t\tfor _, serverID := range actual.NeedsUpdate {\n\t\t\tserver, err := instanceService.GetServer(&instance.GetServerRequest{\n\t\t\t\tZone:     zone,\n\t\t\t\tServerID: serverID,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"rendering server group: listing existing servers: %w\", err)\n\t\t\t}\n\t\t\t_, err = instanceService.UpdateServer(&instance.UpdateServerRequest{\n\t\t\t\tZone:     zone,\n\t\t\t\tServerID: serverID,\n\t\t\t\tTags:     scw.StringsPtr(append(server.Server.Tags, scaleway.TagNeedsUpdate)),","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/instance.go#L165-L201","documentation":"In the instance task's RenderScw, fi.ResourceAsBytes failed to serialize the expected UserData resource (the cloud-init payload) before creating servers. This is a local templating/resource-resolution failure, not a cloud API error — e.g. the user-data template could not be loaded or rendered.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/instance.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the UserData resource (cloud-init template) is well-formed and readable","Look at the wrapped error for the exact resource failure","Re-run after fixing the template or its references"],"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"}