Did not get any users from LDAP -- error? -- exiting

Did not get any users from LDAP -- error? -- exiting

by Ryan Gilbert -
Number of replies: 11

Server 2012R2

Moodle 3.0.3 Build 20160331

PHP 5.6.2

IIS8

SQL Server 2014


I'm trying to setup LDAP and it keeps giving me this error when I try to run itL

Creating temporary table tmp_extuser
Did not get any users from LDAP -- error? -- exiting
It never does anything else, and it will sit there until I manually close it.  is there somewhere else that will generate a more verbose log that might point me in the right direction, or has anyone had this issue before?
Average of ratings: -
In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Ryan,

This is a shot in the dark for me but...does turning debugging errors on give you any more output than that?

Site Administration -> Development -> Debugging -> 

Debug messages to DEVELOPER

and Display debug messages selected. 

I have LDAP set up for authentication and account creation (approximately 1,000 new users each spring) with no issues on Moodle 3.2.2+   It's been working very smoothly for a few years now.

I guess the other thing (that you've probably already checked) is to make sure the BIND settings and User lookup settings are correct. We had some issues with incorrect settings there when we first set it all up.

Sorry, not sure if this will be of any help but...

Regards

Jason

In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Ryan Gilbert -

Thanks Jason, this is helpful. I double checked the binding name and it's right.  Here's the error I get now when I try to run ldap sync


Fatal error: Uncaught exception 'coding_exception' with message 'Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
C:\inetpub\wwwroot\moodle\lib\classes\task\manager.php on line 473

 Code should look like:

 $factory = \core\lock\lock_config::get_lock_factory('type');
 $lock = $factory->get_lock(Resource id #71);
 $lock->release();  // Locks must ALWAYS be released like this.

' in C:\inetpub\wwwroot\moodle\lib\classes\lock\lock.php:117
Stack trace:
#0 [internal function]: core\lock\lock->__destruct()
#1 {main}
  thrown in C:\inetpub\wwwroot\moodle\lib\classes\lock\lock.php on line 117

In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Ryan,

Well, it looks like a small step forward but... thoughtful

Every search I do leads me to Cron related 'lock' issues. This one:

https://tracker.moodle.org/browse/MDL-47934

Looks like it's in the same ballpark but doesn't really help as it's just a call for a more informative error message, I think. 

I guess you are letting the Cron script initiate the LDAP sync?

It may be worth posting your issue in that Tracker issue (link above) to see if you can get help there...

Jason

In reply to Jason Hollowell

Re: Did not get any users from LDAP -- error? -- exiting

by Ryan Gilbert -
After spending more time researching this, I decided to upgrading to 3.3 might resolve the issue.  It did remove the original error, but now I get this.


Did not get any users from LDAP -- error? -- exiting

Fatal error: Uncaught exception 'ddl_table_missing_exception' with message 'Table "#mdl_tmp_extuser" does not exist' in C:\inetpub\wwwroot\moodle\lib\ddl\database_manager.php:326 Stack trace: #0 C:\inetpub\wwwroot\moodle\lib\dml\moodle_temptables.php(140): database_manager->drop_table(Object(xmldb_table)) #1 C:\inetpub\wwwroot\moodle\lib\dml\moodle_database.php(405): moodle_temptables->dispose() #2 C:\inetpub\wwwroot\moodle\lib\dml\sqlsrv_native_moodle_database.php(267): moodle_database->dispose() #3 C:\inetpub\wwwroot\moodle\lib\dml\moodle_database.php(160): sqlsrv_native_moodle_database->dispose() #4 [internal function]: moodle_database->__destruct() #5 {main} thrown in C:\inetpub\wwwroot\moodle\lib\ddl\database_manager.php on line 326

I manually created the SQL Table that was missing by duplicating the mdl_user table, thinking this would resolve this error, but it would just give me a different error that this table already exists, so I'm in a bit of a catch 22.  This is blowing up because that table doesn't exist, but when I create it manually, it blows up because it does exist.

In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Ryan Gilbert -

Ok, I finally fixed this issue. The first thing I had to do was enable Search Subcontexts in the LDAP server -> User Lookup Settings.  Once I did that, it was finally trying to import the users into LDAP, but then gave me unusable characters error.  I fixed this error by going to Site Administration -> Security -> Site Policies and enabling Allow Extended Characters in Usernames.


Thanks for everyone's help on this!




Average of ratings: Useful (3)
In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Ryan,

I'm glad to hear you got it all sorted out. Sorry I wasn't of more assistance. Thanks for documenting everything here on the forums.

Jason

In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by Sang Parekh -

I am also getting the error you described:

Execute scheduled task: LDAP users sync job (auth_ldap\task\sync_task)
... started 16:00:40. Current memory use 8.9MB.
Connecting to LDAP server...
Creating temporary table tmp_extuser
Did not get any users from LDAP -- error? -- exiting

Fatal error: Uncaught coding_exception: Coding error detected, it must be fixed by a programmer: A lock was created but not released at: C:\inetpub\wwwroot\lib\cronlib.php on line 279 Code should look like: $factory = \core\lock\lock_config::get_lock_factory('type'); $lock = $factory->get_lock(Resource id #505); $lock->release(); // Locks must ALWAYS be released like this. in C:\inetpub\wwwroot\lib\classes\lock\lock.php:117 Stack trace: #0 [internal function]: core\lock\lock->__destruct() #1 {main} thrown in C:\inetpub\wwwroot\lib\classes\lock\lock.php on line 117

I am running Moodle v3.4

Within the LDAP settings, I have enabled 'Search subcontexts', however this hasn't resolved the fault for me.

Any ideas?

In reply to Sang Parekh

إعادة: Re: Did not get any users from LDAP -- error? -- exiting

by moath malkawi -

Hello , 

Did you solve your issue because I am facing the same as well . 

if you found the solution please inform me . 

In reply to moath malkawi

Re: إعادة: Re: Did not get any users from LDAP -- error? -- exiting

by Laura Hindle -

I am also experiencing the exact same issue and have tried the suggestions above but, no luck.

In reply to Laura Hindle

Re: إعادة: Re: Did not get any users from LDAP -- error? -- exiting

by Leon Stok -

Maybe way too late, but I was experiencing the same issue, and was really getting nowhere, until I ran a wireshark trace on the LDAP query, and noticed I was getting a referral returned from my LDAP query on the group users. 

[searchResDone(3)  referral (.... ..   ) ]

Basically I was querying Server A for a group in domain xx.yy.net and it was sending me a referral back to Server B for ldap domain sub.xx.yy.net.

Querying server B directly worked as a charm and gave me my group results. 

In reply to Ryan Gilbert

Re: Did not get any users from LDAP -- error? -- exiting

by marisol castro -

Hi Ryan,

I am new to Moodle and have tested my LDAP connection which is good.  I am also getting your original error message about not getting users from LDAP.  You or Jason mentioned the BIND settings.  Is this a sysadmin or service type of account that was setup specifically for Moodle in AD?  Any advice would be great!  Thank you!