I have a behavior that I can’t explain:
I have a docker image - python:3.11 weaviate client 4.7.1
code is super simple:
client = weaviate.connect_to_weaviate_cloud(
cluster_url=WV_URL, # Replace with your Weaviate Cloud URL
auth_credentials=Auth.api_key(WV_APIKEY),
)```
and the best part - the same docker image when run locally connects fine, but run from other environment - inside kubernetes on amazon fails with:
Traceback (most recent call last):
File "/app/server.py", line 21, in <module>
client = weaviate.connect_to_weaviate_cloud(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/helpers.py", line 79, in connect_to_weaviate_cloud
return __connect(
^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/helpers.py", line 410, in __connect
raise e
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/helpers.py", line 406, in __connect
client.connect()
File "/usr/local/lib/python3.11/site-packages/weaviate/syncify.py", line 23, in sync_method
return _EventLoopSingleton.get_instance().run_until_complete(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/event_loop.py", line 40, in run_until_complete
return fut.result()
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.11/site-packages/weaviate/client_base.py", line 152, in connect
await self._connection.connect(self._skip_init_checks)
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 146, in connect
await self._open_connections(self._auth, skip_init_checks)
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 239, in _open_connections
self.__make_clients()
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 228, in __make_clients
self._client = self.__make_async_client()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/weaviate/connect/v4.py", line 222, in __make_async_client
return AsyncClient(
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1389, in __init__
super().__init__(
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 183, in __init__
self.headers = Headers(headers)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 72, in __init__
self._list = [
^
File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 76, in <listcomp>
normalize_header_value(v, encoding),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_utils.py", line 53, in normalize_header_value
return value.encode(encoding or "ascii")
Probably environment error, but is there a way to debug it ?