{"record":{"id":"32e272735eecc885","repo":"phacility/phabricator","slug":"unable-to-read-device-public-key-while-attempting","errorCode":null,"errorMessage":"Unable to read device public key while attempting to make authenticated method call within the cluster. Use `%s` to register keys for this device. Exception: %s","messagePattern":"Unable to read device public key while attempting to make authenticated method call within the cluster\\. Use `(.+?)` to register keys for this device\\. Exception: (.+?)","errorType":"exception","errorClass":"PhutilAggregateException","httpStatus":null,"severity":"error","filePath":"src/applications/repository/storage/PhabricatorRepository.php","lineNumber":2209,"sourceCode":"      ));\n    if ($uri === null) {\n      return null;\n    }\n\n    $domain = id(new PhutilURI(PhabricatorEnv::getURI('/')))->getDomain();\n\n    $client = id(new ConduitClient($uri))\n      ->setHost($domain);\n\n    if ($viewer->isOmnipotent()) {\n      // If the caller is the omnipotent user (normally, a daemon), we will\n      // sign the request with this host's asymmetric keypair.\n\n      $public_path = AlmanacKeys::getKeyPath('device.pub');\n      try {\n        $public_key = Filesystem::readFile($public_path);\n      } catch (Exception $ex) {\n        throw new PhutilAggregateException(\n          pht(\n            'Unable to read device public key while attempting to make '.\n            'authenticated method call within the cluster. '.\n            'Use `%s` to register keys for this device. Exception: %s',\n            'bin/almanac register',\n            $ex->getMessage()),\n          array($ex));\n      }\n\n      $private_path = AlmanacKeys::getKeyPath('device.key');\n      try {\n        $private_key = Filesystem::readFile($private_path);\n        $private_key = new PhutilOpaqueEnvelope($private_key);\n      } catch (Exception $ex) {\n        throw new PhutilAggregateException(\n          pht(\n            'Unable to read device private key while attempting to make '.\n            'authenticated method call within the cluster. '.","sourceCodeStart":2191,"sourceCodeEnd":2227,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/storage/PhabricatorRepository.php#L2191-L2227","documentation":"Error \"Unable to read device public key while attempting to make authenticated method call within the cluster. Use `%s` to register keys for this device. Exception: %s\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/repository/storage/PhabricatorRepository.php:2209 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":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}