tantan
tantan

Reputation: 61

Gremlin with Neptune : Timed out while waiting for an available host

I'm trying to create a Gremlin connection to my Neptune cluster from a Lambda function (in Scala) as follows:

lazy val cluster =
    Cluster
      .build()
      .addContactPoint("<my-neptune-endpoint>")
      .port(NEPTUNE_ENDPOINT_PORT)
      .keepAliveInterval(0)
      .create()
  lazy val neptuneConnection: GraphTraversalSource = traversal().withRemote(DriverRemoteConnection.using(cluster))

However, even a simple query fails. neptuneConnection.V().drop().toList()

The exception thrown is :

java.lang.IllegalStateException: org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionException: java.lang.RuntimeException: java.lang.RuntimeException: java.util.concurrent.TimeoutException: Timed out while waiting for an available host - check the client configuration and connectivity to the server if this message persists

Also, I tried connecting to Neptune using the HTTP REST endpoint, and executed the same query and it works. It seems to be an issue with the Gremlin connection.

Does anyone know what could be causing this?

Upvotes: 1

Views: 1593

Answers (2)

user3762889
user3762889

Reputation: 31

I think you shouldn't disable the keepAliveInterval. you should let the default value. It is explained here

Upvotes: 0

tantan
tantan

Reputation: 61

The issue with my Gremlin connection initialization was that it was missing the following :

.enableSsl(true)

I needed to enable SSL since Neptune only works with https and Gremlin client defaults to non SSL connections.

Adding this fixed my issue.

Upvotes: 3

Related Questions