You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Wes Dyk <We...@nblenergy.com> on 2015/03/31 22:16:24 UTC

Pyhs2: connection reset

A script that I am supporting uses pyhs2 to query hive from python and is no longer working.  It used to work fine and now gets an errno 104 "Connection reset by peer".

I have tried different connection settings (different port or host, just to see what happens or Kerberos auth) and get TTransportException instead.

I'd appreciate any ideas on where to look, possibly why that error would be thrown rather than just failing to connect in the first place.

Thank you,

Wes Dyk

In [19]: conn = pyhs2.connect(host='azuscdbdm01',port=10000,authMechanism='PLAIN',user='wesdyk',password=pwd,database='data_science')
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-19-16aadffa761e> in <module>()
----> 1 conn = pyhs2.connect(host='azuscdbdm01',port=10000,authMechanism='PLAIN',user='wesdyk',password=pwd,database='data_science')

/edge/1/anaconda/lib/python2.7/site-packages/pyhs2/__init__.pyc in connect(*args, **kwargs)
      5     """
      6     from .connections import Connection
----> 7     return Connection(*args, **kwargs)

/edge/1/anaconda/lib/python2.7/site-packages/pyhs2/connections.pyc in __init__(self, host, port, authMechanism, user, password, database, configuration)
     43
     44         self.client = TCLIService.Client(TBinaryProtocol(transport))
---> 45         transport.open()
     46         res = self.client.OpenSession(TOpenSessionReq(username=user, password=password, configuration=configuration))
     47         self.session = res.sessionHandle

/edge/1/anaconda/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.pyc in open(self)
     72     # SASL negotiation loop
     73     while True:
---> 74       status, payload = self._recv_sasl_message()
     75       if status not in (self.OK, self.COMPLETE):
     76         raise TTransportException(type=TTransportException.NOT_OPEN,

/edge/1/anaconda/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.pyc in _recv_sasl_message(self)
     90
     91   def _recv_sasl_message(self):
---> 92     header = self._trans.readAll(5)
     93     status, length = struct.unpack(">BI", header)
     94     if length > 0:

/edge/1/anaconda/lib/python2.7/site-packages/thrift/transport/TTransport.pyc in readAll(self, sz)
     56     have = 0
     57     while (have < sz):
---> 58       chunk = self.read(sz - have)
     59       have += len(chunk)
     60       buff += chunk

/edge/1/anaconda/lib/python2.7/site-packages/thrift/transport/TSocket.pyc in read(self, sz)
    101   def read(self, sz):
    102     try:
--> 103       buff = self.handle.recv(sz)
    104     except socket.error, e:
    105       if (e.args[0] == errno.ECONNRESET and

error: [Errno 104] Connection reset by peer