aws/amazon-neptune-jdbc-driver

[BUG] Signature mismatch error with Neptune engine version 1.1.1.0

asarkar opened this issue · 1 comments

Describe the bug

Using engine version 1.1.1.0, openCypher JDBC connectivity fails with the following error:

shadow.org.neo4j.driver.exceptions.DatabaseException: "Unexpected server exception 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method.

Steps to Reproduce

  1. Rename the attached file to Main.java (GitHub doesn't allow uploading of .java files)
  2. Add implementation "info.picocli:picocli:4.6.3" as a dependency in build.gradle.
  3. Set environment variables described here.
  4. Run Main.java with the parameters --host and --region. If you're using SSH tunneling, configure your environment as described here, and include parameters --ssh-file and --ssh-host.

If being used outside of a BI Tool, fill in:
1. What version of the JDBC Driver are you using? 1.1.0, but also reproducible with develop branch
2. What language variant are you using (SPARQL, Gremlin, openCypher, SQL)? openCypher
3. What database are you connecting to (Amazon Neptune, Neo4J, etc)? Amazon Neptune
4. What engine version of the database are you using? 1.1.1.0.R6, but also reproducible in R5
5. What Java version are you using? JDK 8
6. Please attach a code snippet of the code that is causing the error: Attached
7. If bug occurred during query execution attach the SQL: Refer to the attached file
8. Attach debug logs if applicable/possible (please ensure it doesn't contain any sensitive information)

    > Task :Main.main()
22/09/28 19:19:10 [main] INFO test.Main: Connection created
22/09/28 19:19:10 [main] INFO test.Main: Statement created
22/09/28 19:19:10 [main] INFO opencypher.OpenCypherQueryExecutor: Creating driver with encryption.
22/09/28 19:19:10 [main] INFO opencypher.OpenCypherQueryExecutor: Creating driver with IAMSigV4 authentication.
Sep 28, 2022 7:19:10 PM org.neo4j.driver.internal.logging.JULogger info
INFO: Direct driver instance 2123533871 created for server address <neptune cluster endpoint>:65345
Sep 28, 2022 7:19:11 PM org.neo4j.driver.internal.logging.JULogger warn
WARNING: [0x679e263f][<neptune cluster endpoint>:65345][] Fatal error occurred in the pipeline
org.neo4j.driver.exceptions.DatabaseException: "Unexpected server exception 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.'"
	at org.neo4j.driver.internal.util.ErrorUtil.newNeo4jError(ErrorUtil.java:84)
	at org.neo4j.driver.internal.async.inbound.InboundMessageDispatcher.handleFailureMessage(InboundMessageDispatcher.java:105)
	at org.neo4j.driver.internal.messaging.v1.MessageReaderV1.unpackFailureMessage(MessageReaderV1.java:83)
	at org.neo4j.driver.internal.messaging.v1.MessageReaderV1.read(MessageReaderV1.java:59)
	at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:83)
	at org.neo4j.driver.internal.async.inbound.InboundMessageHandler.channelRead0(InboundMessageHandler.java:35)
	at org.neo4j.driver.internal.shaded.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
	at org.neo4j.driver.internal.async.inbound.MessageDecoder.channelRead(MessageDecoder.java:47)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.neo4j.driver.internal.shaded.io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1475)
	at org.neo4j.driver.internal.shaded.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1224)
	at org.neo4j.driver.internal.shaded.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1271)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:505)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444)
	at org.neo4j.driver.internal.shaded.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at org.neo4j.driver.internal.shaded.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at org.neo4j.driver.internal.shaded.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931)
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700)
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
	at org.neo4j.driver.internal.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
	at org.neo4j.driver.internal.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at org.neo4j.driver.internal.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:750)

Expected behavior

Should be able to execute query without exception.

Screenshots

N/A

Environment

Please add the following information to your report:

  • OS: [e.g. macOS Big Sur]: Irrelevant
  • Version [e.g. 11.6.1]: openjdk version "1.8.0_322"

Additional Context

The code attached used to work with Neptune engine version 1.0.5.1, but doesn't work after upgrading to 1.1.1.0.
Release notes: https://docs.aws.amazon.com/neptune/latest/userguide/engine-releases-1.1.1.0.html

Attachment

Main.txt

Fixed in v2.0.0 by #201.