-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
Reproduce:
.env file with following content:
CHROMA_API_KEY=ck-xxxxx
CHROMA_TENANT=1fceb899-xxxxx
CHROMA_DATABASE=chroma
import json
from os import environ
from dotenv import load_dotenv
import chromadb
load_dotenv()
print(environ['CHROMA_API_KEY']) # verify the key is loaded
client = chromadb.CloudClient(tenant=environ['CHROMA_TENANT'],database=environ['CHROMA_DATABASE'])
client.list_collections()Versions
v1.4.0 (earlier versions too)
Relevant log output
ChromaError Traceback (most recent call last)
Cell In[1], line 9
6 load_dotenv()
8 print(environ)
----> 9 client = chromadb.CloudClient(tenant=environ['CHROMA_TENANT'],database=environ['CHROMA_DATABASE'])
11 # client = chromadb.CloudClient()
12 client.list_collections()
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/__init__.py:413, in CloudClient(tenant, database, api_key, settings, cloud_host, cloud_port, enable_ssl)
410 settings.chroma_auth_token_transport_header = TokenTransportHeader.X_CHROMA_TOKEN
411 settings.chroma_overwrite_singleton_tenant_database_access_from_auth = True
--> 413 return ClientCreator(tenant=tenant, database=database, settings=settings)
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/client.py:77, in Client.__init__(self, tenant, database, settings)
74 # Get the root system component we want to interact with
75 self._server = self._system.instance(ServerAPI)
---> 77 user_identity = self.get_user_identity()
79 maybe_tenant, maybe_database = maybe_set_tenant_and_database(
80 user_identity,
81 overwrite_singleton_tenant_database_access_from_auth=settings.chroma_overwrite_singleton_tenant_database_access_from_auth,
82 user_provided_tenant=tenant,
83 user_provided_database=database,
84 )
86 # this should not happen unless types are invalidated
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/client.py:131, in Client.get_user_identity(self)
129 # Propagate ChromaErrors
130 except ChromaError as e:
--> 131 raise e
132 except Exception as e:
133 raise ValueError(str(e))
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/client.py:124, in Client.get_user_identity(self)
121 @override
122 def get_user_identity(self) -> UserIdentity:
123 try:
--> 124 return self._server.get_user_identity()
125 except httpx.ConnectError:
126 raise ValueError(
127 "Could not connect to a Chroma server. Are you sure it is running?"
128 )
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/telemetry/opentelemetry/__init__.py:150, in trace_method.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
148 global tracer, granularity
149 if trace_granularity < granularity:
--> 150 return f(*args, **kwargs)
151 if not tracer:
152 return f(*args, **kwargs)
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/fastapi.py:225, in FastAPI.get_user_identity(self)
222 @trace_method("FastAPI.get_user_identity", OpenTelemetryGranularity.OPERATION)
223 @override
224 def get_user_identity(self) -> UserIdentity:
--> 225 return UserIdentity(**self._make_request("get", "/auth/identity"))
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/fastapi.py:131, in FastAPI._make_request(self, method, path, **kwargs)
128 url = self._api_url + escaped_path
130 response = self._session.request(method, url, **cast(Any, kwargs))
--> 131 BaseHTTPClient._raise_chroma_error(response)
132 return orjson.loads(response.text)
File ~/experiments/chroma/chroma-taz-29/chroma/chromadb/api/base_http_client.py:129, in BaseHTTPClient._raise_chroma_error(resp)
126 pass
128 if chroma_error:
--> 129 raise chroma_error
131 try:
132 resp.raise_for_status()
ChromaError: Permission denied.Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working