alaisi / postgres-async-driver

Asynchronous PostgreSQL Java driver
Apache License 2.0
289 stars 38 forks source link

invalid frontend message type 112 #12

Closed mdietrichstein closed 9 years ago

mdietrichstein commented 9 years ago

Hi

I have forked postgres-async-driver with the goal to contribute some changes to the DataConverter class, but I am unable to get the current master to run.

Here's the exception I get when trying to query my local postgres instance or run the postgres-async-driver test suite:

com.github.pgasync.SqlException: FATAL: SQLSTATE=08P01, MESSAGE=invalid frontend message type 112
    at com.github.pgasync.impl.netty.NettyPgProtocolStream.toSqlException(NettyPgProtocolStream.java:202)
    at com.github.pgasync.impl.netty.NettyPgProtocolStream.throwErrorResponses(NettyPgProtocolStream.java:164)
    at com.github.pgasync.impl.netty.NettyPgProtocolStream$$Lambda$14/467275133.call(Unknown Source)
    at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
    at com.github.pgasync.impl.netty.NettyPgProtocolStream$5.channelRead(NettyPgProtocolStream.java:280)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:161)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:161)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
    at java.lang.Thread.run(Thread.java:745)

Everything is working just fine when I use the current version from Maven Central (0.6).

My setup:

Any idea how to I can fix this?

alaisi commented 9 years ago

Hi, thanks for the bug report. :)

You are probably using trust authentication and that should now be fixed.

Note that AuthenticationTest will still fail for you from the test suite as it currently requires md5 auth in pg_hba.conf.

-Antti

mdietrichstein commented 9 years ago

Thanks for fixing this one so fast. You're awesome :+1:

Adding md5 auth to my pg_hba.conf also fixed the tests for me. Thanks for the hint!