You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by lei liu <li...@gmail.com> on 2010/08/23 09:37:26 UTC

java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Hello everyone,


I use JDBC to connection the hive server, sometime I receive below
exception:
java.sql.SQLException: org.apache.thrift.transport.TTransportException:
Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0
bytes.

Please tell me the eason.


Thanks


LiuLei

RE: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Posted by Bennie Schut <bs...@ebuddy.com>.
Others probably have more insight on this but at least you narrowed it down to the meta store. I've had some concurrency issues with the metastore myself (HIVE-1539) so perhaps you are running into something similar? Perhaps there are some different errors before you see this error/warning like trying to reconnect? I know mysql gave us some problems as a metastore disconnecting connections after a wait_time expired in the past.

________________________________
From: lei liu [mailto:liulei412@gmail.com]
Sent: Monday, August 23, 2010 10:25 AM
To: hive-user@hadoop.apache.org
Subject: Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Hi [images/cleardot.gif] [images/cleardot.gif] Bennie,
Thank you for your reply

I see there is below exception in hive.log :
10/08/23 14:06:23 INFO Datastore.Retrieve: Object with id "3211[OID]org.apache.hadoop.hive.metastore.model.MStorageDescriptor" not found !
10/08/23 14:06:23 ERROR server.TThreadPoolServer: Error occurred during processing of message.
java.lang.RuntimeException: org.apache.thrift.TException: org.apache.thrift.TException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at org.apache.hadoop.hive.service.HiveServer$ThriftHiveProcessorFactory.getProcessor(HiveServer.java:397)
        at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:245)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.thrift.TException: org.apache.thrift.TException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.<init>(HiveServer.java:109)
        at org.apache.hadoop.hive.service.HiveServer$ThriftHiveProcessorFactory.getProcessor(HiveServer.java:394)
        ... 4 more
Caused by: org.apache.thrift.TException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.verify(HiveServer.java:369)
        at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.<init>(HiveServer.java:106)
        ... 5 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at org.apache.hadoop.hive.ql.metadata.Hive.getUser(Hive.java:363)
        at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.verify(HiveServer.java:365)
        ... 6 more
Caused by: javax.jdo.JDOObjectNotFoundException: No such database row
FailedObject:3211[OID]org.apache.hadoop.hive.metastore.model.MStorageDescriptor
        at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:308)
        at org.datanucleus.jdo.JDOTransaction.commit(JDOTransaction.java:132)
        at org.apache.hadoop.hive.metastore.ObjectStore.commitTransaction(ObjectStore.java:229)
        at org.apache.hadoop.hive.metastore.ObjectStore.getUser(ObjectStore.java:944)
        at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_user(HiveMetaStore.java:324)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getUser(HiveMetaStoreClient.java:318)
        at org.apache.hadoop.hive.ql.metadata.Hive.getUser(Hive.java:352)
        ... 7 more

what is mean the exception?
2010/8/23 Bennie Schut <bs...@ebuddy.com>>
The real reason is probably in the log of the hiveserver. It should be in the console you started the hiveserver in. I sometimes start it like this:
nohup ./hive --service hiveserver >hive.log &
Which would show you some errors in the hive.log file.
We used to have some problems with PermGen issues because of a classloading/unloading issue in one of our udfs which would show itself with an error like this. It is however a pretty generic error which is telling you the "hiveserver" is probably having a problem and you need to take a look at the logs.

________________________________
From: lei liu [mailto:liulei412@gmail.com<ma...@gmail.com>]
Sent: Monday, August 23, 2010 9:48 AM
To: hive-user@hadoop.apache.org<ma...@hadoop.apache.org>
Subject: Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Yes, you are right. I do that, but after the hive server run several days, when client connection the hive server, the client receive the exception.
2010/8/23 Adarsh Sharma <ad...@orkash.com>>
For Running Hive in Server Mode ..
First U have to start service of hiveserver ::


*$bin/hive --service hiveserver
*

and then run the code


lei liu wrote:
Hello everyone,


I use JDBC to connection the hive server, sometime I receive below exception:
java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Please tell me the eason.


Thanks


LiuLei




Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Posted by lei liu <li...@gmail.com>.
Hi Bennie,
Thank you for your reply

I see there is below exception in hive.log :
10/08/23 14:06:23 INFO Datastore.Retrieve: Object with id
"3211[OID]org.apache.hadoop.hive.metastore.model.MStorageDescriptor" not
found !
10/08/23 14:06:23 ERROR server.TThreadPoolServer: Error occurred during
processing of message.
java.lang.RuntimeException: org.apache.thrift.TException:
org.apache.thrift.TException:
org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at
org.apache.hadoop.hive.service.HiveServer$ThriftHiveProcessorFactory.getProcessor(HiveServer.java:397)
        at
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:245)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.thrift.TException: org.apache.thrift.TException:
org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at
org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.<init>(HiveServer.java:109)
        at
org.apache.hadoop.hive.service.HiveServer$ThriftHiveProcessorFactory.getProcessor(HiveServer.java:394)
        ... 4 more
Caused by: org.apache.thrift.TException:
org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch user root
        at
org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.verify(HiveServer.java:369)
        at
org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.<init>(HiveServer.java:106)
        ... 5 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch
