{"record":{"id":"c2a9b0b19e1bacb0","repo":"grafana/k6","slug":"failed-to-dial-w","errorCode":null,"errorMessage":"failed to dial: %w","messagePattern":"failed to dial: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloudapi/insights/client.go","lineNumber":153,"sourceCode":"func (c *Client) Dial(ctx context.Context) error {\n\tc.connMu.Lock()\n\tdefer c.connMu.Unlock()\n\n\tif c.conn != nil {\n\t\treturn ErrClientAlreadyInitialized\n\t}\n\n\topts, err := dialOptionsFromClientConfig(c.cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create dial options: %w\", err)\n\t}\n\n\tctx, cancel := context.WithTimeout(ctx, c.cfg.ConnectConfig.Timeout)\n\tdefer cancel()\n\n\tconn, err := grpc.DialContext(ctx, c.cfg.IngesterHost, opts...) //nolint:staticcheck\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to dial: %w\", err)\n\t}\n\n\tc.client = ingester.NewIngesterServiceClient(conn)\n\tc.conn = conn\n\n\treturn nil\n}\n\n// IngestRequestMetadatasBatch ingests a batch of request metadatas.\nfunc (c *Client) IngestRequestMetadatasBatch(ctx context.Context, requestMetadatas RequestMetadatas) error {\n\tc.connMu.RLock()\n\tclosed := c.conn == nil\n\tc.connMu.RUnlock()\n\tif closed {\n\t\treturn ErrClientClosed\n\t}\n\n\tif len(requestMetadatas) < 1 {","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cloudapi/insights/client.go#L135-L171","documentation":"Wrapped error from the Insights client's Dial: grpc.DialContext to the configured ingester host failed within the connect timeout. The cause may be DNS, network, TLS, or authentication failure to the Insights ingester service.","triggerScenarios":"Thrown at internal/cloudapi/insights/client.go:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the K6_INSIGHTS_INGESTER_HOST (or equivalent) address is reachable","Check network/firewall and TLS settings for the ingester endpoint","Increase the connect timeout if the ingester is slow to accept connections"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}