{"record":{"id":"fca4c4de85cc6a57","repo":"phacility/phabricator","slug":"you-must-specify-the-path-to-a-public-keyfile-with","errorCode":null,"errorMessage":"You must specify the path to a public keyfile with %s.","messagePattern":"You must specify the path to a public keyfile with (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php","lineNumber":36,"sourceCode":"          array(\n            'name' => 'public',\n            'param' => 'keyfile',\n            'help' => pht('Path to public keyfile.'),\n          ),\n          array(\n            'name' => 'pkcs8',\n            'param' => 'keyfile',\n            'help' => pht('Path to corresponding PKCS8 key.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $public_keyfile = $args->getArg('public');\n    if (!strlen($public_keyfile)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'You must specify the path to a public keyfile with %s.',\n          '--public'));\n    }\n\n    if (!Filesystem::pathExists($public_keyfile)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specified public keyfile \"%s\" does not exist!',\n          $public_keyfile));\n    }\n\n    $public_key = Filesystem::readFile($public_keyfile);\n\n    $pkcs8_keyfile = $args->getArg('pkcs8');\n    if (!strlen($pkcs8_keyfile)) {\n      throw new PhutilArgumentUsageException(\n        pht(","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php#L18-L54","documentation":"The bin/auth cache-pkcs8 management workflow requires the path to an SSH public keyfile via --public. execute() checks strlen() on the argument and throws PhutilArgumentUsageException before touching the filesystem when it is empty.","triggerScenarios":"Running the workflow without --public, e.g. './bin/auth cache-pkcs8 --pkcs8 /path/key.pkcs8', or building the command from an unset shell variable.","commonSituations":"Assuming the tool can infer the public key; copy-pasting an incomplete command from notes; scripts constructing flags from empty variables.","solutions":["Pass both flags: ./bin/auth cache-pkcs8 --public /path/id_rsa.pub --pkcs8 /path/key.pkcs8","Run ./bin/auth help cache-pkcs8 to confirm the required arguments."],"exampleFix":"// before\n./bin/auth cache-pkcs8 --pkcs8 key.pkcs8\n// after\n./bin/auth cache-pkcs8 --public key.pub --pkcs8 key.pkcs8","handlingStrategy":"validation","validationCode":"# before invoking, verify both flags are set\n: \"${PUB:?--public required}\"; : \"${PKCS8:?--pkcs8 required}\"\n./bin/auth cache-pkcs8 --public \"$PUB\" --pkcs8 \"$PKCS8\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run ./bin/auth help <workflow> before one-shot management commands.","Build CLI invocations from validated, non-empty variables.","Remember both --public and --pkcs8 are mandatory for cache-pkcs8."],"tags":["cli","usage","cache-pkcs8","phabricator"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}