user root
        at org.apache.hadoop.hive.ql.metadata.Hive.getUser(Hive.java:363)
        at
org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.verify(HiveServer.java:365)
        ... 6 more
Caused by: javax.jdo.JDOObjectNotFoundException: No such database row
FailedObject:3211[OID]org.apache.hadoop.hive.metastore.model.MStorageDescriptor
        at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:308)
        at
org.datanucleus.jdo.JDOTransaction.commit(JDOTransaction.java:132)
        at
org.apache.hadoop.hive.metastore.ObjectStore.commitTransaction(ObjectStore.java:229)
        at
org.apache.hadoop.hive.metastore.ObjectStore.getUser(ObjectStore.java:944)
        at
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_user(HiveMetaStore.java:324)
        at
org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getUser(HiveMetaStoreClient.java:318)
        at org.apache.hadoop.hive.ql.metadata.Hive.getUser(Hive.java:352)
        ... 7 more

what is mean the exception?

2010/8/23 Bennie Schut <bs...@ebuddy.com>

>  The real reason is probably in the log of the hiveserver. It should be in
> the console you started the hiveserver in. I sometimes start it like this:
>
> nohup ./hive --service hiveserver >hive.log &
>
> Which would show you some errors in the hive.log file.
>
> We used to have some problems with PermGen issues because of a
> classloading/unloading issue in one of our udfs which would show itself with
> an error like this. It is however a pretty generic error which is telling
> you the "hiveserver" is probably having a problem and you need to take a
> look at the logs.
>
>
>  ------------------------------
>
> *From:* lei liu [mailto:liulei412@gmail.com]
> *Sent:* Monday, August 23, 2010 9:48 AM
> *To:* hive-user@hadoop.apache.org
> *Subject:* Re: java.sql.SQLException:
> org.apache.thrift.transport.TTransportException: Cannot read. Remote side
> has closed. Tried to read 1 bytes, but only got 0 bytes.
>
>
>
> Yes, you are right. I do that, but after the hive server run several days,
> when client connection the hive server, the client receive the exception.
>
> 2010/8/23 Adarsh Sharma <ad...@orkash.com>
>
> For Running Hive in Server Mode ..
> First U have to start service of hiveserver ::
>
>
> *$bin/hive --service hiveserver
> *
>
> and then run the code
>
>
>
> lei liu wrote:
>
> Hello everyone,
>
>
> I use JDBC to connection the hive server, sometime I receive below
> exception:
> java.sql.SQLException: org.apache.thrift.transport.TTransportException:
> Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0
> bytes.
>
> Please tell me the eason.
>
>
> Thanks
>
>
> LiuLei
>
>
>
>
>

RE: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Posted by Bennie Schut <bs...@ebuddy.com>.
The real reason is probably in the log of the hiveserver. It should be in the console you started the hiveserver in. I sometimes start it like this:
nohup ./hive --service hiveserver >hive.log &
Which would show you some errors in the hive.log file.
We used to have some problems with PermGen issues because of a classloading/unloading issue in one of our udfs which would show itself with an error like this. It is however a pretty generic error which is telling you the "hiveserver" is probably having a problem and you need to take a look at the logs.

________________________________
From: lei liu [mailto:liulei412@gmail.com]
Sent: Monday, August 23, 2010 9:48 AM
To: hive-user@hadoop.apache.org
Subject: Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Yes, you are right. I do that, but after the hive server run several days, when client connection the hive server, the client receive the exception.
2010/8/23 Adarsh Sharma <ad...@orkash.com>>
For Running Hive in Server Mode ..
First U have to start service of hiveserver ::


*$bin/hive --service hiveserver
*

and then run the code


lei liu wrote:
Hello everyone,


I use JDBC to connection the hive server, sometime I receive below exception:
java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Please tell me the eason.


Thanks


LiuLei



Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Posted by lei liu <li...@gmail.com>.
Yes, you are right. I do that, but after the hive server run several days,
when client connection the hive server, the client receive the exception.

2010/8/23 Adarsh Sharma <ad...@orkash.com>

> For Running Hive in Server Mode ..
> First U have to start service of hiveserver ::
>
>
> *$bin/hive --service hiveserver
> *
>
> and then run the code
>
>
> lei liu wrote:
>
>> Hello everyone,
>>
>>
>> I use JDBC to connection the hive server, sometime I receive below
>> exception:
>> java.sql.SQLException: org.apache.thrift.transport.TTransportException:
>> Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0
>> bytes.
>>
>> Please tell me the eason.
>>
>>
>> Thanks
>>
>>
>> LiuLei
>>
>
>

Re: java.sql.SQLException: org.apache.thrift.transport.TTransportException: Cannot read. Remote side has closed. Tried to read 1 bytes, but only got 0 bytes.

Posted by Adarsh Sharma <ad...@orkash.com>.
For Running Hive in Server Mode ..
First U have to start service of hiveserver ::


*$bin/hive --service hiveserver
*

and then run the code

lei liu wrote:
> Hello everyone,
>
>
> I use JDBC to connection the hive server, sometime I receive below 
> exception:
> java.sql.SQLException: 
> org.apache.thrift.transport.TTransportException: Cannot read. Remote 
> side has closed. Tried to read 1 bytes, but only got 0 bytes.
>
> Please tell me the eason.
>
>
> Thanks
>
>
> LiuLei