Support Questions

Find answers, ask questions, and share your expertise

Phoenix throws "malformed url " error when keytab path contains "C:\User\abc\principal.keytab"

avatar
Contributor

Hi,

My code works fine and I get results when my keytab path do not contain ":" . I understand its a token used by Phoenix internally but if my path contains this token and i try to escape it using "\" , I still get malformed url error . Can you please guide here ? Is it a bug in phoenix connection string code or I am missing something here .

my keytab path in my property file :

keytab.path=C\:\\Users\\VBorhad\\krbProperties\\hdpsrvc.keytab

Error :

java.sql.SQLException: ERROR 102 (08001): Malformed connection url. jdbc:phoenix:p006.unix.gsm1900.org,p001.unix.gsm1900.org,p002.unix.gsm1900.org,p003.unix.gsm1900.org:2181:/hbase-secure:srvc@HDP_EIT_DEV.com:C:\Users\VBorhad\krbProperties\hdpsrvc.keytab
at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:337)
   at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:133)
1 ACCEPTED SOLUTION

avatar
Super Guru

This looks like it might be a Phoenix bug, but I feel like I have seen users successfully using Kerberos on Windows before. You can try using semi-colons instead of colons which might work, but I am not confident that would work.

jdbc:phoenix;p006.unix.gsm1900.org,p001.unix.gsm1900.org,p002.unix.gsm1900.org,p003.unix.gsm1900.org;2181;/hbase-secure;srvc@HDP_EIT_DEV.com;C:\Users\VBorhad\krbProperties\hdpsrvc.keytab

If it doesn't work, we'd want to make sure we fix this in Phoenix via the Apache JIRA.

View solution in original post

5 REPLIES 5

avatar
Super Guru

This looks like it might be a Phoenix bug, but I feel like I have seen users successfully using Kerberos on Windows before. You can try using semi-colons instead of colons which might work, but I am not confident that would work.

jdbc:phoenix;p006.unix.gsm1900.org,p001.unix.gsm1900.org,p002.unix.gsm1900.org,p003.unix.gsm1900.org;2181;/hbase-secure;srvc@HDP_EIT_DEV.com;C:\Users\VBorhad\krbProperties\hdpsrvc.keytab

If it doesn't work, we'd want to make sure we fix this in Phoenix via the Apache JIRA.

avatar
Contributor

It doesn't work . Can you please open Apache JIRA ?

avatar
Super Guru

I can, but you should feel welcome to open the JIRA too

https://issues.apache.org/jira/secure/CreateIssue!default.jspa

avatar
Contributor

avatar
Contributor

Exception I get when i use ; as delimiter in connection string . :

org.apache.phoenix.exception.PhoenixIOException: com.google.protobuf.ServiceException: java.io.IOException: Could not set up IO Streams
   at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:840)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1134)
   at org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:110)
   at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1591)
   at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:569)
   at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:175)
   at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:271)
   at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:263)
   at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
   at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:261)
   at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1043)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1561)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1530)
   at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1530)
   at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)
   at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:126)
   at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)
   at java.sql.DriverManager.getConnection(DriverManager.java:571)
   at java.sql.DriverManager.getConnection(DriverManager.java:233)
   at simpleHBase.PhoenixConnectionFactory.<init>(PhoenixConnectionFactory.java:33)
   at simpleHBase.PhoenixClient.<init>(PhoenixClient.java:27)
   at simpleHBase.actionClass.main(actionClass.java:118)
Caused by: org.apache.hadoop.hbase.MasterNotRunningException: com.google.protobuf.ServiceException: java.io.IOException: Could not set up IO Streams
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$StubMaker.makeStub(HConnectionManager.java:1650)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$MasterServiceStubMaker.makeStub(HConnectionManager.java:1676)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveMasterService(HConnectionManager.java:1884)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHTableDescriptor(HConnectionManager.java:2655)
   at org.apache.hadoop.hbase.client.HBaseAdmin.getTableDescriptor(HBaseAdmin.java:388)
   at org.apache.hadoop.hbase.client.HBaseAdmin.getTableDescriptor(HBaseAdmin.java:393)
   at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:772)
   ... 22 more
Caused by: com.google.protobuf.ServiceException: java.io.IOException: Could not set up IO Streams
   at org.apache.hadoop.hbase.ipc.RpcClient.callBlockingMethod(RpcClient.java:1666)
   at org.apache.hadoop.hbase.ipc.RpcClient$BlockingRpcChannelImplementation.callBlockingMethod(RpcClient.java:1707)
   at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$BlockingStub.isMasterRunning(MasterProtos.java:42561)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$MasterServiceStubMaker.isMasterRunning(HConnectionManager.java:1687)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$StubMaker.makeStubNoRetries(HConnectionManager.java:1596)
   at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation$StubMaker.makeStub(HConnectionManager.java:1622)
   ... 28 more
Caused by: java.io.IOException: Could not set up IO Streams
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.setupIOstreams(RpcClient.java:927)
   at org.apache.hadoop.hbase.ipc.RpcClient.getConnection(RpcClient.java:1531)
   at org.apache.hadoop.hbase.ipc.RpcClient.call(RpcClient.java:1430)
   at org.apache.hadoop.hbase.ipc.RpcClient.callBlockingMethod(RpcClient.java:1649)
   ... 33 more
Caused by: java.lang.RuntimeException: SASL authentication failed. The most likely cause is missing or invalid credentials. Consider 'kinit'.
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection$1.run(RpcClient.java:832)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAs(Subject.java:415)
   at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.handleSaslConnectionFailure(RpcClient.java:793)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.setupIOstreams(RpcClient.java:895)
   ... 36 more
Caused by: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)]
   at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:212)
   at org.apache.hadoop.hbase.security.HBaseSaslRpcClient.saslConnect(HBaseSaslRpcClient.java:152)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.setupSaslConnection(RpcClient.java:767)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.access$600(RpcClient.java:356)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection$2.run(RpcClient.java:888)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection$2.run(RpcClient.java:885)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAs(Subject.java:415)
   at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
   at org.apache.hadoop.hbase.ipc.RpcClient$Connection.setupIOstreams(RpcClient.java:885)
   ... 36 more
Caused by: GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)
   at sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:147)
   at sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:121)
   at sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:187)
   at sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:223)
   at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:212)
   at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179)
   at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:193)
   ... 45 more