Closed viktorrobin closed 2 years ago
So I found what was causing the issue, but can't really explain it...
I am using your migrate.py
provided in the phone calls example, which randomly returns the error described above when grakn runs as a container:
def build_phone_call_graph(inputs):
with GraknClient(uri=URI) as client:
with client.session(keyspace = KEYSPACE) as session:
for input in inputs:
print("Loading from [" + input["data_path"] + "] into Grakn ...")
load_data_into_grakn(input, session)
def load_data_into_grakn(input, session):
items = parse_data_to_dictionaries(input)
for item in items:
with session.transaction().write() as transaction:
graql_insert_query = input["template"](item)
print("Executing Graql Query: " + graql_insert_query)
transaction.query(graql_insert_query)
transaction.commit()
print("\nInserted " + str(len(items)) + " items from [ " + input["data_path"] + "] into Grakn.\n")
However, if you write the same thing this way, by simply not passing the session to the function, the error completely disappear...
def build_phone_call_graph(inputs):
with GraknClient(uri=URI) as client:
with client.session(keyspace = KEYSPACE) as session:
for input in inputs:
print("Loading from [" + input["data_path"] + "] into Grakn ...")
# load_data_into_grakn(input, session)
items = parse_data_to_dictionaries(input)
for item in items:
with session.transaction().write() as transaction:
graql_insert_query = input["template"](item)
print("Executing Graql Query: " + graql_insert_query)
transaction.query(graql_insert_query)
transaction.commit()
print("\nInserted " + str(len(items)) + " items from [ " + input["data_path"] + "] into Grakn.\n")
Can't explain why... Only happens with docker.
Thanks for reporting this issue, @viktorrobin. Given how old this issue is from Grakn 1.5, and that we have rewritten Grakn in the 2.0 release (and renamed it to TypeDB), we do not believe this issue still exist and will close this now.
Description
Similar to issue #17
When inserting data using python client, random gRPC errors occur
Environment
Reproducible Steps
Error random, but when inserting data using phone call examples, one might run into this error.
Seems to be happening when creating a new transaction.
Expected Output
No error.
Actual Output
Logs from grakn server: