databio / bbconf

Configuration package for bedbase project
https://pypi.org/project/bbconf/
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

missing qdrant backend #27

Closed nsheff closed 6 months ago

nsheff commented 8 months ago

I'm getting a cryptic error message. So we need to correct this problem,and ideally, make the error message more clear, so I know how to solve this as a user. When running uvicorn bedhost.main:app --reload I get:

  File "/home/nsheff/code/bedhost/bedhost/helpers.py", line 217, in configure
    raise BedHostException(f"Bedbase config was not provided or is incorrect: {e}")
bedhost.exceptions.BedHostException: Bedbase config was not provided or is incorrect: 'BedHostConf' object has no attribute '_qdrant_backend'
nsheff commented 8 months ago

It's not true that the bedbase config was not provided or is incorrect. So, we need to do something to change the error message to not be misleading when something like this goes wrong.

nsheff commented 8 months ago

Thanks! that error went away, but now I'm getting this error:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nsheff/.local/lib/python3.11/site-packages/bbconf/bbconf.py", line 106, in __init__
    self._qdrant_backend = self._init_qdrant_backend()
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/bbconf/bbconf.py", line 498, in _init_qdrant_backend
    return QdrantBackend(
           ^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/geniml/search/backends/dbbackend.py", line 56, in __init__
    self.qd_client.recreate_collection(
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/qdrant_client.py", line 1386, in recreate_collection
    return self._client.recreate_collection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/qdrant_remote.py", line 1786, in recreate_collection
    self.delete_collection(collection_name, timeout=timeout)
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/qdrant_remote.py", line 1679, in delete_collection
    result: Optional[bool] = self.http.collections_api.delete_collection(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/http/api/collections_api.py", line 866, in delete_collection
    return self._build_for_delete_collection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/http/api/collections_api.py", line 274, in _build_for_delete_collection
    return self.api_client.request(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 68, in request
    return self.send(request, type_)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.11/site-packages/qdrant_client/http/api_client.py", line 91, in send
    raise UnexpectedResponse.for_response(response)
qdrant_client.http.exceptions.UnexpectedResponse: Unexpected Response: 403 (Forbidden)
Raw response content:
b'{"error":"forbidden"}'
khoroshevskyi commented 8 months ago

The problem is, that yacman, or bbconf is not retrieving env vars. Where should it be done, in yacman or in bbconf?

nsheff commented 8 months ago

if you have a YAMLConfigManager, you can use .exp to expand env vars