Support Questions

Find answers, ask questions, and share your expertise

Hue hbase Api Error: TSocket read 0 bytes

Contributor

After enabling hbase 

Enable HBase Thrift Server Framed Transport
HUE connection to view Hbase tables returns hbase Api Error: TSocket read 0 bytes
on just getting a table list
 
1 ACCEPTED SOLUTION

Contributor

Solved - 

Cannot use Thrift2

Enable HBase Thrift Server Framed Transport hbase.regionserver.thrift.framed true

HBase Thrift Server Type hbase.regionserver.thrift.server.type must be TThreadPoolServer


cannot use THsHaServer or TNonblockingServer or framed transport

View solution in original post

22 REPLIES 22

Contributor

Solved - 

Cannot use Thrift2

Enable HBase Thrift Server Framed Transport hbase.regionserver.thrift.framed true

HBase Thrift Server Type hbase.regionserver.thrift.server.type must be TThreadPoolServer


cannot use THsHaServer or TNonblockingServer or framed transport

Yes, the HBase app works with Thrift 1 only:
http://gethue.com/the-web-ui-for-hbase-hbase-browser/

Romain

Contributor

Any plans to move to thrift2

or framed transport  for large scale search

We support Framed transport already, and HBase Thrift 2 is far from
finished/ready so there is not plan to support it yet.

Romain


[hbase]
# Comma-separated list of HBase Thrift servers for clusters in the format
of '(name|host:port)'.
# Use full hostname with security.
## hbase_clusters=(Cluster|localhost:9090)

# HBase configuration directory, where hbase-site.xml is located.
## hbase_conf_dir=/etc/hbase/conf

# Hard limit of rows or columns per row fetched before truncating.
## truncate_limit = 500

# 'buffered' is the default of the HBase Thrift Server and supports
security.
# 'framed' can be used to chunk up responses,
# which is useful when used in conjunction with the nonblocking server in
Thrift.
## thrift_transport=buffered


Explorer

I am facing issue while connecting hbase through hue.

 

Api Error: TSocket read 0 bytes

 

I checked the hbase propertyies

 

Transport hbase.regionserver.thrift.framed=true.

hbase.regionserver.thrift.server.type = TThreadPoolServer.

 

hbase is running with above configuration, but still not working,

 

still what need to change. to access the hbase through hue.

Recently we updated from cdh5.1 to 5.2

 

After updation impala also not working.

 

Cloudera Employee

Hi Purna,

      Can you check if the Hue service is configured correctly for HBase service/HBase Thrift server?

 

Below is a screenshot for environment where this works.HueHbase-config.png

Explorer

Thanks for response

 

ya i checked in hue conf, it  is configuried   Hbase Service with HBase only and thrift server as well and thrift server is running.

 

Do we need to change any thing  in hue.ini file.

Explorer

For above message adding the error log

 

Please help me out how to work around.

 

 

/hbase
...skipping
[14/Dec/2014 22:50:07 -0800] views        ERROR    TSocket read 0 bytes (code THRIFTTRANSPORT): TTransportException('TSocket read 0 bytes',)
Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/views.py", line 132, in install_examples
    hbase_setup.Command().handle_noargs()
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/management/commands/hbase_setup.py", line 43, in handle_noargs
    self.create_analytics_table(api, cluster_name)
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/management/commands/hbase_setup.py", line 52, in create_analytics_table
    api.createTable(cluster_name, 'analytics_demo', [{'properties': {'name': 'hour'}}, {'properties': {'name': 'day'}}, {'properties': {'name': 'total'}}])
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/api.py", line 121, in createTable
    client.createTable(tableName, [get_thrift_type('ColumnDescriptor')(**column['properties']) for column in columns])
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/desktop/core/src/desktop/lib/thrift_util.py", line 338, in wrapper
    raise StructuredThriftTransportException(e, error_code=502)

Explorer

Advance log for above error

 

 

 middleware   INFO     Processing exception: Api Error: TSocket read 0 bytes: Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py",
line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/views.py", line 77, in api_router
    return api_dump(HbaseApi().query(*url_params))
  File "/opt/cloudera/parcels/CDH-5.2.0-1.cdh5.2.0.p0.36/lib/hue/apps/hbase/src/hbase/api.py", line 51, in query
    raise PopupException(_("Api Error: %s") % e.message)
PopupException: Api Error: TSocket read 0 bytes

 

could you please give a solution on above issue

Cloudera Employee

You do not need to add anything to hue.ini (Cloudera Manager configures this for you).

 

Suspect some dependency is not right when you added Hue. Can you delete and add Hue service again with proper dependencies?

 

AddHue.png

Yes and also please share the list of instances you have in the HBase
service in CM.

Romain

New Contributor

Hi Romain

 

I have a Cloudera manager 5.2 cluster with one namenode and three datanodes.I have encountered a similar issue (Api Error: TSocket read 0 bytes) while starting hbase in hue.I have followed your blog and have made  required changes but still the issue is not resolved.I have deployed thrift instance and region server for datanode and namenode in hbase.I have tried reinstalling hue but failed. All service are working independently from command line Ex hbase shell,impala-shell etc. Could you please help me to resolve this issue.?

 

Expert Contributor

Go to the http://<hueserver>:<port>/desktop/dump_config and in the "Configuration Sections and Variables" section go to hbase and confirm that "hbase_clusters" points to the correct thrift server. If that's not correct, confirm in the Hue service-wide config that you have the Hbase service selected. If that is correct, then go to the Hbase service configuration and check to see if this property is enabled, "Enable HBase Thrift Server Framed Transport".  If it is, try unchecking it and restarting the Hbase thrift server and see if that works.



Thank you CConner. The above solution works. 

I ensured again that the correct Hbase Thrift server was being used. I then went to the Hbase Thrift server Configuration, unchecked the "Enable Hbase Thrift Server Framed Transport" (hbase.regionserver.thrift.framed) and restarted the Thrift server. It was only after this that the "Api socket error" on Hue disappeared and I was able to view the Hbase tables on Hue.

Appreciate all your help! 

 

Regards,

Yogesh

 

Expert Contributor

Glad to hear that worked!  Hue doesn't currently support Framed Thrift to Hbase.  It's on the roadmap, but not sure when.

Good to know!

'framed' should work be it would need to be set in the Hue config too:

[hbase]
...

# 'buffered' is the default of the HBase Thrift Server and supports
security.
# 'framed' can be used to chunk up responses,
# which is useful when used in conjunction with the nonblocking server in
Thrift.
## thrift_transport=buffered


Romain

Explorer

I done same changes, but still not working please let me know still need to change more.

Could you share the hbase-site.xml and the hue.ini?

Explorer

Could you please tell me where need to attach the files. I can see there only image files there.

 

 

When i am copying entire files content its throwing please enter valied URI .Please let me know how share files. 

Master Collaborator

That's odd that it's throwing that error.  It's true that only image files can be attached, but you can try to place the contents of the files you're trying to send us inside a "Code" block.  There's a little button on the rich text editor for inserting code.  This should not try to render your file contents as HTML and let you proceed.