Skip to content

[BUG] Auto-generated Qdrant/FAISS collection names contain ':' and crash on Windows (local mode unusable) #4330

Description

@fszcd

Bug description

On Windows, the auto-generated collection names in QdrantStorage and FaissStorage contain : (and .) characters from datetime.now().isoformat(). Because both storages use the generated name as a local filesystem path component, simply instantiating them with default arguments crashes on Windows:

  • QdrantStorage(vector_dim=4, path=<dir>)OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<dir>\collection\2026-09-14T03:25:34.181072'
  • FaissStorage(vector_dim=4, storage_path=<dir>)RuntimeError: Error in __cdecl faiss::FileIOWriter::FileIOWriter(const char *) ... could not open C:\Users as soon as the index is persisted.

Root cause

QdrantStorage._generate_collection_name() returns datetime.now().isoformat() verbatim (camel/storages/vectordb_storages/qdrant.py:241), and FaissStorage._generate_collection_name() returns f"faiss_index_{datetime.now().isoformat()}" (camel/storages/vectordb_storages/faiss.py:123).

  • Qdrant's local mode creates a directory <path>/collection/<collection_name>, and : is illegal in Windows path components.
  • FaissStorage._get_index_path() joins storage_path with <collection_name>.index, hitting the same restriction.

Other storages in the same package already avoid this: chroma.py sanitizes with .replace(':', '-').replace('.', '-'), and milvus.py / tidb.py / weaviate.py strip non-alphanumeric characters with a regex. Only qdrant and faiss still emit raw ISO timestamps.

Reproduction (Windows)

import tempfile
from camel.storages.vectordb_storages import QdrantStorage, FaissStorage

# Qdrant local mode: crashes at instantiation
QdrantStorage(vector_dim=4, path=tempfile.mkdtemp())
# OSError: [WinError 123] ... 'C:\...\collection\2026-09-14T03:25:34.181072'

# FAISS with a storage path: crashes when the index is written
fs = FaissStorage(vector_dim=4, storage_path=tempfile.mkdtemp())
fs.add([VectorRecord(vector=[0.1, 0.2, 0.3, 0.4])])
# RuntimeError: ... could not open C:\Users\...

The bug is also visible in the existing test suite: on Windows, test/storages/vector_storages/test_all_vectordbs.py::test_vector_storage[qdrant:local] and test_get_payload_by_vector[qdrant:local] error at fixture setup with WinError 123, and test/memories/test_vector_db_memory.py errors the same way. (CI is ubuntu-only, so this is currently not covered.)

A related test-side issue: once setup succeeds, the qdrant:local fixture still fails at teardown on Windows, because shutil.rmtree(tmpdir) runs while the local Qdrant client still holds open file handles. The fixture never calls storage.close_client().

Proposed fix

  1. Sanitize the generated names in qdrant.py and faiss.py with .replace(':', '-').replace('.', '-'), following the existing chroma.py precedent.
  2. Call storage.close_client() in the qdrant:local test fixture before shutil.rmtree.
  3. Add a regression test asserting that auto-generated collection names contain no Windows-illegal path characters (<>:"/\|?*).

I'm happy to open a PR with this fix.

Environment

  • camel-ai: 0.2.91a7 (master @ 8c791b7)
  • Python: 3.10.20
  • OS: Windows 11 (10.0.26200)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions