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 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则