{"record":{"id":"0f3ef333036f80fe","repo":"phacility/phabricator","slug":"this-private-key-requires-a-passphrase-but-no-pas","errorCode":null,"errorMessage":"This private key requires a passphrase, but no passphrase was provided. Check that you supplied the correct key, or provide the passphrase.","messagePattern":"This private key requires a passphrase, but no passphrase was provided\\. Check that you supplied the correct key, or provide the passphrase\\.","errorType":"exception","errorClass":"PhabricatorAuthSSHPrivateKeyIncorrectPassphraseException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/sshkey/PhabricatorAuthSSHPrivateKey.php","lineNumber":177,"sourceCode":"      }\n    }\n\n    if ($reason === $reason_format) {\n      throw new PhabricatorAuthSSHPrivateKeyFormatException(\n        pht(\n          'This private key is not formatted correctly. Check that you '.\n          'have provided the complete text of a valid private key.'));\n    }\n\n    if ($reason === $reason_passphrase) {\n      if ($passphrase) {\n        throw new PhabricatorAuthSSHPrivateKeyIncorrectPassphraseException(\n          pht(\n            'This private key requires a passphrase, but the wrong '.\n            'passphrase was provided. Check that you supplied the correct '.\n            'key and passphrase.'));\n      } else {\n        throw new PhabricatorAuthSSHPrivateKeyIncorrectPassphraseException(\n          pht(\n            'This private key requires a passphrase, but no passphrase was '.\n            'provided. Check that you supplied the correct key, or provide '.\n            'the passphrase.'));\n      }\n    }\n\n    if ($passphrase) {\n      throw new PhabricatorAuthSSHPrivateKeyUnknownException(\n        pht(\n          'This private key could not be opened with the provided passphrase. '.\n          'This might mean that the passphrase is wrong or that the key is '.\n          'not formatted correctly. Check that you have supplied the '.\n          'complete text of a valid private key and the correct passphrase.'));\n    } else {\n      throw new PhabricatorAuthSSHPrivateKeyUnknownException(\n        pht(\n          'This private key could not be opened. This might mean that the '.","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/sshkey/PhabricatorAuthSSHPrivateKey.php#L159-L195","documentation":"The mirror case of the wrong-passphrase branch: ssh-keygen's diagnostics indicate the key requires a passphrase, but no passphrase was passed to newBarePrivateKey(), so PhabricatorAuthSSHPrivateKeyIncorrectPassphraseException is thrown with the 'no passphrase was provided' wording.","triggerScenarios":"Calling newBarePrivateKey() with an empty/null passphrase on a passphrase-protected key - e.g. a credential form submitted with the passphrase field left blank for an encrypted key.","commonSituations":"Users skipping the passphrase field assuming the key is unencrypted; automation importing keys without a passphrase parameter; passphrases lost in transcription between systems.","solutions":["Supply the key's passphrase and retry","If you believe the key is unencrypted, re-check the key text - diagnostics say it is protected","If the passphrase is unknown, generate a new key pair and replace the credential"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  $bare = $private_key->newBarePrivateKey($passphrase);\n} catch (PhabricatorAuthSSHPrivateKeyIncorrectPassphraseException $ex) {\n  // Covers both wrong- and missing-passphrase messages:\n  // prompt the user for the passphrase and resubmit once.\n  $prompt_for_passphrase = true;\n} catch (PhabricatorAuthSSHPrivateKeyException $ex) {\n  throw $ex;\n}","preventionTips":["Check whether a key is encrypted before importing: 'ssh-keygen -y -f keyfile' prompting for a passphrase means one is required","Always capture the passphrase when generating keys that will be imported into credential storage"],"tags":["ssh","private-key","passphrase","phabricator"],"backgroundTag":"ssh-key-passphrase-required","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}