{"record":{"id":"8bc940a196475f6b","repo":"helm/helm","slug":"unable-to-perform-search-against-q","errorCode":null,"errorMessage":"unable to perform search against %q","messagePattern":"unable to perform search against %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/search_hub.go","lineNumber":95,"sourceCode":"\tf.BoolVar(&o.listRepoURL, \"list-repo-url\", false, \"print charts repository URL\")\n\tf.BoolVar(&o.failOnNoResult, \"fail-on-no-result\", false, \"search fails if no results are found\")\n\n\tbindOutputFlag(cmd, &o.outputFormat)\n\n\treturn cmd\n}\n\nfunc (o *searchHubOptions) run(ctx context.Context, out io.Writer, args []string) error {\n\tc, err := monocular.New(o.searchEndpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create connection to %q: %w\", o.searchEndpoint, err)\n\t}\n\n\tq := strings.Join(args, \" \")\n\tresults, err := c.SearchWithContext(ctx, q)\n\tif err != nil {\n\t\tslog.Debug(\"search failed\", slog.Any(\"error\", err))\n\t\treturn fmt.Errorf(\"unable to perform search against %q\", o.searchEndpoint)\n\t}\n\n\treturn o.outputFormat.Write(out, newHubSearchWriter(results, o.searchEndpoint, o.maxColWidth, o.listRepoURL, o.failOnNoResult))\n}\n\ntype hubChartRepo struct {\n\tURL  string `json:\"url\"`\n\tName string `json:\"name\"`\n}\n\ntype hubChartElement struct {\n\tURL         string       `json:\"url\"`\n\tVersion     string       `json:\"version\"`\n\tAppVersion  string       `json:\"app_version\"`\n\tDescription string       `json:\"description\"`\n\tRepository  hubChartRepo `json:\"repository\"`\n}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/cmd/search_hub.go#L77-L113","documentation":"Returned in searchHubOptions.run (pkg/cmd/search_hub.go:95) when the HTTP search call c.SearchWithContext fails after the client was created successfully. Note the design: the raw error is logged via slog at debug level and the user-visible error only names the endpoint - the real cause (timeout, non-200, DNS failure, context cancellation) is hidden unless --debug is enabled.","triggerScenarios":"The monocular endpoint returns 5xx, times out, or the request context is cancelled (e.g. Ctrl-C or a caller-side ctx deadline); transient network drops between the client and the hub; hub API format changes producing a decode error.","commonSituations":"Flaky CI networking; rate limiting or WAF blocks on the public hub; slow proxy chains exceeding the request timeout; scheduled hub downtime.","solutions":["Re-run with --debug (or HELM_DEBUG=1) to see the logged 'search failed' cause.","Retry after confirming basic connectivity: 'curl -sS <endpoint>' - many failures are transient.","If the hub is persistently blocked, fall back to 'helm search repo' with locally added repositories."],"exampleFix":"# before\nhelm search hub wordpress        # Error: unable to perform search against \"...\"\n\n# after\nhelm search hub wordpress --debug # slog line 'search failed' shows the real error","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := cmdExecution(\"helm\", \"search\", \"hub\", term, \"--debug\")\nif err != nil {\n    if strings.Contains(out+err.Error(), \"unable to perform search\") {\n        // transient network path: backoff and retry once or twice\n        time.Sleep(2 * time.Second)\n        out, err = cmdExecution(\"helm\", \"search\", \"hub\", term, \"--debug\")\n    }\n    if err != nil { return fmt.Errorf(\"hub search failed: %w\", err) }\n}","preventionTips":["Always run hub searches with --debug when diagnosing: the real cause is only in the debug log.","Wrap CI hub searches in bounded retry with backoff for transient 5xx/timeouts.","Mirror frequently used charts into a local repo and use 'helm search repo' to avoid hub dependency."],"tags":["helm","search","hub","network","debugging"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}