Closed TheDr1ver closed 2 years ago
Of course, after taking about a day and a half to put together a nice testing scenario I was able to find out a solution to my problem (though maybe not the underlying cause).
Apparently I was just trying to do too much with a single open transaction. Once I opened a second transaction (and effectively, another client), I had no issues at all.
A little background as to what caused this in the first place - I'm working on a
web UI for my TypeDB-based tool, and I'm building it with Python Flask. The
issue would occur when I would launch a web page that took ~14 seconds for the
background searches to fully complete. In the meantime, if someone were to click
a link while the background process was churning, it would throw the gRPC call error 8
error.
Fortunately, creating this troubleshooting repo made it easy to test things that had the potential to mitigate the error. Once I realized adding a new client for the second thread caused it to no longer be raised, I tested adding a new client handler for each Flask route entrypoint and sure enough, that fixed it!
Case closed. Thanks for the public sounding board ;)
Oh, and as a bonus (to whomever might be reading this) while auto-generating content, I noticed that it really didn't like querying the database when I allowed there to be the zero-epoch dates inserted.
That might be an artifact of Windows, since the error it threw was an OSError
, but once I told the fake_data
generator to pick a min epoch date of 1 instead of 0 it no longer had any issues.
Here's the error it threw in case anyone happens to come across this via search:
\lib\site-packages\typedb\concept\thing\attribute.py", line 214, in of
return _DateTimeAttribute(concept_proto_reader.iid(thing_proto.iid), thing_proto.inferred, concept_proto_reader.attribute_type(thing_proto.type), datetime.fromtimestamp(float(thing_proto.value.date_time) / 1000.0))
OSError: [Errno 22] Invalid argument
Description
Note this is quite possibly related to #151, but as that issue was closed when grakn was upgraded to TypeDB, I figured this warranted opening a new issue.
I have a script that does its best to convert all TypeDB Things into individual Python objects before handling post-processing functions. I've found that if, during that conversion process, the same script is called in a second thread before the initial script has finished processing, it throws
Internal gRPC call error 8
. See below for the initial full traceback that caused me to create this repo in the first place.Error Message
Environment
Reproducible Steps
WARNING If you have an existing database named
troubleshoot_db
, you should modify ln 47 because one of the first things this script does is delete that db to start fresh.cd ./grpc_error_8
python grpc_error_8.py
The script will create a new database named
troubleshoot_db
and pre-populate it with random dummy data based on the included schema.Once the database is populated, the script will spawn two threads that attempt to query the data and perform the transaction operations necessary to convert the TypeDB data into its corresponding Python objects (the object frameworks are not included or necessary for the purpose of this exercise).
While the initial thread is proccessing, as soon as the second thread is called it will throw the aforementioned error, causing the initial results not to return.
Note: After naming both threads it appears the second thread is the one that throws the error. Initially I thought the second thread spawning was causing the first thread to crash.
Expected Output
Process both threads independently without the second thread causing the first thread to crash.
Actual Output
ValueError: Internal gRPC call error 8. Please report to https://github.com/grpc/grpc/issues