Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Lack of Auth, headers and SSL (custom PKI/ignore) for Async client #2488

Open
tazarov opened this issue Jul 10, 2024 · 0 comments · May be fixed by #2489
Open

[Bug]: Lack of Auth, headers and SSL (custom PKI/ignore) for Async client #2488

tazarov opened this issue Jul 10, 2024 · 0 comments · May be fixed by #2489
Assignees
Labels
bug Something isn't working

Comments

@tazarov
Copy link
Contributor

tazarov commented Jul 10, 2024

What happened?

https://discord.com/channels/1073293645303795742/1260528427866521693

Versions

Chroma 0.5.3, Python: Any

Relevant log output

api_with_server_auth = <chromadb.api.async_fastapi.AsyncFastAPI object at 0x1280cc790>

    def test_server_basic_auth(api_with_server_auth: ServerAPI) -> None:
>       cols = api_with_server_auth.list_collections()

chromadb/test/auth/test_basic_authn.py:13: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
chromadb/utils/async_to_sync.py:28: in sync_wrapper
    result = loop.run_until_complete(func(*args, **kwargs))
../../../.pyenv/versions/3.11.7/lib/python3.11/asyncio/base_events.py:653: in run_until_complete
    return future.result()
chromadb/telemetry/opentelemetry/__init__.py:133: in async_wrapper
    return await f(*args, **kwargs)
chromadb/api/async_fastapi.py:210: in list_collections
    resp_json = await self._make_request(
chromadb/api/async_fastapi.py:142: in _make_request
    BaseHTTPClient._raise_chroma_error(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

resp = <Response [403 Forbidden]>

    @staticmethod
    def _raise_chroma_error(resp: httpx.Response) -> None:
        """Raises an error if the response is not ok, using a ChromaError if possible."""
        try:
            resp.raise_for_status()
            return
        except httpx.HTTPStatusError:
            pass
    
        chroma_error = None
        try:
            body = json.loads(resp.text)
            if "error" in body:
                if body["error"] in errors.error_types:
                    chroma_error = errors.error_types[body["error"]](body["message"])
    
        except BaseException:
            pass
    
        if chroma_error:
            raise chroma_error
    
        try:
            resp.raise_for_status()
        except httpx.HTTPStatusError:
>           raise (Exception(resp.text))
E           Exception: {"detail":"Forbidden"}

chromadb/api/base_http_client.py:97: Exception
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BasicAuthenticationServerProvider.authenticate failed: AuthError('Authorization header not found')
@tazarov tazarov added the bug Something isn't working label Jul 10, 2024
@tazarov tazarov self-assigned this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant