Connect got 504 error for "__make_async_client" method do not set 'trust_env'

I’m using python weaviate-client 4.7.1,httpx 0.27.0. The Error msg is
“weaviate.exceptions.UnexpectedStatusCodeError: Meta endpoint! Unexpected status code: 504, with response body: None.”

By debugging, i found that in ‘v4.py’ this AsyncClient object below do not set trust_env, but its default value True is wrong for me.

def __make_async_client(self) -> AsyncClient:
    return AsyncClient(
        headers=self._headers,
        mounts=self.__make_mounts(),
    ) 

Here is how i init a client.
adc = AdditionalConfig()
adc.proxies = None
adc.trust_env = False

client = weaviate.WeaviateClient(
connection_params=ConnectionParams.from_params(
http_host=“10.",
http_port=8077,
http_secure=False,
grpc_host="10.
”,
grpc_port=50051,
grpc_secure=False,
),
auth_client_secret=weaviate.auth.AuthApiKey(“Tk@R0o”),
additional_config=adc,
)
client.connect()

I also tested this code below, i worked well and got 200, but when trust_env=True, i got 504 error too.
resp = httpx.get(url=‘http://10.myip*:8077/v1/meta’,headers={“authorization”:“Bearer Tk@R0o”},trust_env=False)
print(resp.status_code,resp.content)

os.environ[“no_proxy”]=“*”

problem solved! :rofl:

1 Like

Hello @aiqing,

Welcome to our community!

Fair play to you finding out the root-cause and solve it! :clap:

Have a lovely weekend!