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).

demandé il y a 2 ans88 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions