{"record":{"id":"ddd693f0b5860c94","repo":"lancedb/lancedb","slug":"lance-blob-v2-is-already-registered-by-another-ext","errorCode":null,"errorMessage":"lance.blob.v2 is already registered by another extension class","messagePattern":"lance\\.blob\\.v2 is already registered by another extension class","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/python/lancedb/schema.py","lineNumber":177,"sourceCode":"    except ModuleNotFoundError as err:\n        if err.name not in (\"lance\", \"lance.blob\"):\n            raise\n    else:\n        blob_type = getattr(blob_module, \"BlobType\", None)\n        if blob_type is not None:\n            registered_type = _deserialize_registered_type(blob_type())\n            if type(registered_type) is not blob_type:\n                registered_cls = type(registered_type)\n                raise ValueError(\n                    \"lance.blob.v2 is already registered by \"\n                    f\"{registered_cls.__module__}.{registered_cls.__qualname__}\"\n                )\n            _resolved_blob_type = blob_type\n            return blob_type\n    try:\n        pa.register_extension_type(_FallbackBlobType())  # type: ignore[arg-type]\n    except pa.ArrowKeyError as err:\n        raise ValueError(\n            \"lance.blob.v2 is already registered by another extension class\"\n        ) from err\n    _resolved_blob_type = _FallbackBlobType\n    return _resolved_blob_type\n\n\ndef blob(name: str, nullable: bool = True) -> pa.Field:\n    \"\"\"Create a Lance blob v2 column field.\n\n    When pylance is installed this is ``lance.blob.BlobType``.\n    \"\"\"\n    blob_type = _resolve_blob_type()\n    return pa.field(name, blob_type(), nullable=nullable)\n\n\ndef vector(dimension: int, value_type: pa.DataType = pa.float32()) -> pa.DataType:\n    \"\"\"A help function to create a vector type.\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/lancedb/lancedb/blob/c7b051aff7039333a3f61b79217246c27676806a/python/python/lancedb/schema.py#L159-L195","documentation":"As a fallback, lancedb registers its own _FallbackBlobType under the 'lance.blob.v2' Arrow extension name. If PyArrow rejects the registration because the name is already taken (pa.ArrowKeyError), this ValueError is raised. Like error 403, it means another class already owns the lance.blob.v2 extension name in this process.","triggerScenarios":"Something registered a PyArrow extension type with field name 'lance.blob.v2' before lancedb lazily resolves its blob type — e.g. another lance version's module, or a custom extension using the same name; first access to lancedb.schema.BlobType or a blob column then fails.","commonSituations":"Duplicate/stale lance installations; importing two forked/vendored blob implementations; running multiple incompatibly versioned LanceDB components in one interpreter; test suites that register extension types globally without cleanup.","solutions":["Remove duplicate lance installs: pip uninstall -y lance lancedb && pip install -U lancedb lance.","Grep dependencies for \"lance.blob.v2\" / register_extension_type and eliminate the competing registration.","Clean up extension registrations in tests (pa.unregister_extension_type) between test runs.","Import lancedb first in the process so its blob type wins the registration."],"exampleFix":"# before\ncustom_ext.py: pa.register_extension_type(MyBlobType())  # uses 'lance.blob.v2'\n# after\nMyBlobType.__arrow_ext_class__ ... use a unique name e.g. 'myapp.blob.v1'","handlingStrategy":"fallback","validationCode":"import pyarrow as pa\nexts = getattr(pa, \"extension_types\", lambda: {})()\nif \"lance.blob.v2\" in exts:\n    print(\"lance.blob.v2 already registered by\", exts[\"lance.blob.v2\"])","typeGuard":null,"tryCatchPattern":"try:\n    from lancedb.schema import BlobType\nexcept ValueError as err:\n    # 'already registered by another extension class'\n    # fix env, then retry\n    raise","preventionTips":["Don't register custom Arrow extension types under 'lance.*' names","Uninstall stale lance versions before upgrading","Run each process with a single, coherent set of lance packages"],"tags":["python","pyarrow","extension-type","conflict"],"backgroundTag":"module-init-failed","analyzedSha":"c7b051aff7039333a3f61b79217246c27676806a","analyzedAt":"2026-09-08T23:42:37.579Z","contentChangedAt":"2026-09-08T23:42:37.579Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}