Crawl fails with an error The SharePoint item being crawled returned an error when requesting data from the web service. ( Error from SharePoint site: Data is Null. This method or property cannot be called on Null values. )

Article translations Article translations
Close Close
Article ID: 2323206 - View products that this article applies to.
Expand all | Collapse all

Problem description

What caused the problem?

If the Sharepoint Object model is used to add a new group to the GroupCollection of a site and the value passed to Description parameter of the SPGroup is null then this issue will occur.

Sample Code which can cause the problem

-----------------------------------------------------

   using (SPSite oSite = new SPSite(textBox1.Text))
                {
                    using (SPWeb oWeb = oSite.OpenWeb())
                    {
                        SPGroupCollection oGroupColl = oWeb.SiteGroups;
                        SPUser oUser = oWeb.AllUsers["domain\\user"];
                        oGroupColl.Add("Testing Group", oUser, oUser, null);

                    }
                }

 

How do I fix the problem

Use the Object model to get all the SPGroup whose Description property is set to null and update the value with a string value.

Sample code which will fix the issue

-------------------------------------------

 using (SPSite oSite = new SPSite(textBox1.Text))
                {
                    using (SPWeb oWeb = oSite.OpenWeb())
                    {
                        SPGroupCollection oGroupColl = oWeb.Groups;
                        foreach (SPGroup oGroup in oGroupColl)
                        {
                            if (oGroup.Description == null)
                            {
                                oGroup.Description = "String";
                                oGroup.Update();
                            }
                        }
                    }
                }

How do I know the problem was fixed?

If we rerun the crawl again the issue would be resolved.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2323206 - Last Review: August 23, 2010 - Revision: 2.0
APPLIES TO
  • Microsoft SharePoint Server 2010
Keywords: 
KB2323206

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com