{"record":{"id":"ca396f04ccb53133","repo":"kubernetes/kops","slug":"error-pruning-manifest-w","errorCode":null,"errorMessage":"error pruning manifest: %w","messagePattern":"error pruning manifest: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/pkg/channels/addon.go","lineNumber":208,"sourceCode":"\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)\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)","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/channels/pkg/channels/addon.go#L190-L226","documentation":"In updateAddon, the pruner failed while pruning objects listed in the manifest according to the addon's prune spec. The apply step may have succeeded; this wraps the prune failure, and both errors are accumulated via multierr.","triggerScenarios":"Thrown at channels/pkg/channels/addon.go:208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the Kubernetes API failure during prune listing or deletion","Check that the prune label/field selectors and namespaces in the addon spec are valid","Verify RBAC permissions allow deleting the pruned resources"],"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"}