Skip to content

fix(qdrant): handle 401/403 in ensureCollection for scoped JWTs#4356

Merged
whysosaket merged 1 commit intomem0ai:mainfrom
huveewomg:fix/qdrant-scoped-jwt-401-403
Mar 17, 2026
Merged

fix(qdrant): handle 401/403 in ensureCollection for scoped JWTs#4356
whysosaket merged 1 commit intomem0ai:mainfrom
huveewomg:fix/qdrant-scoped-jwt-401-403

Conversation

@huveewomg
Copy link
Copy Markdown
Contributor

@huveewomg huveewomg commented Mar 16, 2026

Description

ensureCollection calls createCollection and only catches 409 Conflict to handle the "already exists" case. When Qdrant is configured with a collection-scoped JWT, createCollection returns 401/403 because creating collections requires global access. These status codes were not caught, causing every write operation to throw.

This is a regression introduced by #4297 which changed ensureCollection to an atomic create-and-catch-409 pattern. The fix correctly handled the 409 race condition but did not account for 401/403 responses from scoped JWTs.

Fixes #4355

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Verified by live debugging against the compiled dist/oss/index.mjs in a running container configured with Qdrant collection-scoped JWTs. Before the fix every mem.add() call threw 403 Forbidden: Global access is required. After the fix the call succeeds — getCollection runs with the scoped token and confirms the collection exists.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Maintainer Checklist

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 16, 2026

CLA assistant check
All committers have signed the CLA.

@whysosaket whysosaket merged commit 9eb5b9e into mem0ai:main Mar 17, 2026
1 of 2 checks passed
@huveewomg huveewomg deleted the fix/qdrant-scoped-jwt-401-403 branch March 25, 2026 05:31
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ensureCollection throws 403 with Qdrant scoped JWTs — only catches 409, not 401/403

4 participants