{"record":{"id":"182e5c5c69be38ff","repo":"phacility/phabricator","slug":"unable-to-read-device-private-key-while-attempting","errorCode":null,"errorMessage":"Unable to read device private 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 private 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":2224,"sourceCode":"      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. '.\n            'Use `%s` to register keys for this device. Exception: %s',\n            'bin/almanac register',\n            $ex->getMessage()),\n          array($ex));\n      }\n\n      $client->setSigningKeys($public_key, $private_key);\n    } else {\n      // If the caller is a normal user, we generate or retrieve a cluster\n      // API token.\n\n      $token = PhabricatorConduitToken::loadClusterTokenForUser($viewer);\n      if ($token) {\n        $client->setConduitToken($token->getToken());\n      }","sourceCodeStart":2206,"sourceCodeEnd":2242,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/storage/PhabricatorRepository.php#L2206-L2242","documentation":"Error \"Unable to read device private 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:2224 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"}