{"record":{"id":"2f07c18c854a7d8c","repo":"phacility/phabricator","slug":"ldap-exception-s-ldap-error-d-s","errorCode":null,"errorMessage":"LDAP Exception: %s\nLDAP Error #%d: %s","messagePattern":"LDAP Exception: (.+?)\nLDAP Error #(.+?): (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/auth/adapter/PhutilLDAPAuthAdapter.php","lineNumber":455,"sourceCode":"\n    // This is `LDAP_INVALID_CREDENTIALS`.\n    if ($errno == 49) {\n      throw new PhutilAuthCredentialException();\n    }\n\n    if ($errno || $error) {\n      $full_message = pht(\n        \"LDAP Exception: %s\\nLDAP Error #%d: %s\",\n        $message,\n        $errno,\n        $error);\n    } else {\n      $full_message = pht(\n        'LDAP Exception: %s',\n        $message);\n    }\n\n    throw new Exception($full_message);\n  }\n\n  private function bindLDAP($conn, $user, PhutilOpaqueEnvelope $pass) {\n    $profiler = PhutilServiceProfiler::getInstance();\n    $call_id = $profiler->beginServiceCall(\n      array(\n        'type' => 'ldap',\n        'call' => 'bind',\n        'user' => $user,\n      ));\n\n    // NOTE: ldap_bind() dumps cleartext passwords into logs by default. Keep\n    // it quiet.\n    if (strlen($user)) {\n      $ok = @ldap_bind($conn, $user, $pass->openEnvelope());\n    } else {\n      $ok = @ldap_bind($conn);\n    }","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/adapter/PhutilLDAPAuthAdapter.php#L437-L473","documentation":"Error \"LDAP Exception: %s\nLDAP Error #%d: %s\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/auth/adapter/PhutilLDAPAuthAdapter.php:455 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"}