skip to Main Content

I ran a query on my graph using the following code:

SELECT * FROM cypher('demo_graph') as (v agtype);

However, I forgot to include the query argument for the Cypher function. As a result, the server closed the connection unexpectedly, and I received the error message

server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

I was expecting an exception to be raised instead of the server being terminated.

3

Answers


  1. Yes, I have also encountered the same error, multiple times, and in the end, it automatically reconnects to the server and works normally.

    I recommend You to open an issue regarding this error at https://github.com/apache/age/issues

    In this case, as the server crashes this transaction is rolled back, and previous changes are committed. So such queries do not affect your database, and your server starts again, safely.

    Login or Signup to reply.
  2. You are missing the cypher query:

    SELECT * FROM cypher('demo_graph', $$ your cypher query goes here $$) as (v agtype);
    
    Login or Signup to reply.
  3. I think the server is terminating and this is happening because of an empty query. To Resolve this issue try using the below code and run

    query = "MATCH (n) RETURN n LIMIT 9"
    if query.strip() == "":
        raise ValueError("String query empty ")
    res = conn.execute(f"SELECT * FROM cypher('my_graph', '{query}') as (v agtype)")
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search