Error on Query endpoint, `TypeError: replace() argument 2 must be str, not None`

Hey all,

I’m trying to query a database and I get this error:

Traceback (most recent call last):
  File "/Applications/", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<string>", line 1, in <module>
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/core/utils/", line 17, in inner_func
    return func(*args, **kwargs)
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/", line 327, in query
    response = self._vector_api.query(
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/core/client/", line 776, in __call__
    return self.callable(self, *args, **kwargs)
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/core/client/api/", line 716, in __query
    return self.call_with_http_info(**kwargs)
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/core/client/", line 787, in call_with_http_info
    _host = self.api_client.configuration.get_host_from_settings(
  File "/Users/travisbarton/opt/anaconda3/envs/Project-Attention/lib/python3.10/site-packages/pinecone/core/client/", line 478, in get_host_from_settings
    url = url.replace("{" + variable_name + "}", used_value)
TypeError: replace() argument 2 must be str, not None

My query should be fine (I think) my call looks like this:

 self.index.query(vector=query, top_k=top_k, include_values=include_values,
                                include_metadata=include_metadata, **kwargs)

where query is a list of floats equal to the length of my vector, top_k = 30, include_values=False, include_metadata=True, and kwargs = {‘namespace’: ‘default’} (all checked with debugger).

self.index.query is of type:

<bound method Index.query of <pinecone.index.Index object at 0x7f9356eb0880>>

Is this a user error problem or a Pinecone problem?

Nevermind. It was an initiation error, I passed None to the initializing Index call. Changing that to the actual index name fixed this.