{"record":{"id":"bbed1755e08666e0","repo":"kubernetes/kops","slug":"error-applying-update-w","errorCode":null,"errorMessage":"error applying update: %w","messagePattern":"error applying update: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/addon.go","lineNumber":204,"sourceCode":"func (a *Addon) updateAddon(ctx context.Context, k8sClient kubernetes.Interface, vfsContext *vfs.VFSContext, pruner *Pruner, applier Applier, required *AddonUpdate) error {\n\tmanifestURL, err := a.GetManifestFullUrl()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tklog.Infof(\"Applying update from %q\", manifestURL)\n\n\t// We copy the manifest to a temp file because it is likely e.g. an s3 URL, which kubectl can't read\n\tdata, err := vfsContext.ReadFile(manifestURL.String())\n\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)","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/addon.go#L186-L222","documentation":"In updateAddon, the applier (typically kubectl-apply logic) failed to apply the manifest bytes that were successfully fetched. This wraps the apply error; the underlying cause is in the wrapped error (API rejection, malformed manifest objects, or cluster connectivity).","triggerScenarios":"Thrown at channels/pkg/channels/addon.go:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the Kubernetes API rejection reason","Check the addon manifest for invalid or unsupported resources","Verify the cluster API server is reachable and RBAC allows the 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"}