{"record":{"id":"3ac8c2144398f5e7","repo":"helm/helm","slug":"no-results-found-3ac8c2","errorCode":null,"errorMessage":"no results found","messagePattern":"no results found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/search_repo.go","lineNumber":219,"sourceCode":"\ntype repoChartElement struct {\n\tName        string `json:\"name\"`\n\tVersion     string `json:\"version\"`\n\tAppVersion  string `json:\"app_version\"`\n\tDescription string `json:\"description\"`\n}\n\ntype repoSearchWriter struct {\n\tresults        []*search.Result\n\tcolumnWidth    uint\n\tfailOnNoResult bool\n}\n\nfunc (r *repoSearchWriter) WriteTable(out io.Writer) error {\n\tif len(r.results) == 0 {\n\t\t// Fail if no results found and --fail-on-no-result is enabled\n\t\tif r.failOnNoResult {\n\t\t\treturn errors.New(\"no results found\")\n\t\t}\n\n\t\t_, err := out.Write([]byte(\"No results found\\n\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to write results: %w\", err)\n\t\t}\n\t\treturn nil\n\t}\n\ttable := uitable.New()\n\ttable.MaxColWidth = r.columnWidth\n\ttable.AddRow(\"NAME\", \"CHART VERSION\", \"APP VERSION\", \"DESCRIPTION\")\n\tfor _, r := range r.results {\n\t\ttable.AddRow(r.Name, r.Chart.Version, r.Chart.AppVersion, r.Chart.Description)\n\t}\n\treturn output.EncodeTable(out, table)\n}\n\nfunc (r *repoSearchWriter) WriteJSON(out io.Writer) error {","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/cmd/search_repo.go#L201-L237","documentation":"Returned by repoSearchWriter.WriteTable when 'helm search repo' found zero charts, --fail-on-no-result is enabled, and output is the default table format. It is the table-output counterpart of the JSON/YAML check in encodeByFormat: with the flag, zero results become a hard error; without it, Helm prints 'No results found' and exits 0.","triggerScenarios":"Running 'helm search repo <term> --fail-on-no-result' (table output) with zero matches in all cached repo indexes.","commonSituations":"Stale local index after a chart was renamed upstream; search term not matching any chart name/description/keywords; CI existence checks gating on chart availability.","solutions":["Run 'helm repo update' so cached indexes reflect current upstream content, then retry.","Broaden or correct the search term (search matches name, description and keywords).","If empty results are acceptable, remove --fail-on-no-result."],"exampleFix":"# before\nhelm search repo mychart --fail-on-no-result   # Error: no results found\n\n# after\nhelm repo update && helm search repo mychart --fail-on-no-result","handlingStrategy":"validation","validationCode":"// Validate hit count before writing table output.\nif len(results) == 0 && failOnNoResult {\n    return fmt.Errorf(\"no charts matched %q in configured repositories\", term)\n}\nerr := writer.WriteTable(out)","typeGuard":null,"tryCatchPattern":"if err := writer.WriteTable(out); err != nil {\n    if strings.Contains(err.Error(), \"no results found\") { /* empty set, not an IO failure */ }\n}","preventionTips":["Run 'helm repo update' before existence-check searches.","Gate on 'helm search repo <name> --versions' output rather than on a broad term."],"tags":["cli","search","repository","fail-on-no-result"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}