{"record":{"id":"59a34a3013901468","repo":"phacility/phabricator","slug":"service-s-is-not-bound-to-any-devices","errorCode":null,"errorMessage":"Service \"%s\" is not bound to any devices.","messagePattern":"Service \"(.+?)\" is not bound to any devices\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php","lineNumber":95,"sourceCode":"      if (!$service) {\n        throw new PhutilArgumentUsageException(\n          pht('No device or service named \"%s\" exists.', $target_name));\n      }\n\n      if ($promote) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'You can not \"--promote\" an entire service (\"%s\"). Only a single '.\n            'device may be promoted.',\n            $target_name));\n      }\n\n      $bindings = id(new AlmanacBindingQuery())\n        ->setViewer($viewer)\n        ->withServicePHIDs(array($service->getPHID()))\n        ->execute();\n      if (!$bindings) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Service \"%s\" is not bound to any devices.',\n            $target_name));\n      }\n\n      $interfaces = id(new AlmanacInterfaceQuery())\n        ->setViewer($viewer)\n        ->withPHIDs(mpull($bindings, 'getInterfacePHID'))\n        ->execute();\n\n      $device_phids = mpull($interfaces, 'getDevicePHID');\n\n      $devices = id(new AlmanacDeviceQuery())\n        ->setViewer($viewer)\n        ->withPHIDs($device_phids)\n        ->execute();\n    }\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementThawWorkflow.php#L77-L113","documentation":"When thaw demotes a whole Almanac service, it first loads the service's bindings (AlmanacBindingQuery) to find the affected interfaces and devices. A service with no bindings has no devices to act on, so the operation cannot proceed and this PhutilArgumentUsageException is raised.","triggerScenarios":"Running `./bin/repository thaw --demote <service>` where the Almanac service has zero bindings — devices were removed or the service was created but never bound to any network interface.","commonSituations":"Leftover service objects after decommissioning cluster devices; services created during a re-architecture before bindings were configured; demoting a service whose bindings were already removed as part of teardown.","solutions":["Bind the service to at least one device/interface in the Almanac console if it is still meant to be in use.","If the service is intentionally dead configuration, remove the stale service rather than thawing it.","If you meant to act on a single device of a bound service, pass the device name directly."],"exampleFix":"# before\n./bin/repository thaw --demote old-repo-service\n# Usage exception: Service \"old-repo-service\" is not bound to any devices.\n\n# after: bind devices in Almanac, or target a real bound service/device\n# (Almanac console: add bindings, then retry)\n./bin/repository thaw --demote repo-cluster","handlingStrategy":"validation","validationCode":"# Before demoting a service, confirm it has bindings\nsvc='repo-cluster'\nbindings=$(mysql -N -B phabricator_almanac -e \\\n  \"SELECT COUNT(*) FROM almanac_binding b\n     JOIN almanac_service s ON s.phid = b.servicePHID\n   WHERE s.name = '$svc'\")\n[ \"$bindings\" -gt 0 ] || { echo \"service $svc has no bindings; nothing to demote\" >&2; exit 1; }\n./bin/repository thaw --demote \"$svc\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind services to devices as part of creating them; treat unbound services as configuration debt and delete them.","During decommissioning, remove bindings and the service together so stale objects cannot be targeted later."],"tags":["php","phabricator","cli","thaw","almanac","clustering","unbound-service"],"backgroundTag":"service-has-no-bindings","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}