Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Unknown authentication method -> 'caching_sha2_password' #249

Open
sm-tester opened this issue May 13, 2018 · 2 comments
Open

Unknown authentication method -> 'caching_sha2_password' #249

sm-tester opened this issue May 13, 2018 · 2 comments

Comments

@sm-tester
Copy link

Problem when using library with mysql version 8.0.11 GA Release:

12/05/2018 21:14:00:444 UTC | ERROR | com.github.mauricio.async.db.mysql.MySQLConnection  - Transport failure 
io.netty.handler.codec.EncoderException: com.github.mauricio.async.db.exceptions.UnsupportedAuthenticationMethodException: Unknown authentication method -> 'caching_sha2_password'
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:106)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:748)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:740)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:826)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:733)
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:101)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:748)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:811)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:824)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:804)
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:841)
	at com.github.mauricio.async.db.mysql.codec.MySQLConnectionHandler.com$github$mauricio$async$db$mysql$codec$MySQLConnectionHandler$$writeAndHandleError(MySQLConnectionHandler.scala:325)
	at com.github.mauricio.async.db.mysql.codec.MySQLConnectionHandler.write(MySQLConnectionHandler.scala:215)
	at com.github.mauricio.async.db.mysql.MySQLConnection.onHandshake(MySQLConnection.scala:174)
	at com.github.mauricio.async.db.mysql.codec.MySQLConnectionHandler.channelRead0(MySQLConnectionHandler.scala:99)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.github.mauricio.async.db.exceptions.UnsupportedAuthenticationMethodException: Unknown authentication method -> 'caching_sha2_password'
	at com.github.mauricio.async.db.mysql.encoder.HandshakeResponseEncoder$$anonfun$2.apply(HandshakeResponseEncoder.scala:74)
	at com.github.mauricio.async.db.mysql.encoder.HandshakeResponseEncoder$$anonfun$2.apply(HandshakeResponseEncoder.scala:74)
	at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	at com.github.mauricio.async.db.mysql.encoder.HandshakeResponseEncoder.encode(HandshakeResponseEncoder.scala:73)
	at com.github.mauricio.async.db.mysql.codec.MySQLOneToOneEncoder.encode(MySQLOneToOneEncoder.scala:75)
	at com.github.mauricio.async.db.mysql.codec.MySQLOneToOneEncoder.encode(MySQLOneToOneEncoder.scala:35)
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:88)
	... 34 common frames omitted
@VPerovic
Copy link

Same issue here.
Just created simple Verticle:

public class DatabaseVerticle extends AbstractVerticle {
	private SQLClient mySQLClient;

	@Override
	public void start(Future<Void> startFuture) throws Exception {
		
		JsonObject mySQLClientConfig = new JsonObject()
				.put("host", config().getString("mysql.host", "localhost"))
				.put("port", config().getInteger("mysql.port", 3306))
				.put("maxPoolSize", config().getInteger("mysql.maxPoolSize", 100))
				.put("username", config().getString("mysql.username", "user"))
				.put("password", config().getString("mysql.password", "password"))
				.put("database", config().getString("mysql.database", "dbName"))
				.put("charset", config().getString("mysql.charset", StandardCharsets.UTF_8.name()));

		mySQLClient = MySQLClient.createNonShared(vertx, mySQLClientConfig);

                Future<SQLConnection> future = Future.future();
		mySQLClient.getConnection(future.completer());
                future.compose(conn -> {
                        Future<Void> f = Future.future();
                         //Create some table
                        return f;
                }).setHandler(ar ->{
                        if(ar.failed()){
                               startFuture.fail(ar.cause());
                        }else{
                               startFuture.complete();
                        }
                });

Deployed verticle like this
vertx.deployVerticle(new DatabaseVerticle(), new DeploymentOptions().setConfig(config()));
and than exception was thrown.

@EugeneChung
Copy link

Is there any fork that supports this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants