{"record":{"id":"3e53c2360db001db","repo":"Tencent/WeKnora","slug":"docreader-service-not-connected","errorCode":null,"errorMessage":"docreader service not connected","messagePattern":"docreader service not connected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/grpc_parser.go","lineNumber":108,"sourceCode":"\treturn p.connect(addr)\n}\n\nfunc (p *GRPCDocumentReader) IsConnected() bool {\n\tp.mu.RLock()\n\tdefer p.mu.RUnlock()\n\treturn p.conn != nil\n}\n\nfunc (p *GRPCDocumentReader) Close() error {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tif p.conn != nil {\n\t\treturn p.conn.Close()\n\t}\n\treturn nil\n}\n\nvar errNotConnected = fmt.Errorf(\"docreader service not connected\")\n\nfunc (p *GRPCDocumentReader) Read(ctx context.Context, req *types.ReadRequest) (*types.ReadResult, error) {\n\tp.mu.RLock()\n\tclient := p.client\n\tp.mu.RUnlock()\n\tif client == nil {\n\t\treturn nil, errNotConnected\n\t}\n\n\tprotoReq := &proto.ReadRequest{\n\t\tFileContent: req.FileContent,\n\t\tFileName:    req.FileName,\n\t\tFileType:    req.FileType,\n\t\tUrl:         req.URL,\n\t\tTitle:       req.Title,\n\t\tRequestId:   req.RequestID,\n\t\tConfig: &proto.ReadConfig{\n\t\t\tParserEngine:          req.ParserEngine,","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/grpc_parser.go#L90-L126","documentation":"Sentinel error errNotConnected returned when the GRPCDocumentReader has no established gRPC connection (client is nil under the read lock), or when remoteReader in engine_registry gets no remote reader. It indicates the docparser was never connected or Reconnect was not performed.","triggerScenarios":"Thrown at internal/infrastructure/docparser/grpc_parser.go:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call Reconnect/NewGRPCDocumentReader with a valid address before reading","Check IsConnected() before dispatching document reads","Verify remote docparser configuration in the engine registry"],"exampleFix":null,"handlingStrategy":"type-guard","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"}