{"record":{"id":"28b176617118e654","repo":"kubernetes/kops","slug":"operation-must-not-be-nil","errorCode":null,"errorMessage":"operation must not be nil","messagePattern":"operation must not be nil","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/op.go","lineNumber":93,"sourceCode":"\nfunc waitForGlobalOp(client *compute.Service, op *compute.Operation) error {\n\tu, err := ParseGoogleCloudURL(op.SelfLink)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error parsing operation URL %q: %v\", op.SelfLink, err)\n\t}\n\n\treturn waitForOp(op, func(operationName string) (*compute.Operation, error) {\n\t\treturn client.GlobalOperations.Wait(u.Project, operationName).Do()\n\t})\n}\n\nfunc opIsDone(op *compute.Operation) bool {\n\treturn op != nil && op.Status == \"DONE\"\n}\n\nfunc waitForOp(op *compute.Operation, getOperation func(operationName string) (*compute.Operation, error)) error {\n\tif op == nil {\n\t\treturn fmt.Errorf(\"operation must not be nil\")\n\t}\n\n\tif opIsDone(op) {\n\t\treturn getErrorFromOp(op)\n\t}\n\n\topStart := time.Now()\n\topName := op.Name\n\treturn wait.Poll(operationPollInterval, operationPollTimeoutDuration, func() (bool, error) {\n\t\tstart := time.Now()\n\t\t// gce.operationPollRateLimiter.Accept()\n\t\tduration := time.Since(start)\n\t\tif duration > 5*time.Second {\n\t\t\tklog.Infof(\"pollOperation: throttled %v for %v\", duration, opName)\n\t\t}\n\t\tpollOp, err := getOperation(opName)\n\t\tif err != nil {\n\t\t\tklog.Warningf(\"GCE poll operation %s failed: pollOp: [%v] err: [%v]\", opName, pollOp, err)","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/op.go#L75-L111","documentation":"Defensive nil-check sentinel in waitForOp: a nil *compute.Operation was passed to the wait helper, meaning a caller received no operation object to wait on. This is a programming-error guard — GCE API calls that return operations should never hand nil here on the success path.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/op.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the caller that produced the operation for a swallowed error","Report as a kOps bug if triggered by a normal API flow","Verify the preceding GCE API call actually succeeded"],"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-12T12:17:11.808Z"}