Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3964

Unsupported mechanism type ????? due to dependency on default OS-dependent charset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.9.3
    • 0.10.0
    • Java - Library
    • None

    Description

      Thrift is bound to the OS dependent default charset which cause errors like this on the client:

      20:44:51,638 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (XNIO-1 task-4)  IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:336)
              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:343)
              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:278)
              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:1289)
              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:492)
              at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1071)
              at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:91)
              at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:232)
              at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:88)
              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:803)
              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:601)
              at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:354)
              at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:330)
              at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1183)
              at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:362)
              at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:218)
              at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:208)
              at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
              at java.security.AccessController.doPrivileged(AccessController.java:686)
              at javax.security.auth.Subject.doAs(Subject.java:569)
              at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
              at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
              at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:95)
              at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.lang.Thread.run(Thread.java:785)
      Caused by: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://wal-vm-pglinux01:10000: Peer indicated failure: Unsupported mechanism type ?????
              at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:207)
              at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:152)
              at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:312)
              ... 32 more
      Caused by: org.apache.thrift.transport.TTransportException: Peer indicated failure: Unsupported mechanism type ?????
              at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:199)
              at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:307)
              at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
              at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:181)
              ... 35 more
      

      and this on the server side:

      2016-11-07T20:06:03,001 ERROR [b98a0b99-ae01-4183-b8e3-9f42b53f4df6b98a0b99-ae01-4183-b8e3-9f42b53f4df67b9491d1-bd65-4a08-bf18-ec88b93cb7407b9491d1-bd65-4a08-bf18-ec88b93cb7405a11fcc6-c922-487d-85be-4d940f7571f15a11fcc6-c922-487d-85be-4d940f7571f17f2106bf-8a1c-4536-9fdc-f1aee79f220a7f2106bf-8a1c-4536-9fdc-f1aee79f220a7a2e8f05-8386-49f7-b352-0e76cb3c89387a2e8f05-8386-49f7-b352-0e76cb3c8938HiveServer2-Handler-Pool: Thread-84]: server.TThreadPoolServer (TThreadPoolServer.java:run(297)) - Error occurred during processing of message.
      java.lang.RuntimeException: org.apache.thrift.transport.TTransportException: Unsupported mechanism type �����
      	at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219) ~[hive-exec-2.0.0.jar:2.0.0]
      	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:269) [hive-exec-2.0.0.jar:2.0.0]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_101]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_101]
      	at java.lang.Thread.run(Thread.java:745) [?:1.7.0_101]
      Caused by: org.apache.thrift.transport.TTransportException: Unsupported mechanism type �����
      	at org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:232) ~[hive-exec-2.0.0.jar:2.0.0]
      	at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:138) ~[hive-exec-2.0.0.jar:2.0.0]
      	at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:271) ~[hive-exec-2.0.0.jar:2.0.0]
      	at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41) ~[hive-exec-2.0.0.jar:2.0.0]
      	at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216) ~[hive-exec-2.0.0.jar:2.0.0]
      	... 4 more
      

      The culprit is code like what Thrift has in org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage():

          // Get the mechanism name.
          String mechanismName = new String(message.payload);
      

      Instead of something like:

          // Get the mechanism name.
          String mechanismName = new String(message.payload, "UTF-8");
      

      Attachments

        1. THRIFT-3964-ggregory.diff
          3 kB
          Gary D. Gregory

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              ggregory Gary D. Gregory
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: