What happened?
AsyncFastAPI.heartbeat() requests the empty path "" instead of /heartbeat. That means await chromadb.AsyncHttpClient(...).heartbeat() hits the base API URL and then expects a JSON object with "nanosecond heartbeat".
On a normal deployment this returns unrelated content or a 404/redirect payload, so the public async health-check method fails even though the server is up. The sync HTTP client correctly uses /heartbeat.
Root Cause
# chromadb/api/async_fastapi.py
async def heartbeat(self) -> int:
response = await self._make_request("get", "") # ← empty path!
return int(response["nanosecond heartbeat"])
# chromadb/api/fastapi.py (sync — correct)
def heartbeat(self) -> int:
resp_json = self._make_request("get", "/heartbeat") # ← correct path
Expected Behavior
AsyncFastAPI.heartbeat() should call /heartbeat, matching the sync implementation and server contract.
Suggested Fix
async def heartbeat(self) -> int:
response = await self._make_request("get", "/heartbeat")
return int(response["nanosecond heartbeat"])
Versions
- Chroma: latest
main
- Python: 3.12
- OS: Linux
What happened?
AsyncFastAPI.heartbeat()requests the empty path""instead of/heartbeat. That meansawait chromadb.AsyncHttpClient(...).heartbeat()hits the base API URL and then expects a JSON object with"nanosecond heartbeat".On a normal deployment this returns unrelated content or a 404/redirect payload, so the public async health-check method fails even though the server is up. The sync HTTP client correctly uses
/heartbeat.Root Cause
Expected Behavior
AsyncFastAPI.heartbeat()should call/heartbeat, matching the sync implementation and server contract.Suggested Fix
Versions
main