400 / Invalid Response status when querying through Reader Replica

0

We have a Neptune graph with 1 writer and 1 reader. We are using gremlinpython connector and can successfully query Neptune when connecting to the writer endpoint. However, when we attempt the exact same connection and (read) query using the reader endpoint, we get a 400 / Invalid Response status from Neptune.

The connection and query code is pretty straightforward:

    access_key = os.getenv('AWS_ACCESS_KEY_ID') 
    secret_key = os.getenv('AWS_SECRET_ACCESS_KEY')
    credentials = Credentials(access_key, secret_key)
    endpoint = '{OUR_ENDPOINT}.us-east-1.neptune.amazonaws.com'
    endpoints = Endpoints(neptune_endpoint=endpoint,credentials=credentials)
    gremlin_utils = GremlinUtils(endpoints)
    conn = gremlin_utils.remote_connection()
    g = gremlin_utils.traversal_source(connection=conn)
    g.V().count().next()

This works when OUR_ENDPOINT is pointing to the writer instance, but it throws the 400 error when connecting to the Reader instance. Any idea why this could be?

  • From the same instance where your code is running, can you use awscurl and hit the https://<endpoint>:<port>/status API? For both the writer and reader endpoint? That would validate that this is not a misconfigured security group or otherwise blocking connectivity. The code above should work, so long as you're running through the entire process for both endpoints, as each would need to generate a Signature for the initial http/websocket connection to the corresponding Neptune instance(s).

質問済み 2年前88ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