cloudera / impyla

Python DB API 2.0 client for Impala and Hive (HiveServer2 protocol)
Apache License 2.0
730 stars 248 forks source link

Error in sasl_decode (-1) SASL(-1): generic failure: Unable to find a callback: 32775 #430

Open jmadison222 opened 3 years ago

jmadison222 commented 3 years ago

Querying hive, I get this error with even a trivial sized table:

Error in sasl_decode (-1) SASL(-1): generic failure: Unable to find a callback: 32775

I'm using a hive version of: Hive 2.3.4-amzn-0. As noted from the name, it's Amazon EMR.

If I put on 'LIMIT 100' it is fine. But asking for more than about 300 errors gives the error consistently.

I can reproduce it with the TPC-H benchmark tables, which are simple strings, integers, and floats, and not very wide.

I can reproduce it with the table being internal or external or a view.

If I remove the as_pandas and even try to get one row with fetchone() directly on the cursor, that fails immediately, which I thought was interesting. But again, if I do 'LIMIT 100', the fetchone() works fine too.

My code is this:

from   impala.dbapi import connect
from   impala.util import as_pandas

...

        conn = connect(
            host=os.environ['jamHiveServer'],
            port=10000,
            auth_mechanism='GSSAPI',
            kerberos_service_name='hive'
        )

        cursor = conn.cursor()

        cursor.execute(sQuery)

        df = as_pandas(cursor) # Crashes on this line

The full error is this:

Traceback (most recent call last):
  File "/export/home/jm/Linux/see/see.py", line 159, in <module>
    objMain.main()
  File "/export/home/jm/Linux/see/see.py", line 98, in main
    df = factory.getDf(self.theArgs)
  File "/tech/home/jm/Linux/see/dfGetterFactory.py", line 23, in getDf
    return getter.getDf(args)
  File "/tech/home/jm/Linux/see/hive.py", line 39, in getDf
    df = as_pandas(cursor)
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/util.py", line 63, in as_pandas
    return DataFrame.from_records(cursor.fetchall(), columns=names,
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/hiveserver2.py", line 536, in fetchall
    return list(self)
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/hiveserver2.py", line 584, in __next__
    convert_types=self.convert_types)
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/hiveserver2.py", line 1266, in fetch
    resp = self._rpc('FetchResults', req)
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/hiveserver2.py", line 993, in _rpc
    response = self._execute(func_name, request)
  File "/export/home/jm/.local/lib/python3.6/site-packages/impala/hiveserver2.py", line 1010, in _execute
    return func(request)
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thriftpy2/thrift.py", line 219, in _req
    return self._recv(_api)
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thriftpy2/thrift.py", line 231, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thriftpy2/protocol/binary.py", line 373, in read_message_begin
    self.trans, strict=self.strict_read)
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thriftpy2/protocol/binary.py", line 165, in read_message_begin
    sz = unpack_i32(inbuf.read(4))
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thrift_sasl/__init__.py", line 173, in read
    self._read_frame()
  File "/usr/app/anaconda_3/lib/python3.6/site-packages/thrift_sasl/__init__.py", line 187, in _read_frame
    message=self.sasl.getError())
thrift.transport.TTransport.TTransportException: b'Error in sasl_decode (-1) SASL(-1): generic failure: Unable to find a callback: 32775'

Pip freeze is:

