Support Questions

Find answers, ask questions, and share your expertise

We have a requirement to connect to Hive database using custom c#. The issue we are facing is using a linux generated keytab on windows CLI.

avatar
Contributor

Error we are getting is below.

1 ACCEPTED SOLUTION

avatar
Super Guru

@Anil Bagga

Problem

when ading a key to hte keytab file with the kadmin, a error could be encountered:

Unsupported key table format version number while adding key to keytab

Cause

local file to which you want to export the key (/etc/krb5.keytab) is in an incorrect format. This is usually because you have tried to create an empty file (using touch or similar commands) beforehand, and then export the key into it.

Diagnosing the problem

To verify that this is indeed the case, try running klist on the existing file to which you are attempting to export the key (you should run it in the source and target environment where the file is originated/used):

example:sudo klist -k /etc/keytab

It should return

klist: Unsupported key table format version number while starting keytab scan

Resolving the problem

This usually happens when the local file to which you want to export the key (/etc/krb5.keytab) is in an incorrect format. The most common reason why this would happen is if you have tried to create an empty file (using touch or similar commands) beforehand, and then export the key into it.

To verify that this is indeed the case, try running kliston the existing file to which you are attempting to export the key:

sudo klist -k /etc/keytab
klist: Unsupported key table format version number while starting keytab scan

if this is not the cause, use another option:

execute kdestroy and generate a new ticket and krb5cache”

View solution in original post

3 REPLIES 3

avatar
Super Guru

@Anil Bagga

Problem

when ading a key to hte keytab file with the kadmin, a error could be encountered:

Unsupported key table format version number while adding key to keytab

Cause

local file to which you want to export the key (/etc/krb5.keytab) is in an incorrect format. This is usually because you have tried to create an empty file (using touch or similar commands) beforehand, and then export the key into it.

Diagnosing the problem

To verify that this is indeed the case, try running klist on the existing file to which you are attempting to export the key (you should run it in the source and target environment where the file is originated/used):

example:sudo klist -k /etc/keytab

It should return

klist: Unsupported key table format version number while starting keytab scan

Resolving the problem

This usually happens when the local file to which you want to export the key (/etc/krb5.keytab) is in an incorrect format. The most common reason why this would happen is if you have tried to create an empty file (using touch or similar commands) beforehand, and then export the key into it.

To verify that this is indeed the case, try running kliston the existing file to which you are attempting to export the key:

sudo klist -k /etc/keytab
klist: Unsupported key table format version number while starting keytab scan

if this is not the cause, use another option:

execute kdestroy and generate a new ticket and krb5cache”

avatar
Super Guru

Also, another option is to execute kdestroy and generate a new ticket and krb5cache.

The documentation you need for HDP 2.4: https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_dataintegration/content/hive-jdbc-odbc-d...

avatar
Contributor

executed kdestroy and generated a new ticket and krb5cache” worked