{"record":{"id":"cb5d9eed9d869084","repo":"kubernetes/kops","slug":"error-updating-addon-from-q-w","errorCode":null,"errorMessage":"error updating addon from %q: %w","messagePattern":"error updating addon from %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/addon.go","lineNumber":222,"sourceCode":"\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)\n\t}\n\treturn nil\n}\n\nfunc (a *Addon) AddNeedsUpdateLabel(ctx context.Context, k8sClient kubernetes.Interface, required *AddonUpdate) error {\n\tif required.ExistingVersion != nil {\n\t\tif a.Spec.NeedsRollingUpdate != \"\" {\n\t\t\terr := a.patchNeedsUpdateLabel(ctx, k8sClient)","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/addon.go#L204-L240","documentation":"This is the aggregate error returned at the end of updateAddon: it wraps the accumulated multierr (from manifest read, apply, and/or prune failures) along with the manifest URL, giving one combined failure for the whole addon update in EnsureUpdated.","triggerScenarios":"Thrown at channels/pkg/channels/addon.go:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped multi-error to see which stage (read/apply/prune) failed","Fix the individual addon failure indicated by the wrapped errors","Re-run kops apply addons / the channels controller after remediation"],"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-12T12:17:11.808Z"}