{"record":{"id":"fc89f02b3dab37b4","repo":"chroma-core/chroma","slug":"invalid-topic-name-topic-name","errorCode":null,"errorMessage":"Invalid topic name: {topic_name}","messagePattern":"Invalid topic name: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/ingest/impl/utils.py","lineNumber":15,"sourceCode":"import re\nfrom typing import Tuple\nfrom uuid import UUID\n\nfrom chromadb.db.base import SqlDB\nfrom chromadb.segment import SegmentManager, VectorReader\n\ntopic_regex = r\"persistent:\\/\\/(?P<tenant>.+)\\/(?P<namespace>.+)\\/(?P<topic>.+)\"\n\n\ndef parse_topic_name(topic_name: str) -> Tuple[str, str, str]:\n    \"\"\"Parse the topic name into the tenant, namespace and topic name\"\"\"\n    match = re.match(topic_regex, topic_name)\n    if not match:\n        raise ValueError(f\"Invalid topic name: {topic_name}\")\n    return match.group(\"tenant\"), match.group(\"namespace\"), match.group(\"topic\")\n\n\ndef create_topic_name(tenant: str, namespace: str, collection_id: UUID) -> str:\n    return f\"persistent://{tenant}/{namespace}/{str(collection_id)}\"\n\n\ndef trigger_vector_segments_max_seq_id_migration(\n    db: SqlDB, segment_manager: SegmentManager\n) -> None:\n    \"\"\"\n    Trigger the migration of vector segments' max_seq_id from the pickled metadata file to SQLite.\n\n    Vector segments migrate this field automatically on init—so this should be used when we know segments are likely unmigrated and unloaded.\n\n    This is a no-op if all vector segments have already migrated their max_seq_id.\n    \"\"\"\n    with db.tx() as cur:","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/ingest/impl/utils.py#L1-L33","documentation":"Guard in parse_topic_name: topic names must match the 'persistent://tenant/namespace/topic' pattern; a non-conforming string yields no regex match and is rejected, with the offending name in the message.","triggerScenarios":"Thrown at chromadb/ingest/impl/utils.py:15 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Format the topic as persistent://<tenant>/<namespace>/<topic>","Use create_topic_name to build the topic string instead of hand-assembling it","Check for missing prefix, wrong separators, or URL-encoded characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","contentChangedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}