title: Hue connect to hiveserver2 via http
body: <p>I'm trying to connect Hue to Hiveserver2 via http. I use Hue 3.7 (github version) and Hive 0.13.1.</p>
  
  <p>This is my hive-site.xml configuration:</p>
  
  <pre><code>&lt;property&gt;
    &lt;name&gt;hive.server2.transport.mode&lt;/name&gt;
    &lt;value&gt;http&lt;/value&gt;
    &lt;description&gt;Server transport mode. "binary" or "http".&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.server2.thrift.http.port&lt;/name&gt;
    &lt;value&gt;10001&lt;/value&gt;
    &lt;description&gt;Port number when in HTTP mode.&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.server2.thrift.http.path&lt;/name&gt;
    &lt;value&gt;cliservice&lt;/value&gt;
    &lt;description&gt;Path component of URL endpoint when in HTTP mode.&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.server2.thrift.http.min.worker.threads&lt;/name&gt;
    &lt;value&gt;5&lt;/value&gt;
    &lt;description&gt;Minimum number of worker threads when in HTTP mode.&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
    &lt;name&gt;hive.server2.thrift.http.max.worker.threads&lt;/name&gt;
    &lt;value&gt;500&lt;/value&gt;
    &lt;description&gt;Maximum number of worker threads when in HTTP mode.&lt;/description&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>I used this instruction:
  <a href="https://groups.google.com/a/cloudera.org/forum/#!topic/hue-user/ghdFwSuUDfE" rel="nofollow">https://groups.google.com/a/cloudera.org/forum/#!topic/hue-user/ghdFwSuUDfE</a>
  but it doesn't work. When I start Hue and click Metastore Table  I get an error message: </p>
  
  <pre><code>TSocket read 0 bytes
  </code></pre>
  
  <p>This is traceback:</p>
  
  <pre><code>[15/Jan/2015 11:53:32 +0100] middleware   INFO     Processing exception: TSocket read 0 bytes (code THRIFTTRANSPORT): TTransportException('TSocket read 0 bytes',): Traceback (most recent call last):
    File "/opt/hue_3.7/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/hue_3.7/apps/metastore/src/metastore/views.py", line 108, in show_tables
      databases = db.get_databases()
    File "/opt/hue_3.7/apps/beeswax/src/beeswax/server/dbms.py", line 123, in get_databases
      return self.client.get_databases()
    File "/opt/hue_3.7/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 813, in get_databases
      return [table[col] for table in self._client.get_databases()]
    File "/opt/hue_3.7/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 480, in get_databases
      res = self.call(self._client.GetSchemas, req)
    File "/opt/hue_3.7/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 443, in call
      session = self.open_session(self.user)
    File "/opt/hue_3.7/apps/beeswax/src/beeswax/server/hive_server2_lib.py", line 417, in open_session
      res = self._client.OpenSession(req)
    File "/opt/hue_3.7/desktop/core/src/desktop/lib/thrift_util.py", line 340, in wrapper
      raise StructuredThriftTransportException(e, error_code=502)
  StructuredThriftTransportException: TSocket read 0 bytes (code THRIFTTRANSPORT): TTransportException('TSocket read 0 bytes',)
  </code></pre>
  
  <p>Check Configuration of Hue returns:</p>
  
  <pre><code>Hive Editor     The application won't work without a running HiveServer2.
  </code></pre>
  
  <p>but I can connect to Hiveserver2 via Beeline.</p>
  
  <p>What can I do?</p>