{"record":{"id":"5568b422d3386aa5","repo":"phacility/phabricator","slug":"you-must-specify-the-path-to-a-pkcs8-keyfile-with","errorCode":null,"errorMessage":"You must specify the path to a pkcs8 keyfile with %s.","messagePattern":"You must specify the path to a pkcs8 keyfile with (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php","lineNumber":53,"sourceCode":"    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(\n          'You must specify the path to a pkcs8 keyfile with %s.',\n          '--pkc8s'));\n    }\n\n    if (!Filesystem::pathExists($pkcs8_keyfile)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specified pkcs8 keyfile \"%s\" does not exist!',\n          $pkcs8_keyfile));\n    }\n\n    $pkcs8_key = Filesystem::readFile($pkcs8_keyfile);\n\n    $warning = pht(\n      'Adding a PKCS8 keyfile to the cache can be very dangerous. If the '.\n      'PKCS8 file really encodes a different public key than the one '.\n      'specified, an attacker could use it to gain unauthorized access.'.","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php#L35-L71","documentation":"The companion mandatory-argument check: the path to the PKCS8 keyfile must be given with --pkcs8, and an empty value aborts with PhutilArgumentUsageException. Note the message itself prints '--pkc8s' (transposed characters) — the actual flag is --pkcs8, as defined by the argument spec shown in --help.","triggerScenarios":"Omitting --pkcs8 entirely, passing it with no value, or literally typing the typo'd '--pkc8s' that a previous error message displayed; scripts passing an empty variable.","commonSituations":"Following the typo in the message literally; building the command from unset variables; copy-paste between shell scripts dropping the flag.","solutions":["Pass the flag exactly as --pkcs8 <path> (ignore the --pkc8s typo in the error text).","Run ./bin/auth help cache-pkcs8 and use the flag names shown there."],"exampleFix":"// before: flag misspelled as the error text suggests\n./bin/auth cache-pkcs8 --public key.pub --pkc8s key.pkcs8\n// after: correct flag name\n./bin/auth cache-pkcs8 --public key.pub --pkcs8 key.pkcs8","handlingStrategy":"validation","validationCode":"# guard: correct flag name is --pkcs8 (the error text has a typo)\ncase \" $* \" in *' --pkcs8 '*) ;; *) echo 'missing --pkcs8 <keyfile>' >&2; exit 2;; esac\n./bin/auth cache-pkcs8 --public \"$PUB\" --pkcs8 \"$PKCS8\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Trust --help for flag names; the thrown message for this check misspells the flag as --pkc8s.","Never copy flag names out of error text without checking help.","Build commands from validated variables."],"tags":["cli","usage","cache-pkcs8","typo","phabricator"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}