Page MenuHomePhabricator

Cannot import users from LDAP
Closed, ResolvedPublic

Description

When I import users from LDAP, following exception shows up without any message.
but i'm sure that i can registration and login with LDAP.

Unhandled Exception ("PhutilAuthCredentialException")

here is debug trace mesage:

 [2016-06-01 13:38:29] EXCEPTION: (PhutilAuthCredentialException)  at [<phutil>/src/auth/PhutilLDAPAuthAdapter.php:440]
arcanist(head=stable, ref.master=2234c8cacc21, ref.stable=0249f90a9a4a), phabricator(head=stable, ref.master=d1eed54d85bc, ref.stable=4c03f617fce8), phutil(head=stable, ref.master=5eaf0a9f5a35, ref.stable=ffdfa49b4f4a)
  #0 <#2> PhutilLDAPAuthAdapter::raiseConnectionException(resource, string) called at [<phutil>/src/auth/PhutilLDAPAuthAdapter.php:481]
  #1 <#2> PhutilLDAPAuthAdapter::bindLDAP(resource, string, PhutilOpaqueEnvelope) called at [<phutil>/src/auth/PhutilLDAPAuthAdapter.php:251]
  #2 <#2> PhutilLDAPAuthAdapter::loadLDAPUserData() called at [<phutil>/src/auth/PhutilLDAPAuthAdapter.php:161]
  #3 <#2> PhutilLDAPAuthAdapter::getLDAPUserData() called at [<phutil>/src/auth/PhutilLDAPAuthAdapter.php:114]
  #4 <#2> PhutilLDAPAuthAdapter::getAccountID() called at [<phabricator>/src/applications/people/controller/PhabricatorPeopleLdapController.php:143]
  #5 <#2> PhabricatorPeopleLdapController::processSearchRequest(AphrontRequest) called at [<phabricator>/src/applications/people/controller/PhabricatorPeopleLdapController.php:55]
  #6 <#2> PhabricatorPeopleLdapController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
  #7 phlog(PhutilAuthCredentialException) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:32]
  #8 PhabricatorDefaultRequestExceptionHandler::handleRequestException(AphrontRequest, PhutilAuthCredentialException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:644]
  #9 AphrontApplicationConfiguration::handleException(PhutilAuthCredentialException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:242]
  #10 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
  #11 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]

and LDAP diagnose message:

root@dev:/usr/local/lib/php/phabricator/bin # ./auth ldap --trace
>>> [2] <connect> phabricator_auth
<<< [2] <connect> 1,370 us
>>> [3] <query> SELECT * FROM `auth_providerconfig`  ORDER BY `id` DESC 
<<< [3] <query> 417 us
Enter LDAP Credentials

    LDAP Username:  cwlin0416
>>> [4] <exec> $ stty -echo
<<< [4] <exec> 16,215 us


    LDAP Password:  >>> [5] <exec> $ stty echo
<<< [5] <exec> 13,082 us

Connecting to LDAP...
>>> [6] <ldap> connect (ldap.idic.kuas.edu.tw:389)
<<< [6] <ldap> 2,609 us
>>> [7] <ldap> bind (uid=cwlin0416,ou=People,dc=idic,dc=kuas.edu.tw)
<<< [7] <ldap> 3,227 us
>>> [8] <ldap> search (ou=People,dc=idic,dc=kuas.edu.tw, uid=cwlin0416)
<<< [8] <ldap> 617 us
Found LDAP Account: cwlin0416

Phabricator version is

Current Versions	
phabricator 4c03f617fce8a498c1dcdc6e9b2d635a6eb713e9 (Mon, May 30) 
arcanist 0249f90a9a4aa42da0823673a6ac8c620251d82a (Sat, May 21) 
phutil ffdfa49b4f4ab16a85a22b2a55da753617a2aef1 (Mon, May 30)

Event Timeline

I found problem, because I type fully LDAP DN (cn=root,dc=example,dc=domain) as Username at Import from LDAP.
but if there could have any error message will be better.

epriestley claimed this task.
epriestley added a subscriber: epriestley.

It sounds like this is resolved. We almost certainly can not raise a more specific exception.