{"record":{"id":"4eb51b3283ed969e","repo":"kubernetes/kops","slug":"error-creating-instance-v-4eb51b","errorCode":null,"errorMessage":"error creating Instance: %v","messagePattern":"error creating Instance: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instance.go","lineNumber":331,"sourceCode":"\nfunc (_ *Instance) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Instance) error {\n\tcloud := t.Cloud\n\tproject := cloud.Project()\n\tzone := *e.Zone\n\n\tipAddressResolver := func(ip *Address) (*string, error) {\n\t\treturn ip.IPAddress, nil\n\t}\n\n\ti, err := e.mapToGCE(project, ipAddressResolver)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating instance %q\", i.Name)\n\t\tif _, err := cloud.Compute().Instances().Insert(project, zone, i); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating Instance: %v\", err)\n\t\t}\n\t} else {\n\t\tif changes.Metadata != nil {\n\t\t\tklog.V(2).Infof(\"Updating instance metadata on %q\", i.Name)\n\n\t\t\ti.Metadata.Fingerprint = a.metadataFingerprint\n\n\t\t\top, err := cloud.Compute().Instances().SetMetadata(project, zone, i.Name, i.Metadata)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error setting metadata on instance: %v\", err)\n\t\t\t}\n\n\t\t\tif err := cloud.WaitForOp(op); err != nil {\n\t\t\t\treturn fmt.Errorf(\"error setting metadata on instance: %v\", err)\n\t\t\t}\n\n\t\t\tchanges.Metadata = nil\n\t\t}","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instance.go#L313-L349","documentation":"Wrapped error from Instance.RenderGCE when the synchronous Instances.Insert call fails for a new instance (a == nil). GCE rejected the create — typical causes are quota, invalid machine type/zone, missing dependencies (network/subnet/IP conflicts), or permissions.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gcetasks/instance.go:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped API error for the precise rejection reason","Verify machine type availability in the zone and that referenced network/IP/subnet resources exist","Resolve quota or permission issues in the project, then re-run apply"],"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"}