0
import weaviate
weaviate.Client(
        url="https://myserver/weaviate",
        auth_client_secret=weaviate.AuthApiKey(
            api_key='myapikey'
        ),
    additional_headers={"X-OpenAI-Api-Key": 'your openai key'},
    )
JSONDecodeError                           Traceback (most recent call last)
File ~/opt/anaconda3/envs/test_2/lib/python3.8/site-packages/requests/models.py:971, in Response.json(self, **kwargs)
    970 try:
--> 971     return complexjson.loads(self.text, **kwargs)
    972 except JSONDecodeError as e:
    973     # Catch JSON-related errors and raise as requests.JSONDecodeError
    974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError

File ~/opt/anaconda3/envs/test_2/lib/python3.8/json/__init__.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    354 if (cls is None and object_hook is None and
    355         parse_int is None and parse_float is None and
    356         parse_constant is None and object_pairs_hook is None and not kw):
--> 357     return _default_decoder.decode(s)
    358 if cls is None:

File ~/opt/anaconda3/envs/test_2/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w)
    333 """Return the Python representation of ``s`` (a ``str`` instance
    334 containing a JSON document).
    335 
    336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338 end = _w(s, end).end()

File ~/opt/anaconda3/envs/test_2/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
    354 except StopIteration as err:
--> 355     raise JSONDecodeError("Expecting value", s, err.value) from None
    356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

JSONDecodeError                           Traceback (most recent call last)
Cell In[9], line 2
      1 import weaviate
----> 2 weaviate.Client(
      3         url="https://apacplato.863942082387.aws.bain.dev/weaviate",
      4         auth_client_secret=weaviate.AuthApiKey(
      5             api_key='Results!'
      6         ),
      7     additional_headers={"X-OpenAI-Api-Key": 'your openai key'},
      8     )

File ~/opt/anaconda3/envs/test_2/lib/python3.8/site-packages/weaviate/client.py:150, in Client.__init__(self, url, auth_client_secret, timeout_config, proxies, trust_env, additional_headers, startup_period, embedded_options, additional_config)
    147 url, embedded_db = self.__parse_url_and_embedded_db(url, embedded_options)
    148 config = Config() if additional_config is None else additional_config
--> 150 self._connection = Connection(
    151     url=url,
    152     auth_client_secret=auth_client_secret,
    153     timeout_config=_get_valid_timeout_config(timeout_config),
    154     proxies=proxies,
    155     trust_env=trust_env,
    156     additional_headers=additional_headers,
    157     startup_period=startup_period,
    158     embedded_db=embedded_db,
    159     grcp_port=config.grpc_port_experimental,
    160     connection_config=config.connection_config,
    161 )
    162 self.classification = Classification(self._connection)
    163 self.schema = Schema(self._connection)

File ~/opt/anaconda3/envs/test_2/lib/python3.8/site-packages/weaviate/connect/connection.py:662, in Connection.__init__(self, url, auth_client_secret, timeout_config, proxies, trust_env, additional_headers, startup_period, connection_config, embedded_db, grcp_port)
    637 def __init__(
    638     self,
    639     url: str,
   (...)
    648     grcp_port: Optional[int] = None,
    649 ):
    650     super().__init__(
    651         url,
    652         auth_client_secret,
   (...)
    660         grcp_port,
    661     )
--> 662     self._server_version = self.get_meta()["version"]
    663     if self._server_version < "1.14":
    664         _Warnings.weaviate_server_older_than_1_14(self._server_version)

File ~/opt/anaconda3/envs/test_2/lib/python3.8/site-packages/weaviate/connect/connection.py:694, in Connection.get_meta(self)
    692 response = self.get(path="/meta")
    693 if response.status_code == 200:
--> 694     return response.json()
    695 raise UnexpectedStatusCodeException("Meta endpoint", response)

File ~/opt/anaconda3/envs/test_2/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, **kwargs)
    971     return complexjson.loads(self.text, **kwargs)
    972 except JSONDecodeError as e:
    973     # Catch JSON-related errors and raise as requests.JSONDecodeError
    974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 975     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

When I spin up a weaviate instance in my local instead of in my cloud (ec2 using a docker compose with nginx. Another layer of nginx used as reverse proxy to route requests to appropriate containers.

Does this have anything to do with nginx or the way it is deployed?

Any idea about why and what this error is?

0 Answers0