{"record":{"id":"fd8ef0d98e40f4cf","repo":"phacility/phabricator","slug":"you-must-enter-an-ldap-password","errorCode":null,"errorMessage":"You must enter an LDAP password.","messagePattern":"You must enter an LDAP password\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php","lineNumber":49,"sourceCode":"        pht('The LDAP extension is not enabled.'));\n      exit(1);\n    }\n\n    $adapter = $provider->getAdapter();\n\n    $console->writeOut(\"%s\\n\", pht('Enter LDAP Credentials'));\n    $username = phutil_console_prompt(pht('LDAP Username: '));\n    if (!strlen($username)) {\n      throw new PhutilArgumentUsageException(\n        pht('You must enter an LDAP username.'));\n    }\n\n    phutil_passthru('stty -echo');\n    $password = phutil_console_prompt(pht('LDAP Password: '));\n    phutil_passthru('stty echo');\n\n    if (!strlen($password)) {\n      throw new PhutilArgumentUsageException(\n        pht('You must enter an LDAP password.'));\n    }\n\n    $adapter->setLoginUsername($username);\n    $adapter->setLoginPassword(new PhutilOpaqueEnvelope($password));\n\n    $console->writeOut(\"\\n\");\n    $console->writeOut(\"%s\\n\", pht('Connecting to LDAP...'));\n\n    $account_ids = $adapter->getAccountIdentifiers();\n    if ($account_ids) {\n      $value_list = mpull($account_ids, 'getIdentifierRaw');\n      $value_list = implode(', ', $value_list);\n\n      $console->writeOut(\"%s\\n\", pht('Found LDAP Account: %s', $value_list));\n    } else {\n      $console->writeOut(\"%s\\n\", pht('Unable to find LDAP account!'));\n    }","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php#L31-L67","documentation":"The second interactive check in bin/auth ldap: after the username, the workflow prompts for the LDAP password with terminal echo disabled (stty -echo ... stty echo). An empty password aborts with PhutilArgumentUsageException before the adapter attempts to bind.","triggerScenarios":"Pressing Enter at the 'LDAP Password:' prompt; typing nothing because the disabled echo makes it look like input is not registering; stdin closed in non-interactive runs.","commonSituations":"Users confused by the blind password prompt; scripted invocations without a TTY; password managers not pasting into the hidden prompt.","solutions":["Re-run and type the password blind (no characters will appear — that is expected), then press Enter.","Ensure the run happens in a real terminal so stty echo suppression works.","If the password is genuinely empty on the LDAP side, use a dedicated test account with a password."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Expect blind input: echo is disabled during the password prompt, so typed characters do not display.","Run in a real TTY so stty -echo works and stdin is attached.","Use a dedicated test account with a known password."],"tags":["cli","ldap","empty-input","phabricator"],"backgroundTag":"empty-cli-input","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}