phacility/phabricator · error · Exception

LDAP: Failed to retrieve record for user "%s" when searching

Error message

LDAP: Failed to retrieve record for user "%s" when searching with both user and anonymous credentials.

What it means

Error "LDAP: Failed to retrieve record for user "%s" when searching with both user and anonymous credentials." thrown in phacility/phabricator.

Source

Thrown at src/applications/auth/adapter/PhutilLDAPAuthAdapter.php:282

      // again below. Doing this automatically means things work correctly more
      // often without requiring additional configuration.
      if (!$this->shouldBindWithoutIdentity()) {
        // No anonymous credentials, so we just fail here.
        throw new Exception(
          pht(
            'LDAP: Failed to retrieve record for user "%s" when searching. '.
            'Credentialed users may not be able to search your LDAP server. '.
            'Try configuring anonymous credentials or fully anonymous binds.',
            $login_user));
      } else {
        // Rebind as anonymous and try the search again.
        $user = $this->anonymousUsername;
        $pass = $this->anonymousPassword;
        $this->bindLDAP($conn, $user, $pass);

        $result = $this->searchLDAPForRecord($search_query);
        if (!$result) {
          throw new Exception(
            pht(
              'LDAP: Failed to retrieve record for user "%s" when searching '.
              'with both user and anonymous credentials.',
              $login_user));
        }
      }
    }

    return $result;
  }

  private function establishConnection() {
    if (!$this->ldapConnection) {
      $host = $this->hostname;
      $port = $this->port;

      $profiler = PhutilServiceProfiler::getInstance();
      $call_id = $profiler->beginServiceCall(

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/auth/adapter/PhutilLDAPAuthAdapter.php:282 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/5ae7c4c3092a20e4. Report an issue: GitHub.