You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Andy Sykes <an...@forward3d.com> on 2013/10/14 18:44:23 UTC

ClassCastExceptions using Hiveserver2 Thrift interface, Hive 0.11

Hi there,

We're using the rbhive gem (https://github.com/forward3d/rbhive) to connect
to the Hiveserver2 Thrift service running on Hive 0.11.

I've turned SASL auth off with the following in hive-site.xml:

<property>
  <name>hive.server2.authentication</name>
  <value>NOSASL</value>
</property>

When I connect, I get the following stack trace in the Hiveserver2 logs:

13/10/14 17:42:17 ERROR server.TThreadPoolServer: Error occurred during
processing of message.
java.lang.ClassCastException: org.apache.thrift.transport.TSocket cannot be
cast to org.apache.thrift.transport.TSaslServerTransport
  at
org.apache.hive.service.auth.TUGIContainingProcessor.process(TUGIContainingProcessor.java:35)
  at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
  at java.lang.Thread.run(Thread.java:662)

This didn't happen with Hive 0.10 - we could connect with SASL turned off
without a problem.

Can anyone shed any light on this?

-- 
*Andy Sykes*
DevOps Engineer

+4420 7806 5904
+4475 9005 2109

19 Mandela Street
Floor 2, Centro 3
London
NW1 0DU

Privacy & Email Policy <http://forward3d.com/terms.html>

Re: ClassCastExceptions using Hiveserver2 Thrift interface, Hive 0.11

Posted by Vaibhav Gumashta <vg...@hortonworks.com>.
Hi Andy,

