tagomoris / shib

WebUI for query engines: Hive and Presto
200 stars 59 forks source link

malformed THandleIdentifier error #5

Closed secsubs closed 10 years ago

secsubs commented 10 years ago

I am running this code against an Impala HiveServer2 instance (CDH 4.5). In the Impala service I have turned off sasl auth for the HiveServer2 service.

When I run the code, I get this error: [cloudera@cloudera-vm-1 search]$ NODE_PATH=/usr/local/node_modules/thrift/lib/thrift node hive_beeline_client.js connected { seq: 'fetchOperationResult', op: 'GetTables', err: null, res: { status: { statusCode: 3, infoMessages: null, sqlState: 'HY000', errorCode: null, errorMessage: 'Malformed THandleIdentifier (guid size: 30, expected 16, secret size: 26, expected 16)' }, operationHandle: { operationId: [Object], operationType: 4, hasResultSet: false, modifiedRowCount: null } } } [ { err: 'Failed to operate "GetTables"', res: { status: [Object], operationHandle: [Object] }, status: 3 }, undefined ]

/home/cloudera/node_modules/node-thrift/lib/thrift/connection.js:94 throw e; ^ TypeError: Cannot read property 'rows' of undefined at /home/cloudera/search/hive_beeline_client.js:74:35 at fetchOperationResult (/home/cloudera/search/hive_beeline_client.js:12:5) at /home/cloudera/search/hive_beeline_client.js:72:41 at client._reqs.(anonymous function) (/home/cloudera/node_modules/node-thrift/lib/thrift/connection.js:84:11) at Object.TCLIServiceClient.recv_GetTables (/home/cloudera/search/gen-nodejs/TCLIService.js:2122:12) at /home/cloudera/node_modules/node-thrift/lib/thrift/connection.js:87:37 at Socket. (/usr/local/node_modules/thrift/lib/thrift/transport.js:185:5) at Socket.EventEmitter.emit (events.js:95:17) at Socket. (_stream_readable.js:746:14) at Socket.EventEmitter.emit (events.js:92:17)

At the Impala server end, I see this in the logs: I0116 15:36:33.833312 11034 impala-hs2-server.cc:252] OpenSession(): request=TOpenSessionReq { 01: client_protocol (i32) = 0, 02: username (string) = "", 03: password (string) = "", } I0116 15:36:33.839167 11034 impala-hs2-server.cc:476] GetTables(): request=TGetTablesReq { 01: sessionHandle (struct) = TSessionHandle { 01: sessionId (struct) = THandleIdentifier { 01: guid (string) = "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x11\xef\xbf\xbd\xef\xbf\xbdN\xe4\xa8\xb9\x14\xef\xbf\xbd \xef\xbf\xbdy\b", 02: secret (string) = "\xc8\x9a\xef\xbf\xbdW}\xef\xbf\xbdG\xdf\xa7\n\xef\xbf\xbd\xef\xbf\xbdJ\tf\xef\xbf\xbd", }, }, } I0116 15:36:33.883034 11034 status.cc:44] Malformed THandleIdentifier (guid size: 30, expected 16, secret size: 26, expected 16) @ 0x6dd5ad (unknown) @ 0x79ff0b (unknown) @ 0x798011 (unknown) @ 0x799a38 (unknown) @ 0x906a5f (unknown) @ 0x8fa5d4 (unknown) @ 0x767c9e (unknown) @ 0x13363e9 (unknown) @ 0x13227ff (unknown) @ 0x13245a4 (unknown) @ 0x7070eb (unknown) @ 0x708a1e (unknown) @ 0x81e34c (unknown) @ 0x81f490 (unknown) @ 0xa6a804 (unknown) @ 0x7fa9326359d1 start_thread @ 0x7fa931977b6d clone I0116 15:36:33.883095 11034 impala-hs2-server.cc:489] GetTables(): return_val=TGetTablesResp { 01: status (struct) = TStatus { 01: statusCode (i32) = 3, 03: sqlState (string) = "HY000", 05: errorMessage (string) = "Malformed THandleIdentifier (guid size: 30, expected 16, secret size: 26, expected 16)", }, 02: operationHandle (struct) = TOperationHandle { 01: operationId (struct) = THandleIdentifier { 01: guid (string) = "", 02: secret (string) = "", }, 02: operationType (i32) = 4, 03: hasResultSet (bool) = false, }, } I0116 15:36:33.897066 11034 impala-server.cc:2164] Connection from client 127.0.0.1:34982 closed, closing 1 associated session(s) I0116 15:36:33.899447 11034 status.cc:44] Session closed @ 0x6dd5ad (unknown) @ 0x761577 (unknown) @ 0x7618c3 (unknown) @ 0x761b94 (unknown) @ 0x6fc277 (unknown) @ 0x1336533 (unknown) @ 0x13227ff (unknown) @ 0x13245a4 (unknown) @ 0x7070eb (unknown) @ 0x708a1e (unknown) @ 0x81e34c (unknown) @ 0x81f490 (unknown) @ 0xa6a804 (unknown) @ 0x7fa9326359d1 start_thread @ 0x7fa931977b6d clone

tagomoris commented 10 years ago

Are you using TCLIService.js and TCLIService_types.js generated on your own machine and thrift? Current version (and latest version) of Thrift has a bug to generate wrong code for binary strings, and in shib, I fixed code by hand. https://github.com/tagomoris/shib/commit/e682ea3cf6e216c80422dd524a450bc29d2dd019#diff-c0c12a1f158ff7bc2b0c3d0b0445f4a7

secsubs commented 10 years ago

yes, generated TCLIService.js and TCLIService_types.js on my machine with thrift. I will use the ones you generated and try again.

Where did you grab the Thrift IDL from, for HiveServer2?

secsubs commented 10 years ago

Thanks a bunch. I used your nodejs libs and it seems to work now.

tagomoris commented 10 years ago

Our TCLIService.js (and _types) are from Thrift IDL in hive-0.10.0-cdh4.2.0.tar.gz tarball. As far as i know, there are no compatibility problem in cdh 4.x HiveServer2.