Monday, August 31, 2009

The parameter is incorrect.

This error: "The parameter is incorrect.", is displayed in the crawl log of a content source. The result is of the error is the problematic site collection is not indexed. After researching the problem on the internet, it became evident that the site collection has an ACL list exceeding ~1000 users. See this blog .

Our problematic site had a lot of broken inheritance and a lot of SharePoint Groups. But I still wasn't sure that the ACLs exceeded 1000 users. So I wrote this little program to get the exact size of the ACL in the site collection:


try
{
using (SPSite _site = new SPSite(url))
{
try
{
IDictionary AllReusableAcls;
AllReusableAcls = _site.GetAllReusableAcls();
System.Console.WriteLine("Count of Values in ACL: {0}", AllReusableAcls.Values.Count);

foreach (KeyValuePair kvp in AllReusableAcls)
{
SPReusableAcl spRACL = kvp.Value;
SPBasePermissions spBase = _site.GetEffectiveRightsForAcl(spRACL);

System.Console.WriteLine(kvp.Key + ": " + spBase.ToString());
}
}
catch (Exception ex)
{
System.Console.WriteLine("Error: " + ex.Message);
}
}
}
catch (Exception ex)
{
System.Console.WriteLine("Error: " + ex.Message);
}



This confirmed my suspicion. There were 2383 keys in the ACL.

As the above mentioned blog propose, we had to reduce the number of keys in the ACL.

While reducing the number of keys in the ACL, as reported by the program, did not solve the problem, it could have compounded the problem.

Further investigation revealed a SharePoint user group with more than 6000 users. When a SharePoint user group exceeds 1000 users, then use an AD Group.