Discussion Forum

Unable to create session with grakn keyspace after idle for some time

I am using a python 3.6 application which has grakn-client of version 1.6.0 and the grakn server version is 1.6.0. I am getting this error intermittently. Only after the grakn server is idle for some time and on the first try. Trying to connect again after this error, with create the sessionid.

Could not obtain sessionId for keyspace abc

Thanks for reporting this - I think you’ve cross posted with stack overflow (no problem) - can you see any way to make a reproducible asnwer for us to test on our machines?

Please find the error generated by python grakn-client .

<_Rendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = “OS Error”
debug_error_string = “{“created”:”@1592293927.075671633",“description”:“Error received from peer”,“file”:“src/core/lib/surface/call.cc”,“file_line”:1017,“grpc_message”:“OS Error”,“grpc_status”:14}"

Also we are getting this error while trying to retrive all keyspace name list. client.keyspaces().retrieve() is also throwing this error intermittendly.

Could you paste a code example that triggers the issue? That would be a great help to us. Also, is your python client and the Grakn server running on the same machine, or is the server somewhere remote?
Thanks!

We are using docker versions of grakn and python application. So we are pointing to grakn using the container name. FYI the code snippet.

from grakn.client import GraknClient

def get_session(uri,keyspace):
	try:
		client = GraknClient(uri)
		keyspace_list = client.keyspaces().retrieve()
		if keyspace and keyspace in keyspace_list:
			session = client.session(keyspace)
		else:
			raise("Keyspace does'nt exist!!!")
	except Exception as exc:
		print(str(exc))
	return session