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회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