SharePoint: The problem with changing UserQueryMaxTimeout
Consider the following scenario:
You have a fairly large and / or complex Active Directory (AD) infrastructure.
When using People Picker in a SharePoint 2013 or 2016 site, you are unable to find users from certain domains, and eventually the People Picker control displays an error:
“Sorry, we’re having trouble reaching the server”.
You do some research and find several blogs that say to edit clientpeoplepicker.js and set SPClientPeoplePicker.UserQueryMaxTimeout to 60 (seconds).
Here are the problems with that “solution”:
- It’s technically unsupported to make changes to SharePoint supporting files on the file system.
- Any SharePoint cumulative update or service pack could include a new version of clientpeoplepicker.js, in which case, your change will be overwritten.
- There are several blogs out there that seem to imply that changing the default value (“25e3”) to “60” will increase the timeout to 60 seconds. That is incorrect. You would actually need to change it to “60e3”. Changing it to just “60” sets the timeout to 60 milliseconds. The result being that People Picker immediately displays the “Sorry, we’re having trouble reaching the server” error.
- Increasing a timeout is rarely the best solution. Ok great, now the People Picker control no longer throws the error, but it takes 45 seconds to pull up results. Are you happy?
So what should you do instead?
Troubleshoot. Review logs, review network traces, review your People Picker configuration, etc, to figure out why it’s taking so long to find users.
In most cases, the reason that the default 25 second timeout is not long enough falls into one of these categories:
- Your People Picker settings are not optimally configured, leading to wasting time searching unnecessary domains.
- There is a firewall blocking communication and causing the LDAP connection to timeout. — See my post about Peoople Picker Ports.
- DNS and Active Directory Sites and Subnets are not configured correctly, which can lead to connecting to a domain controller that is at the other end of a slow network link.
See my post on Troubleshooting People Picker Performance for more guidance.