{"record":{"id":"d1d41b1e91041cb3","repo":"jax-ml/jax","slug":"cannot-provide-both-factory-and-options-when-r","errorCode":null,"errorMessage":"Cannot provide both 'factory' and 'options' when registering PJRT plugin. When providing a custom factory, the factory's must handle its own options.","messagePattern":"Cannot provide both 'factory' and 'options' when registering PJRT plugin\\. When providing a custom factory, the factory's must handle its own options\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/xla_bridge.py","lineNumber":625,"sourceCode":"  \"\"\"\n\n  if library_path and c_api:\n    logger.error(\n        \"Both library_path and c_api are provided when registering PJRT plugin\"\n        \" %s\",\n        plugin_name,\n    )\n    return\n  if not library_path and not c_api:\n    logger.error(\n        \"Neither library_path nor c_api provided when registering PJRT plugin\"\n        \" %s\",\n        plugin_name,\n    )\n    return\n\n  if factory is not None and options is not None:\n    raise ValueError(\n        \"Cannot provide both 'factory' and 'options' when registering PJRT\"\n        \" plugin. When providing a custom factory, the factory's must handle\"\n        \" its own options.\"\n    )\n  if factory is None:\n    factory = partial(make_pjrt_c_api_client, plugin_name, options=options)\n\n  logger.debug(\n      'registering PJRT plugin %s from %s', plugin_name, library_path\n  )\n  if library_path is not None:\n    c_api = xla_client.load_pjrt_plugin_dynamically(plugin_name, library_path)\n    _profiler.register_plugin_profiler(c_api)\n  else:\n    assert c_api is not None\n    xla_client.load_pjrt_plugin_with_c_api(plugin_name, c_api)\n\n  make_topology = make_topology or partial(xla_client.make_c_api_device_topology, c_api)","sourceCodeStart":607,"sourceCodeEnd":643,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/xla_bridge.py#L607-L643","documentation":"Error \"Cannot provide both 'factory' and 'options' when registering PJRT plugin. When providing a custom factory, the factory's must handle its own options.\" thrown in jax-ml/jax.","triggerScenarios":"Thrown at jax/_src/xla_bridge.py:625 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}