phacility/phabricator · critical · Exception
This host has device ID "%s", but there is no corresponding
Error message
This host has device ID "%s", but there is no corresponding device record in Almanac.
What it means
AlmanacKeys::getLiveDevice() reads this host's device identity from conf/keys/device.id (written by bin/almanac register) and looks up an AlmanacDevice with exactly that name using the omnipotent user. If no device record matches, the host cannot resolve its own cluster identity and every dependent operation (trusted-key signing, cluster auth) halts with this exception.
Source
Thrown at src/applications/almanac/util/AlmanacKeys.php:47
public static function getLiveDevice() {
$device_id = self::getDeviceID();
if (!$device_id) {
return null;
}
$cache = PhabricatorCaches::getRequestCache();
$cache_key = 'almanac.device.self';
$device = $cache->getKey($cache_key);
if (!$device) {
$viewer = PhabricatorUser::getOmnipotentUser();
$device = id(new AlmanacDeviceQuery())
->setViewer($viewer)
->withNames(array($device_id))
->executeOne();
if (!$device) {
throw new Exception(
pht(
'This host has device ID "%s", but there is no corresponding '.
'device record in Almanac.',
$device_id));
}
$cache->setKey($cache_key, $device);
}
return $device;
}
public static function getClusterSSHUser() {
$username = PhabricatorEnv::getEnvConfig('diffusion.ssh-user');
if ($username !== null && strlen($username)) {
return $username;
}
return null;View on GitHub (pinned to 5720a38cfe)
Solutions
- Create an AlmanacDevice whose name exactly matches the value in phabricator/conf/keys/device.id, then retry.
- Or re-run device registration from the host: ./bin/almanac register --device <name> ... against the target install, which writes a consistent device.id and device record.
- If this host is no longer meant to be a cluster device, remove or correct the stale phabricator/conf/keys/device.id file so getDeviceID() returns null.
- Note the result is request-cached under 'almanac.device.self', so clear the request/cache after fixing before retesting in the same process.
Defensive patterns
Strategy: validation
Validate before calling
$device_id = AlmanacKeys::getDeviceID();
if ($device_id) {
$device = id(new AlmanacDeviceQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withNames(array($device_id))
->executeOne();
if (!$device) {
throw new Exception(
"device.id says '{$device_id}' but no device record matches; ".
"register this host or remove phabricator/conf/keys/device.id");
}
} Try / catch
try {
$device = AlmanacKeys::getLiveDevice();
} catch (Exception $ex) {
// Host identity unresolvable: degrade to non-cluster behavior or halt loudly.
// Never ignore - cluster auth silently misbehaves without the device record.
throw $ex;
} Prevention
- Register hosts with ./bin/almanac register; never hand-copy conf/keys/device.id between hosts.
- Before deleting or renaming any AlmanacDevice, confirm no host's device.id still names it.
- After a DB restore or migration, verify every device.id file on disk still resolves to a device row.
- Cache note: getLiveDevice() memoizes per request, so re-test in a fresh process after fixing.
When it happens
Trigger: A host has conf/keys/device.id containing a name for which no AlmanacDevice row exists: the device was deleted or renamed in Almanac, the device.id file was copied from another host, or the database was restored without the device records.
Common situations: Re-provisioning or cloning a web/repo host and copying the keys directory; deleting 'stale' devices during an Almanac cleanup while they still ran; migrating the database to a fresh install that never had the devices registered.
Related errors
- No such device "%s" exists!
- Failed to load repository cluster service.
- Repository "%s" exists on more than one device, but no devic
- Repository "%s" is being synchronized on device "%s", but th
- This server is configured as "%s", but you are using the dom
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/4147fe9dbcc70004.
Report an issue: GitHub.