You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by أنس الليثي <de...@gmail.com> on 2015/03/08 12:59:32 UTC

Connecting PHP application to Hive Thrift Server 2

Dears

I am using this client <https://github.com/garamon/php-thrift-hive-client> to
connect to hive thrift server but the server is throwing the following
exception


*2015-03-08 14:54:15,097 ERROR org.apache.thrift.server.TThreadPoolServer:
Error occurred during processing of message.*
*java.lang.RuntimeException:
org.apache.thrift.transport.TTransportException: Invalid status -128*
* at
org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)*
* at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:227)*
* at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)*
* at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)*
* at java.lang.Thread.run(Thread.java:745)*
*Caused by: org.apache.thrift.transport.TTransportException: Invalid status
-128*
* at
org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:230)*
* at
org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:184)*
* at
org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)*
* at
org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:262)*
* at
org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)*
* at
org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)*
* ... 4 more*




Also the sample code I am using is below

*<?php*
*$GLOBALS['THRIFT_ROOT'] = dirname(__FILE__) . '/lib';*
*require_once $GLOBALS['THRIFT_ROOT'] .
'/packages/hive_service/ThriftHive.php';*
*require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';*
*require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';*
*require_once dirname(__FILE__) . '/ThriftHiveClientEx.php';*
*$transport = new TSocket('10.62.82.16', 10000);*
*$client = new ThriftHiveClientEx(new TBinaryProtocol($transport));*
*$transport->open();*
*$client->execute('SHOW TABLES');*
*var_dump($client->fetchAll());*
*$transport->close();*


Although when connecting using beeline everything works fine.

What is the problem here ?

-- 
Anas Rabei
Senior Software Developer
Mubasher.info
anas.rabei@mubasher.info

Re: Connecting PHP application to Hive Thrift Server 2

Posted by أنس الليثي <de...@gmail.com>.
thanks George for reply but I am using beeline to connect to Hive Server
without modifying anything and it works fine.

Also I have a java application that connects to the same server without
using any authentication and every thing works fine.


If you have any idea what the error message means kindly mention it.

Best regards

On 8 March 2015 at 20:22, George Livingston <ge...@gmail.com> wrote:

> Hi
>
> I think you need to set authentication value as NOSASL
>
> Regards
> George
> On Mar 8, 2015 5:29 PM, "أنس الليثي" <de...@gmail.com> wrote:
>
>> Dears
>>
>> I am using this client
>> <https://github.com/garamon/php-thrift-hive-client> to connect to hive
>> thrift server but the server is throwing the following exception
>>
>>
>> *2015-03-08 14:54:15,097 ERROR
>> org.apache.thrift.server.TThreadPoolServer: Error occurred during
>> processing of message.*
>> *java.lang.RuntimeException:
>> org.apache.thrift.transport.TTransportException: Invalid status -128*
>> * at
>> org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)*
>> * at
>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:227)*
>> * at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)*
>> * at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)*
>> * at java.lang.Thread.run(Thread.java:745)*
>> *Caused by: org.apache.thrift.transport.TTransportException: Invalid
>> status -128*
>> * at
>> org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:230)*
>> * at
>> org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:184)*
>> * at
>> org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)*
>> * at
>> org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:262)*
>> * at
>> org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)*
>> * at
>> org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)*
>> * ... 4 more*
>>
>>
>>
>>
>> Also the sample code I am using is below
>>
>> *<?php*
>> *$GLOBALS['THRIFT_ROOT'] = dirname(__FILE__) . '/lib';*
>> *require_once $GLOBALS['THRIFT_ROOT'] .
>> '/packages/hive_service/ThriftHive.php';*
>> *require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';*
>> *require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';*
>> *require_once dirname(__FILE__) . '/ThriftHiveClientEx.php';*
>> *$transport = new TSocket('10.62.82.16', 10000);*
>> *$client = new ThriftHiveClientEx(new TBinaryProtocol($transport));*
>> *$transport->open();*
>> *$client->execute('SHOW TABLES');*
>> *var_dump($client->fetchAll());*
>> *$transport->close();*
>>
>>
>> Although when connecting using beeline everything works fine.
>>
>> What is the problem here ?
>>
>> --
>> Anas Rabei
>> Senior Software Developer
>> Mubasher.info
>> anas.rabei@mubasher.info
>>
>


-- 
Anas Rabei
Senior Software Developer
Mubasher.info
anas.rabei@mubasher.info

Re: Connecting PHP application to Hive Thrift Server 2

Posted by George Livingston <ge...@gmail.com>.
Hi

I think you need to set authentication value as NOSASL

Regards
George
On Mar 8, 2015 5:29 PM, "أنس الليثي" <de...@gmail.com> wrote:

> Dears
>
> I am using this client <https://github.com/garamon/php-thrift-hive-client> to
> connect to hive thrift server but the server is throwing the following
> exception
>
>
> *2015-03-08 14:54:15,097 ERROR org.apache.thrift.server.TThreadPoolServer:
> Error occurred during processing of message.*
> *java.lang.RuntimeException:
> org.apache.thrift.transport.TTransportException: Invalid status -128*
> * at
> org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)*
> * at
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:227)*
> * at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)*
> * at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)*
> * at java.lang.Thread.run(Thread.java:745)*
> *Caused by: org.apache.thrift.transport.TTransportException: Invalid
> status -128*
> * at
> org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:230)*
> * at
> org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:184)*
> * at
> org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125)*
> * at
> org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:262)*
> * at
> org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41)*
> * at
> org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216)*
> * ... 4 more*
>
>
>
>
> Also the sample code I am using is below
>
> *<?php*
> *$GLOBALS['THRIFT_ROOT'] = dirname(__FILE__) . '/lib';*
> *require_once $GLOBALS['THRIFT_ROOT'] .
> '/packages/hive_service/ThriftHive.php';*
> *require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';*
> *require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';*
> *require_once dirname(__FILE__) . '/ThriftHiveClientEx.php';*
> *$transport = new TSocket('10.62.82.16', 10000);*
> *$client = new ThriftHiveClientEx(new TBinaryProtocol($transport));*
> *$transport->open();*
> *$client->execute('SHOW TABLES');*
> *var_dump($client->fetchAll());*
> *$transport->close();*
>
>
> Although when connecting using beeline everything works fine.
>
> What is the problem here ?
>
> --
> Anas Rabei
> Senior Software Developer
> Mubasher.info
> anas.rabei@mubasher.info
>