typhon-2-model-typhon-data-1 | Traceback (most recent call last):
typhon-2-model-typhon-data-1 | File "/root/typhon-markdown-data/app.py", line 97, in <module>
typhon-2-model-typhon-data-1 | main()
typhon-2-model-typhon-data-1 | File "/root/typhon-markdown-data/app.py", line 53, in main
typhon-2-model-typhon-data-1 | client = Client("http://localhost:8088")
typhon-2-model-typhon-data-1 | File "/usr/local/lib/python3.9/site-packages/weaviate/client.py", line 126, in __init__
typhon-2-model-typhon-data-1 | self._connection = Connection(
typhon-2-model-typhon-data-1 | File "/usr/local/lib/python3.9/site-packages/weaviate/connect/connection.py", line 533, in __init__
typhon-2-model-typhon-data-1 | super().__init__(
typhon-2-model-typhon-data-1 | File "/usr/local/lib/python3.9/site-packages/weaviate/connect/connection.py", line 112, in __init__
typhon-2-model-typhon-data-1 | self.wait_for_weaviate(startup_period)
typhon-2-model-typhon-data-1 | File "/usr/local/lib/python3.9/site-packages/weaviate/connect/connection.py", line 517, in wait_for_weaviate
typhon-2-model-typhon-data-1 | raise WeaviateStartUpError(
typhon-2-model-typhon-data-1 | weaviate.exceptions.WeaviateStartUpError: Weaviate did not start up in 5 seconds. Either the Weaviate URL http://localhost:8088 is wrong or Weaivate did not start up in the interval given in 'startup_period'.
typhon-2-model-typhon-data-1 exited with code 1
While I was trying to call client.is_ready()
, the exception is raised, although according to the documentation it is supposed to return the boolean value.
I have to mention as well that I am trying to initiate the Weaviate with custom Transformers module using Docker. And I was trying to replicate the container for importing data with their's DEMO
And my Weaviate instance took around a minute to finish starting, and until FastAPI displaying the running address in the machine.
I understand that Weaviate client has argument startup_period
specifying how long to wait for Weaviate to finish starting up, which I told it to wait for 90 sec, and the Weaviate instance is already started, the address from FastAPI is shown already within 90 sec but the problem still persist.
Below is the import snippet. It exactly the same as in the DEMO repo.
def main():
client = Client("http://localhost:8088", startup_period=90)
wait_time_limit = 240
while not client.is_ready():
if not wait_time_limit:
sys.stderr.write("\rTIMEOUT: Weaviate not ready. \
Try again or check if weaviate is running.\n")
sys.exit(1)
sys.stdout.write(
f"\rWait for weaviate to get ready. {wait_time_limit:02d} seconds left.")
sys.stdout.flush()
wait_time_limit -= 2
time.sleep(2.0)
So I have the Weaviate instance container, and the container for importing data. It does not work when I try to run both using Docker Compose. However, when I let the Weaviate finish its startup and run the import data code locally in Python, it works.
But I still don't understand why client.is_ready()
doesn't work although I specify the startup_period
in the client instantiation.