{"record":{"id":"dcad397b04d5245c","repo":"helm/helm","slug":"unable-to-create-connection-to-q-w","errorCode":null,"errorMessage":"unable to create connection to %q: %w","messagePattern":"unable to create connection to %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/search_hub.go","lineNumber":88,"sourceCode":"\t\t\treturn o.run(c.Context(), out, args)\n\t\t},\n\t}\n\n\tf := cmd.Flags()\n\tf.StringVar(&o.searchEndpoint, \"endpoint\", \"https://hub.helm.sh\", \"Hub instance to query for charts\")\n\tf.UintVar(&o.maxColWidth, \"max-col-width\", 50, \"maximum column width for output table\")\n\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 {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/cmd/search_hub.go#L70-L106","documentation":"Thrown in searchHubOptions.run (pkg/cmd/search_hub.go:88) when monocular.New cannot initialize a client for the hub endpoint configured via --endpoint (default: the Helm Hub / Artifact Hub monocular instance). The monocular error is wrapped with %w and includes the endpoint URL, so a malformed URL or unreachable host shows up here before any search request is made.","triggerScenarios":"Running 'helm search hub --endpoint <url> term' where the URL is malformed, uses an unsupported scheme, or the host cannot be resolved/connected; pointing --endpoint at a Monocular instance that is down.","commonSituations":"Private/air-gapped environments overriding the default hub endpoint; typos in --endpoint (missing scheme, trailing garbage); corporate proxies blocking the default hub host; on-prem Monocular behind maintenance.","solutions":["Check the URL printed in the message; ensure it includes the scheme (https://) and is reachable: 'curl -sS <endpoint>'.","If the default endpoint is blocked, verify network/proxy settings or point --endpoint at an accessible Monocular-compatible service.","For air-gapped use, prefer 'helm search repo' against locally added repositories instead of hub search."],"exampleFix":"# before\nhelm search hub --endpoint hub.internal wordpress   # endpoint wrong/unreachable\n\n# after\ncurl -sS https://hub.internal/v1/charts   # verify first\nhelm search hub --endpoint https://hub.internal wordpress","handlingStrategy":"validation","validationCode":"# bash: sanity-check a custom hub endpoint before searching\nendpoint=\"https://hub.internal\"\ncurl -fsS -o /dev/null \"$endpoint\" || { echo \"hub endpoint unreachable\" >&2; exit 1; }\nhelm search hub --endpoint \"$endpoint\" wordpress","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the scheme (https://) in --endpoint.","Add a connectivity preflight (curl) to CI before hub searches; cache hub results where possible."],"tags":["helm","search","hub","monocular","network","endpoint"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}