{"record":{"id":"66d390cf269cce4e","repo":"jax-ml/jax","slug":"coordinator-address-should-be-defined","errorCode":null,"errorMessage":"coordinator_address should be defined.","messagePattern":"coordinator_address should be defined\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/distributed.py","lineNumber":137,"sourceCode":"\n    if local_device_ids is None and (env_ids := os.environ.get('JAX_LOCAL_DEVICE_IDS')):\n      local_device_ids = list(map(int, env_ids.split(\",\")))\n\n    if (cluster_detection_method != 'deactivate' and\n        None in (coordinator_address, num_processes, process_id, local_device_ids)):\n      (coordinator_address, num_processes, process_id, local_device_ids) = (\n          clusters.ClusterEnv.auto_detect_unset_distributed_params(\n              coordinator_address,\n              num_processes,\n              process_id,\n              local_device_ids,\n              cluster_detection_method,\n              initialization_timeout,\n          )\n      )\n\n    if coordinator_address is None:\n      raise ValueError('coordinator_address should be defined.')\n    if num_processes is None:\n      raise ValueError('Number of processes must be defined.')\n    if process_id is None:\n      raise ValueError('The process id of the current process must be defined.')\n    if not isinstance(process_id, int):\n      raise TypeError(\"process_id must be a nonnegative int. \"\n                      f\"Got process_id={process_id} of type {type(process_id)}.\")\n    if not isinstance(num_processes, int):\n      raise TypeError(\"num_processes must be a positive int. \"\n                      f\"Got num_processes={num_processes} of type {type(num_processes)}.\")\n    if not (0 <= process_id < num_processes):\n      raise ValueError(\"process_id and num_processes must be nonnegative, with process_id < num_processes. \"\n                       f\"Got process_id={process_id}, num_processes={num_processes}.\")\n\n    self.coordinator_address = coordinator_address\n\n    # The default value of [::]:port tells the coordinator to bind to all\n    # available addresses on the same port as coordinator_address.","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/distributed.py#L119-L155","documentation":"jax.distributed.initialize requires a coordinator address (host:port of process 0) unless cluster auto-detection supplied one. Passing None (the default when no detection method is used) raises this ValueError immediately.","triggerScenarios":"jax.distributed.initialize() with no coordinator_address and no cluster_detection_method; or explicitly passing coordinator_address=None on worker processes.","commonSituations":"Launching multi-host jobs with a launcher (torchrun/mpirun/slurm) but forgetting to plumb the coordinator env var into initialize; copy-pasted initialization code missing the address argument.","solutions":["Pass coordinator_address='10.0.0.1:12345' (process 0's IP and a free port) on every process","Or use a cluster_detection_method (e.g. slurm) so the address is auto-derived","Export JAX_COORDINATOR_ADDRESS and read it in code: os.environ['JAX_COORDINATOR_ADDRESS']"],"exampleFix":"# before\njax.distributed.initialize()\n# after\njax.distributed.initialize(\n    coordinator_address=os.environ['JAX_COORDINATOR_ADDRESS'],\n    num_processes=int(os.environ['NRANKS']), process_id=int(os.environ['RANK']))","handlingStrategy":"validation","validationCode":"import os\naddr = os.environ.get('JAX_COORDINATOR_ADDRESS')\nassert addr, 'JAX_COORDINATOR_ADDRESS must be set on all ranks'","typeGuard":null,"tryCatchPattern":"try:\n    jax.distributed.initialize(coordinator_address=addr, ...)\nexcept ValueError as e:\n    if 'coordinator_address' in str(e):\n        addr = os.environ['JAX_COORDINATOR_ADDRESS']; retry","preventionTips":["Plumb coordinator env vars from launch scripts","Use cluster_detection_method where available"],"tags":["jax","distributed","coordinator","config"],"backgroundTag":"missing-required-config","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}