{"record":{"id":"7c7a993479128b1f","repo":"Tencent/WeKnora","slug":"failed-to-connect-to-docreader-w","errorCode":null,"errorMessage":"failed to connect to docreader: %w","messagePattern":"failed to connect to docreader: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/grpc_parser.go","lineNumber":70,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to build docreader dial options: %w\", err)\n\t}\n\tif authConfig.TLSEnabled {\n\t\tlogger.Infof(context.Background(), \"TLS enabled for docreader gRPC client\")\n\t}\n\tif authConfig.AuthToken != \"\" {\n\t\tlogger.Infof(context.Background(),\n\t\t\t\"Token authentication enabled for docreader gRPC client (TLS=%v)\",\n\t\t\tauthConfig.TLSEnabled,\n\t\t)\n\t}\n\n\tresolver.SetDefaultScheme(\"dns\")\n\n\tstart := time.Now()\n\tconn, err := grpc.Dial(\"dns:///\"+addr, opts...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to docreader: %w\", err)\n\t}\n\tlogger.Infof(context.Background(), \"Connected to docreader in %v\", time.Since(start))\n\n\tp.conn = conn\n\tp.client = proto.NewDocReaderClient(conn)\n\tp.addr = addr\n\treturn nil\n}\n\nfunc (p *GRPCDocumentReader) Reconnect(addr string) error {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tif p.conn != nil {\n\t\t_ = p.conn.Close()\n\t\tp.conn = nil\n\t\tp.client = nil\n\t\tp.addr = \"\"","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/grpc_parser.go#L52-L88","documentation":"Connection error in the docreader gRPC client's connect: grpc.Dial to 'dns:///'+addr failed, so no client connection to the document reader service exists. The %w wraps the gRPC status error; raised from NewGRPCDocumentReader and Reconnect whenever the docreader endpoint is unreachable or the dial is rejected.","triggerScenarios":"Thrown at internal/infrastructure/docparser/grpc_parser.go:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the docreader address format and DNS resolution","Check the auth config's transport credentials are valid","Retry via Reconnect once the address/config is corrected"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}