Description
I am using python 3.13.5 and weaviate client 3.26.6 version.
On trying to connect with weaviate I get this below error.
File “file path 1”, line 76, in init
self.client = self.init_weaviate_client()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “file path 1”, line 103, in init_weaviate_client
raise Exception(f"Error initializing Weaviate client: {e}")
Exception: Error initializing Weaviate client: Weaviate did not start up in 5 seconds. Either the Weaviate URL “weaviate url” is wrong or Weaviate did not start up in the interval given in ‘startup_period’.
weaviate is hosted on AWS EKS. The strange is that this error shows up only when I’m connected from home VPN but it works fine when I’m at office. There is not issue of allowing the home VPN IP address as I’m able to connect to the endpoint via curl(with auth) and browser.
Once connection is initialised from office then I am able to use that from home as well but not able to initialise connection.
code:-
def init_weaviate_client(self):
"""Initialize and return a Weaviate client version 3.26.x"""
logger.info(f"Initializing Weaviate client with URL: {WEAVIATE_URL}")
try:
\# Ensure URL is provided and properly formatted
if not WEAVIATE_URL or not WEAVIATE_URL.startswith('https'):
raise ValueError(f"Invalid Weaviate URL: {WEAVIATE_URL}. URL must start with https://")
\# Create auth config if API key is provided
auth_config = None
if WEAVIATE_API_KEY:
auth_config = weaviate.auth.AuthApiKey(api_key=WEAVIATE_API_KEY)
\# Initialize client with increased timeout
client = weaviate.Client(
url=WEAVIATE_URL,
auth_client_secret=auth_config,
timeout_config=(10, 60) # 10s connect timeout, 60s read timeout
)
return client