absl-py==0.11.0
adal==1.2.5
aiohttp==3.7.3
alabaster==0.7.12
alembic==1.4.2
altgraph==0.17
amqp==2.6.1
analytics-python==1.2.9
ansiwrap==0.8.4
apache-airflow==1.10.13
apipkg==1.5
apispec==1.3.3
appdirs==1.4.4
argcomplete==1.12.2
argon2-cffi==20.1.0
asn1crypto==1.4.0
astroid==2.4.2
async-generator==1.10
async-timeout==3.0.1
atlasclient==1.0.0
attrs==20.3.0
aws-sam-translator==1.31.0
aws-xray-sdk==2.6.0
azure-common==1.1.25
azure-core==1.9.0
azure-cosmos==3.2.0
azure-datalake-store==0.0.51
azure-identity==1.5.0
azure-keyvault==4.1.0
azure-keyvault-certificates==4.2.1
azure-keyvault-keys==4.3.0
azure-keyvault-secrets==4.2.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-core==1.2.2
azure-mgmt-resource==15.0.0
azure-nspkg==3.0.2
azure-storage==0.36.0
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
Babel==2.8.0
backcall==0.1.0
bcrypt==3.1.7
Beaker==1.11.0
beautifulsoup4==4.7.1
billiard==3.6.3.0
bitarray==1.2.1
bleach==3.2.1
blinker==1.4
boto==2.49.0
boto3==1.13.4
botocore==1.16.4
cached-property==1.5.1
cachetools==4.1.1
cassandra-driver==3.20.2
cattrs==1.0.0
celery==4.4.7
certifi==2020.4.5.1
cffi==1.13.2
cfgv==3.2.0
cfn-lint==0.42.0
cgroupspy==0.1.6
chardet==3.0.4
cheroot==8.3.0
CherryPy==18.6.0
click==6.7
cloudant==0.5.10
colorama==0.4.3
colorlog==4.0.2
conda==4.3.16
configparser==3.5.3
confuse==1.4.0
coverage==5.3
croniter==0.3.31
crypto==1.4.1
cryptography==2.9.1
curl==0.0.1
cx-Freeze==6.2
cx-Oracle==7.3.0
cycler==0.10.0
cypari==2.4.0
Cython==0.29.21
dataclasses==0.8
datacompy==0.6.0
datadog==0.39.0
decorator==4.4.2
defusedxml==0.6.0
dill==0.3.1.1
distlib==0.3.1
dnspython==1.16.0
docker==3.7.3
docker-pycreds==0.4.0
docopt==0.6.2
docutils==0.15.2
ecdsa==0.14.1
elasticsearch==5.5.3
elasticsearch-dsl==5.4.0
email-validator==1.1.2
entrypoints==0.3
et-xmlfile==1.0.1
execnet==1.7.1
fastavro==0.23.5
filelock==3.0.12
flake8==3.8.4
flake8-colors==0.1.9
flaky==3.7.0
Flask==1.1.2
Flask-Admin==1.5.4
Flask-AppBuilder==2.3.2
Flask-Babel==1.0.0
Flask-Bcrypt==0.7.1
Flask-Caching==1.3.3
Flask-JWT-Extended==3.24.1
Flask-Login==0.4.1
Flask-OpenID==1.2.5
Flask-SQLAlchemy==2.4.1
flask-swagger==0.2.13
Flask-WTF==0.14.3
flower==0.9.5
FormEncode==2.0.0
freezegun==1.0.0
fsspec==0.8.4
funcsigs==1.0.2
future==0.16.0
future-fstrings==1.2.0
FXrays==1.3.3
gcsfs==0.7.1
genson==1.2.2
gitdb==4.0.5
GitPython==3.1.11
google-api-core==1.23.0
google-api-python-client==1.12.8
google-auth==1.23.0
google-auth-httplib2==0.0.4
google-auth-oauthlib==0.4.2
google-cloud-bigquery==1.27.2
google-cloud-bigquery-storage==1.1.0
google-cloud-bigtable==1.6.0
google-cloud-container==1.0.1
google-cloud-core==1.4.3
google-cloud-dlp==1.0.0
google-cloud-language==1.3.0
google-cloud-secret-manager==1.0.0
google-cloud-spanner==1.19.1
google-cloud-speech==1.3.2
google-cloud-storage==1.33.0
google-cloud-texttospeech==1.0.1
google-cloud-translate==1.7.0
google-cloud-videointelligence==1.16.1
google-cloud-vision==1.0.0
google-crc32c==1.0.0
google-resumable-media==1.1.0
googleapis-common-protos==1.52.0
graphviz==0.13.2
grpc-google-iam-v1==0.12.3
grpcio==1.33.2
grpcio-gcp==0.2.2
gunicorn==19.10.0
hdfs==2.5.8
hive==0.1.3.dev0
hmsclient==0.1.1
htmlmin==0.1.12
HTMLParser==0.0.2
httplib2==0.18.1
humanize==3.1.0
hvac==0.10.5
identify==1.5.10
idna==2.8
idna-ssl==1.1.0
ijson==2.6.1
ImageHash==4.2.0
imagesize==1.2.0
importlib-metadata==2.1.0
importlib-resources==1.5.0
impyla==0.16.3
inflection==0.5.1
ipdb==0.13.4
ipykernel==5.3.4
ipython==7.15.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
iso8601==0.1.12
isodate==0.6.0
itsdangerous==1.1.0
jaraco.classes==3.1.0
jaraco.collections==3.0.0
jaraco.functools==3.0.1
jaraco.text==3.2.0
JayDeBeApi==1.2.3
jdcal==1.4.1
jedi==0.17.0
Jinja2==2.11.2
jira==2.0.0
jmespath==0.9.5
joblib==0.17.0
JPype1==0.7.1
json-merge-patch==0.2
jsondiff==1.1.2
jsonpatch==1.27
jsonpickle==1.4.2
jsonpointer==2.0
jsonschema==3.2.0
junit-xml==1.9
jupyter-client==6.1.7
jupyter-core==4.7.0
jupyterlab-pygments==0.1.2
kiwisolver==1.3.1
kombu==4.6.11
kubernetes==11.0.0
lazy-object-proxy==1.4.3
ldap3==2.7
ldapcherry==1.1.1
llvmlite==0.34.0
lockfile==0.12.2
lxml==4.5.1
M2Crypto==0.36.0
Mako==1.1.2
Markdown==2.6.11
MarkupSafe==1.1.1
marshmallow==2.21.0
marshmallow-enum==1.5.1
marshmallow-sqlalchemy==0.22.3
matplotlib==3.3.3
mccabe==0.6.1
missingno==0.4.2
mistune==0.8.4
mock==4.0.2
mongomock==3.21.0
more-itertools==8.2.0
moto==1.3.14
msal==1.6.0
msal-extensions==0.3.0
msrest==0.6.19
msrestazure==0.6.4
multi-key-dict==2.0.3
multidict==5.0.2
mypy==0.720
mypy-extensions==0.4.3
mysqlclient==1.3.14
Naked==0.1.31
nbclient==0.5.1
nbconvert==6.0.7
nbformat==5.0.8
nest-asyncio==1.4.3
networkx==2.4
nodeenv==1.5.0
nose==1.3.7
notebook==6.1.5
nteract-scrapbook==0.4.1
ntlm-auth==1.5.0
numba==0.51.2
numpy==1.19.4
oauthlib==3.1.0
openpyxl==3.0.3
oscrypto==1.2.1
packaging==20.7
pamela==0.3.0
pandas==1.1.4
pandas-gbq==0.14.1
pandas-profiling==2.9.0
pandasql==0.7.3
pandocfilters==1.4.3
papermill==1.2.1
parameterized==0.7.4
paramiko==2.7.1
parso==0.7.0
Paste==3.5.0
PasteDeploy==2.1.1
PasteScript==3.2.0
pathspec==0.8.1
pbr==5.5.1
pendulum==1.4.4
pep562==1.0
pexpect==4.8.0
phik==0.10.0
pickleshare==0.7.5
Pillow==8.0.1
pinotdb==0.1.1
pipreqs==0.4.10
plink==2.3.1
pluggy==0.13.1
ply==3.11
portalocker==1.7.1
portend==2.6
pre-commit==2.9.2
presto-python-client==0.7.0
prison==0.1.3
prometheus-client==0.8.0
prompt-toolkit==3.0.5
protobuf==3.14.0
psutil==5.7.0
psycopg2-binary==2.8.6
ptyprocess==0.6.0
py==1.9.0
pyarrow==0.17.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.6.0
pycosat==0.6.3
pycparser==2.20
pycryptodome==3.4.3
pycryptodomex==3.9.8
pydata-google-auth==1.1.0
pydruid==0.5.8
pyfiglet==0.8.post1
pyflakes==2.2.0
Pygments==2.6.1
PyHive==0.6.2
pyinstaller==4.0
pyinstaller-hooks-contrib==2020.8
PyJWT==1.7.1
pykerberos==1.2.1
pyldap==3.0.0.post1
Pylons==1.0.3
pymongo==3.10.1
pymqi==1.12.0
pymssql==2.1.5
PyMySQL==0.9.3
PyNaCl==1.3.0
pyOpenSSL==19.1.0
pyparsing==2.4.7
pypng==0.0.20
pyrsistent==0.16.0
pysftp==0.2.9
PySmbClient==0.1.5
pytest==5.4.3
pytest-cov==2.10.1
pytest-forked==1.3.0
pytest-instafail==0.4.2
pytest-rerunfailures==9.1.1
pytest-timeouts==1.2.1
pytest-xdist==1.34.0
python-daemon==2.1.2
python-dateutil==2.8.1
python-editor==1.0.4
python-http-client==3.3.1
python-jenkins==1.7.0
python-jose==3.2.0
python-ldap==3.2.0
python-nvd3==0.15.0
python-slugify==4.0.1
python-snappy==0.5.4
python3-openid==3.1.0
pytz==2019.3
pytzdata==2019.3
PyWavelets==1.1.1
pywinrm==0.4.1
PyYAML==5.3.1
pyzmq==22.0.3
qds-sdk==1.16.1
redis==3.5.3
regex==2020.11.13
repoze.lru==0.7
requests==2.23.0
requests-file==1.5.1
requests-futures==0.9.4
requests-kerberos==0.12.0
requests-mock==1.8.0
requests-ntlm==1.1.0
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
responses==0.12.1
Routes==2.5.1
rsa==4.6
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
s3-concat==0.1.9
s3transfer==0.3.3
s4cmd==2.1.0
sacremoses==0.0.43
sasl==0.2.1
scipy==1.5.4
seaborn==0.11.0
Send2Trash==1.5.0
sendgrid==5.6.0
sentencepiece==0.1.94
sentinels==1.0.0
sentry-sdk==0.19.4
setproctitle==1.1.10
shellescape==3.8.1
simplejson==3.17.2
six==1.15.0
slackclient==1.3.2
smmap==3.0.4
snakebite-py3==3.0.5
snappy==2.8
snappy-manifolds==1.1.1
snowballstemmer==2.0.0
snowflake-connector-python==2.2.6
snowflake-sqlalchemy==1.2.4
soupsieve==2.0.1
spherogram==1.8.3
Sphinx==3.3.1
sphinx-argparse==0.2.5
sphinx-autoapi==1.0.0
sphinx-copybutton==0.3.1
sphinx-jinja==1.1.1
sphinx-rtd-theme==0.5.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-dotnetdomain==0.4
sphinxcontrib-golangdomain==0.2.0.dev0
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-httpdomain==1.7.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
sql-metadata==1.7.1
SQLAlchemy==1.3.16
SQLAlchemy-JSONField==0.9.0
SQLAlchemy-Utils==0.36.3
sqlparse==0.3.1
sshpubkeys==3.1.0
sshtunnel==0.1.5
tableauserverclient==0.13
tabulate==0.8.7
tangled-up-in-unicode==0.0.6
Tempita==0.5.2
tempora==3.0.0
tenacity==4.12.0
tensorboard==2.4.0
tensorboard-plugin-wit==1.7.0
termcolor==1.1.0
terminado==0.9.1
testpath==0.4.4
text-unidecode==1.3
textwrap3==0.9.2
thrift==0.13.0
thrift-sasl==0.4.2
thriftpy2==0.4.11
tokenizers==0.9.4
toml==0.10.2
torch==1.7.1
tornado==5.1.1
tqdm==4.48.2
traitlets==4.3.3
transformers==4.1.1
typed-ast==1.4.1
typing==3.7.4.1
typing-extensions==3.7.4.2
tzlocal==1.5.1
unicodecsv==0.14.1
Unidecode==1.1.1
untangle==1.1.1
uritemplate==3.0.1
urllib3==1.25.11
vertica-python==1.0.0
vine==1.3.0
virtualenv==20.2.1
visions==0.5.0
waitress==1.4.4
wcwidth==0.2.4
webencodings==0.5.1
WebError==0.13.1
WebHelpers==1.3
WebOb==1.8.7
websocket-client==0.54.0
WebTest==2.0.35
Werkzeug==0.16.1
widgetsnbextension==3.5.1
wrapt==1.12.1
WTForms==2.2.1
xlrd==1.2.0
xmltodict==0.12.0
yamllint==1.25.0
yarg==0.1.9
yarl==1.6.3
yq==2.11.1
zc.lockfile==2.0
zdesk==2.7.1
zeep==4.0.0
zipp==3.1.0
zope.deprecation==4.4.0