phacility/phabricator · error · Exception

Repository "%s" is being synchronized on device "%s", but th

Error message

Repository "%s" is being synchronized on device "%s", but this device is not bound to the corresponding cluster service ("%s").

What it means

Leader election concluded this device must be the leader (single remaining device), but the active bindings of the repository's Almanac service do not include this device. In other words, this host is synchronizing a repository for a cluster service it no longer belongs to, which indicates a configuration drift the engine refuses to paper over.

Source

Thrown at src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:284

      $bindings = $service->getActiveBindings();
      $device_map = array();
      foreach ($bindings as $binding) {
        $device_map[$binding->getDevicePHID()] = true;
      }

      if (count($device_map) > 1) {
        throw new Exception(
          pht(
            'Repository "%s" exists on more than one device, but no device '.
            'has any repository version information. There is no way for the '.
            'software to determine which copy of the existing data is '.
            'authoritative. Promote a device or see "Ambiguous Leaders" in '.
            'the documentation.',
            $repository->getDisplayName()));
      }

      if (empty($device_map[$device->getPHID()])) {
        throw new Exception(
          pht(
            'Repository "%s" is being synchronized on device "%s", but '.
            'this device is not bound to the corresponding cluster '.
            'service ("%s").',
            $repository->getDisplayName(),
            $device->getName(),
            $service->getName()));
      }

      // The current device is the only device in service, so it must be a
      // leader. We can safely have any future nodes which come online read
      // from it.
      PhabricatorRepositoryWorkingCopyVersion::updateVersion(
        $repository_phid,
        $device_phid,
        0);

      $result_version = 0;

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Re-add an active binding for this device to the repository's Almanac service, with the correct protocol setting
  2. Or stop the daemons on this device / move those repository jobs to properly bound devices, and let cluster state settle
  3. After rebinding, run 'bin/repository update <monogram>' on this device to resynchronize
Defensive patterns

Strategy: validation

Validate before calling

$device = AlmanacKeys::getLiveDevice();
$bound = mpull($service->getActiveBindings(), 'getDevicePHID');
if (!in_array($device->getPHID(), $bound, true)) {
  // this host must not run sync jobs for the service; skip or alert
}

Type guard

function isDeviceBoundToService($device_phid, array $bindings) {
  return in_array($device_phid, mpull($bindings, 'getDevicePHID'), true);
}

Try / catch

try {
  $engine->synchronizeWorkingCopy();
} catch (Exception $ex) {
  // stop dispatching this repository's jobs on this host until the binding is restored
}

Prevention

When it happens

Trigger: A device was removed (or its binding disabled) from the repository's Almanac service while its daemons still had pending sync/discovery jobs for that repository; or working-copy storage ended up on a host that was never bound to the service.

Common situations: Removing a device from a service during maintenance without draining its job queue; hand-copying repository storage to a new host and expecting it to synchronize without binding it.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/e649e555fbd9e320. Report an issue: GitHub.