Using Http over Thrift is currently a feature in development and has
limited functionality. As of now, it does not support doAs and works with
only NOSASL authentication mode set on the server side. There is a
follow-up JIRA (https://issues.apache.org/jira/browse/HIVE-4764) which will
add support for authentication modes.

Thanks,
--Vaibhav


On Wed, Oct 23, 2013 at 8:31 AM, Andy Sykes <an...@forward3d.com>wrote:

> I found a solution.
>
> In testing, I tried out the HTTPClientTransport that's now supported for
> Thrift in Hive 0.12. This required me to set the Hive conf var
> hive.server2.enable.doAs to false in order for it to work. When I reverted
> back to using the BufferedTransport, with this property in my
> hive-site.xml, I found the Thrift interface no longer threw
> ClassCastExceptions.
>
> I have no idea if this is a bug, or by design.
>
>
> On 21 October 2013 11:54, David Morel <da...@amakuru.net> wrote:
>
>> We have it working fine with hive 0.11, not tested with 0.12. I'll have a
>> look this week.
>>
>> David Morel
>>
>>
>> On 21 octobre 2013 at 11:57:03, Andy Sykes (andy.sykes@forward3d.com<//...@forward3d.com>)
>> wrote:
>>
>>  I can report I see this same error when working with the Perl thrift
>> Hive client (
>> http://search.cpan.org/~dmor/Thrift-API-HiveClient2-0.011/lib/Thrift/API/HiveClient2.pm),
>> and with the newly released Hive 0.12.0.
>>
>> Is anyone successfully using Hiveserver2, or do I have something odd in
>> my environment?
>>
>>
>> On 14 October 2013 17:44, Andy Sykes <an...@forward3d.com> wrote:
>>
>>> Hi there,
>>>
>>> We're using the rbhive gem (https://github.com/forward3d/rbhive) to
>>> connect to the Hiveserver2 Thrift service running on Hive 0.11.
>>>
>>> I've turned SASL auth off with the following in hive-site.xml:
>>>
>>>  <property>
>>>   <name>hive.server2.authentication</name>
>>>   <value>NOSASL</value>
>>> </property>
>>>
>>> When I connect, I get the following stack trace in the Hiveserver2 logs:
>>>
>>>  13/10/14 17:42:17 ERROR server.TThreadPoolServer: Error occurred
>>> during processing of message.
>>> java.lang.ClassCastException: org.apache.thrift.transport.TSocket cannot
>>> be cast to org.apache.thrift.transport.TSaslServerTransport
>>>   at
>>> org.apache.hive.service.auth.TUGIContainingProcessor.process(TUGIContainingProcessor.java:35)
>>>   at
>>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
>>>   at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>>   at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>>   at java.lang.Thread.run(Thread.java:662)
>>>
>>> This didn't happen with Hive 0.10 - we could connect with SASL turned
>>> off without a problem.
>>>
>>> Can anyone shed any light on this?
>>>
>>> --
>>> *Andy Sykes*
>>> DevOps Engineer
>>>
>>> +4420 7806 5904
>>> +4475 9005 2109
>>>
>>> 19 Mandela Street
>>> Floor 2, Centro 3
>>> London
>>> NW1 0DU
>>>
>>> Privacy & Email Policy <http://forward3d.com/terms.html>
>>>
>>
>>
>>
>> --
>> *Andy Sykes*
>> DevOps Engineer
>>
>> +4420 7806 5904
>> +4475 9005 2109
>>
>> 19 Mandela Street
>> Floor 2, Centro 3
>> London
>> NW1 0DU
>>
>> Privacy & Email Policy <http://forward3d.com/terms.html>
>>
>>
>
>
> --
> *Andy Sykes*
> DevOps Engineer
>
> +4420 7806 5904
> +4475 9005 2109
>
> 19 Mandela Street
> Floor 2, Centro 3
> London
> NW1 0DU
>
> Privacy & Email Policy <http://forward3d.com/terms.html>
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: ClassCastExceptions using Hiveserver2 Thrift interface, Hive 0.11

Posted by Andy Sykes <an...@forward3d.com>.
I found a solution.

In testing, I tried out the HTTPClientTransport that's now supported for
Thrift in Hive 0.12. This required me to set the Hive conf var
hive.server2.enable.doAs to false in order for it to work. When I reverted
back to using the BufferedTransport, with this property in my
hive-site.xml, I found the Thrift interface no longer threw
ClassCastExceptions.

I have no idea if this is a bug, or by design.


On 21 October 2013 11:54, David Morel <da...@amakuru.net> wrote:

> We have it working fine with hive 0.11, not tested with 0.12. I'll have a
> look this week.
>
> David Morel
>
>
> On 21 octobre 2013 at 11:57:03, Andy Sykes (andy.sykes@forward3d.com<//...@forward3d.com>)
> wrote:
>
> I can report I see this same error when working with the Perl thrift Hive
> client (
> http://search.cpan.org/~dmor/Thrift-API-HiveClient2-0.011/lib/Thrift/API/HiveClient2.pm),
> and with the newly released Hive 0.12.0.
>
> Is anyone successfully using Hiveserver2, or do I have something odd in my
> environment?
>
>
> On 14 October 2013 17:44, Andy Sykes <an...@forward3d.com> wrote:
>
>> Hi there,
>>
>> We're using the rbhive gem (https://github.com/forward3d/rbhive) to
>> connect to the Hiveserver2 Thrift service running on Hive 0.11.
>>
>> I've turned SASL auth off with the following in hive-site.xml:
>>
>>  <property>
>>   <name>hive.server2.authentication</name>
>>   <value>NOSASL</value>
>> </property>
>>
>> When I connect, I get the following stack trace in the Hiveserver2 logs:
>>
>>  13/10/14 17:42:17 ERROR server.TThreadPoolServer: Error occurred during
>> processing of message.
>> java.lang.ClassCastException: org.apache.thrift.transport.TSocket cannot
>> be cast to org.apache.thrift.transport.TSaslServerTransport
>>   at
>> org.apache.hive.service.auth.TUGIContainingProcessor.process(TUGIContainingProcessor.java:35)
>>   at
>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
>>   at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>   at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>   at java.lang.Thread.run(Thread.java:662)
>>
>> This didn't happen with Hive 0.10 - we could connect with SASL turned off
>> without a problem.
>>
>> Can anyone shed any light on this?
>>
>> --
>> *Andy Sykes*
>> DevOps Engineer
>>
>> +4420 7806 5904
>> +4475 9005 2109
>>
>> 19 Mandela Street
>> Floor 2, Centro 3
>> London
>> NW1 0DU
>>
>> Privacy & Email Policy <http://forward3d.com/terms.html>
>>
>
>
>
> --
> *Andy Sykes*
> DevOps Engineer
>
> +4420 7806 5904
> +4475 9005 2109
>
> 19 Mandela Street
> Floor 2, Centro 3
> London
> NW1 0DU
>
> Privacy & Email Policy <http://forward3d.com/terms.html>
>
>


-- 
*Andy Sykes*
DevOps Engineer

+4420 7806 5904
+4475 9005 2109

19 Mandela Street
Floor 2, Centro 3
London
NW1 0DU

Privacy & Email Policy <http://forward3d.com/terms.html>

Re: ClassCastExceptions using Hiveserver2 Thrift interface, Hive 0.11

Posted by Andy Sykes <an...@forward3d.com>.
I can report I see this same error when working with the Perl thrift Hive
client (
http://search.cpan.org/~dmor/Thrift-API-HiveClient2-0.011/lib/Thrift/API/HiveClient2.pm),
and with the newly released Hive 0.12.0.

Is anyone successfully using Hiveserver2, or do I have something odd in my
environment?


On 14 October 2013 17:44, Andy Sykes <an...@forward3d.com> wrote:

> Hi there,
>
> We're using the rbhive gem (https://github.com/forward3d/rbhive) to
> connect to the Hiveserver2 Thrift service running on Hive 0.11.
>
> I've turned SASL auth off with the following in hive-site.xml:
>
> <property>
>   <name>hive.server2.authentication</name>
>   <value>NOSASL</value>
> </property>
>
> When I connect, I get the following stack trace in the Hiveserver2 logs:
>
> 13/10/14 17:42:17 ERROR server.TThreadPoolServer: Error occurred during
> processing of message.
> java.lang.ClassCastException: org.apache.thrift.transport.TSocket cannot
> be cast to org.apache.thrift.transport.TSaslServerTransport
>   at
> org.apache.hive.service.auth.TUGIContainingProcessor.process(TUGIContainingProcessor.java:35)
>   at
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:206)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>   at java.lang.Thread.run(Thread.java:662)
>
> This didn't happen with Hive 0.10 - we could connect with SASL turned off
> without a problem.
>
> Can anyone shed any light on this?
>
> --
> *Andy Sykes*
> DevOps Engineer
>
> +4420 7806 5904
> +4475 9005 2109
>
> 19 Mandela Street
> Floor 2, Centro 3
> London
> NW1 0DU
>
> Privacy & Email Policy <http://forward3d.com/terms.html>
>



-- 
*Andy Sykes*
DevOps Engineer

+4420 7806 5904
+4475 9005 2109

19 Mandela Street
Floor 2, Centro 3
London
NW1 0DU

Privacy & Email Policy <http://forward3d.com/terms.html>