1

the following issue is coming when trying to connect Hive 2 (kerberoes authenticat is enabled) using R rjdbc. used simba driver to connect to hive.

hiveConnection <- dbConnect(hiveJDBC, "jdbc:hive2://xxxx:10000/default;AuthMech=1;KrbRealm=xx.yy.com;KrbHostFQDN=dddd.yy.com;KrbServiceName=hive")

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], : java.sql.SQLException: [Simba]HiveJDBCDriver Invalid operation: Unable to obtain Principal Name for authentication ;

  • you might see the below exception sometimes related to your slf4j jar issue on the classpath. Java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple; . – ravi sankar pentela Apr 01 '16 at 17:05
  • Did you create a Kerberos TGT in the default ticket cache? Because from R it would be difficult to configure the Java security lib (JAAS) to set the principal (i.e. the Kerberos login), the way to get the password, etc. – Samson Scharfrichter Apr 02 '16 at 00:16
  • Do you have a valid Kerberos config file in the default location (e.g. `/etc/krb5.conf` on Linux) with location of KDC server for the realm, etc? – Samson Scharfrichter Apr 02 '16 at 00:19
  • BTW, a Kerberos realm is usually in UPPERCASE.Even when it is mapped on a Windows domain written in lowercase. – Samson Scharfrichter Apr 02 '16 at 00:20
  • Side note: the bloody SLF4J messages have nothing to do with security errors. – Samson Scharfrichter Apr 02 '16 at 00:24

1 Answers1

0
  1. make sure kinit is issued and kerberoes ticket is generated using klist
  2. right Java version for the given R version (32/64 bit) available on the class-path
  3. right slf4j jars available based on your java version

All these steps should resolve the issue assuming your code does not have logic issues.