{"record":{"id":"2691f65008ac8051","repo":"kubernetes/kops","slug":"error-applying-update-after-prune-w","errorCode":null,"errorMessage":"error applying update after prune: %w","messagePattern":"error applying update after prune: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/addon.go","lineNumber":214,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading manifest: %w\", err)\n\t}\n\n\tvar merr error\n\tvar applyError, pruneError error\n\n\tif applyError = applier.Apply(ctx, data); applyError != nil {\n\t\tmerr = multierr.Append(merr, fmt.Errorf(\"error applying update: %w\", applyError))\n\t}\n\n\tif pruneError = pruner.Prune(ctx, data, a.Spec.Prune); pruneError != nil {\n\t\tmerr = multierr.Append(merr, fmt.Errorf(\"error pruning manifest: %w\", pruneError))\n\t}\n\n\tif applyError != nil && pruneError == nil {\n\t\t// If we failed to apply, but not prune, we should try to apply again\n\t\tif err := applier.Apply(ctx, data); err != nil {\n\t\t\tmerr = multierr.Append(merr, fmt.Errorf(\"error applying update after prune: %w\", err))\n\t\t} else {\n\t\t\t// If we succeeded to apply after prune, clear the errors\n\t\t\tmerr = nil\n\t\t}\n\t}\n\n\tif merr != nil {\n\t\treturn fmt.Errorf(\"error updating addon from %q: %w\", manifestURL, merr)\n\t}\n\n\tif err := a.AddNeedsUpdateLabel(ctx, k8sClient, required); err != nil {\n\t\treturn fmt.Errorf(\"error adding needs-update label: %v\", err)\n\t}\n\n\tchannel := a.buildChannel()\n\terr = channel.SetInstalledVersion(ctx, k8sClient, a.ChannelVersion())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error applying annotation to record addon installation: %v\", err)","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/addon.go#L196-L232","documentation":"updateAddon retries the apply after a successful prune when the first apply failed but pruning succeeded; this error means the second apply attempt also failed. Both the original apply error and this retry error are accumulated via multierr.","triggerScenarios":"Thrown at channels/pkg/channels/addon.go:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error from the retried apply","Check whether pruning removed an object the manifest apply depends on and re-run","Verify cluster health and RBAC permissions, then re-run the channel apply"],"exampleFix":null,"handlingStrategy":"retry","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"}