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 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南