{"record":{"id":"30cc282d97a3a236","repo":"router-for-me/CLIProxyAPI","slug":"host-http-client-is-unavailable","errorCode":null,"errorMessage":"host http client is unavailable","messagePattern":"host http client is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/http_bridge.go","lineNumber":110,"sourceCode":"\t\t\t\t\tselect {\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\tcase chunks <- pluginapi.HTTPStreamChunk{Err: errRead}:\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}()\n\treturn pluginapi.HTTPStreamResponse{\n\t\tStatusCode: resp.StatusCode,\n\t\tHeaders:    cloneHeader(resp.Header),\n\t\tChunks:     chunks,\n\t}, nil\n}\n\nfunc (c *hostHTTPClient) doHTTP(ctx context.Context, req pluginapi.HTTPRequest) (*http.Response, *config.Config, error) {\n\tif c == nil || c.host == nil {\n\t\treturn nil, nil, fmt.Errorf(\"host http client is unavailable\")\n\t}\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\tcfg := c.host.currentRuntimeConfig()\n\tmethod := req.Method\n\tif method == \"\" {\n\t\tmethod = http.MethodGet\n\t}\n\thttpReq, errNewRequest := http.NewRequestWithContext(ctx, method, req.URL, bytes.NewReader(bytes.Clone(req.Body)))\n\tif errNewRequest != nil {\n\t\treturn nil, cfg, fmt.Errorf(\"create host http request: %w\", errNewRequest)\n\t}\n\thttpReq.Header = cloneHeader(req.Headers)\n\tc.recordHTTPRequest(ctx, cfg, httpReq, req.Body)\n\tclient := helps.NewProxyAwareHTTPClient(ctx, cfg, c.auth, 0)\n\tif client == nil {\n\t\tclient = &http.Client{}","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/http_bridge.go#L92-L128","documentation":"Error \"host http client is unavailable\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/pluginhost/http_bridge.go:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the host HTTP client is configured before plugins issue HTTP requests.","Check plugin host initialization for the HTTP bridge wiring."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}