dropbox / dropbox/PyHive

Error connecting to Kerberos using pyHive

Open
#464 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
545
PR merge metrics
No merged PRs in 30d

Description

Hi,
I get this error while connecting to Hive via Kerberos:

_thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-1) SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (Server krbtgt/[LOCAL.IT@EXAMPLE.IT](mailto:LOCAL.IT@EXAMPLE.IT) not found in Kerberos database)'_

I am able to connect to Kerberos using "kinit -kt user user.keytab", and also via Hive ODBC driver. I use the same krb5.conf file, with **Default Realm = EXAMPLE.IT**.

With kinit, I obtain, correctly:

_Default principal: [user@EXAMPLE.IT](mailto:user@EXAMPLE.IT)
Valid starting Expires Service principal
09/28/23 11:05:16 09/28/23 11:05:16 [krbtgt/EXAMPLE.IT@EXAMPLE.IT](mailto:krbtgt/EXAMPLE.IT@EXAMPLE.IT)_

The error is only using pyHive library. In the error, the library uses the domain LOCAL.IT instead of the one specified in krb5.conf, that is EXAMPLE.IT

My connection in pyHive:

```
conn = hive.Connection(host="host.domain.it",
port=10000,
auth="KERBEROS",
database="db_123",
kerberos_service_name="hive")
```

**Note that LOCAL.IT is equal to domain.it.**

Can you help me?
Thank you
Andrea

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.