Unanswered Exception occurred sometimes when using Lists.GetListItmes

  • Monday, March 22, 2010 9:30 PM
     
     

    Hi,

    Sometimes when I use Lists.GetListItem method I get an exception :

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator.</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x80070093</errorcode></detail></soap:Fault></soap:Body></soap:Envelope>

    The query :

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>{8DCC3622-3C21-4420-AFA6-2122587089F7}</listName><query><Query xmlns=""><OrderBy><FieldRef Name="LinkFilename" Ascending="False" /></OrderBy></Query></query><viewFields><ViewFields xmlns=""></ViewFields></viewFields><rowLimit>0</rowLimit><queryOptions><QueryOptions xmlns=""><Folder>Marketing</Folder><ViewAttributes Scope="Default" /><DateInUtc>TRUE</DateInUtc><MeetingInstanceID>-1</MeetingInstanceID></QueryOptions></queryOptions></GetListItems></soap:Body></soap:Envelope>

    Any ideas ? It happened on Sharepoint 2010 and with the same query sometimes is fails and sometimes success.

    Thanks,

    Oreng.


    Oren

All Replies

  • Tuesday, March 23, 2010 2:09 AM
     
     

    Sounds like list throttling.  Does your list have more than 5000 items? If so then you will need to put a filter on your query or change the list throttle limit in Central administration.

    <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman";} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:737090851; mso-list-template-ids:1825325080;} @list l0:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} ol {margin-bottom:0in;} ul {margin-bottom:0in;} -->

    1. Click “Manage Web Applications”
    2. Select the web application
    3. In the ribbon, click “General Settings->Resource Throttling”
    4. Change the List View Threshold to “xxxx"

    Or you could set the query window to be larger:

    1. Select the “Enable a daily time window for large queries” checkbox
    2. Set the start time to “xx am”
    3. Set the duration to “x” hours
    4. Click “OK”

    Hope that helps!
    Chris


    Chris Givens CEO, Architecting Connected Systems Blog Twitter
  • Tuesday, March 23, 2010 7:35 AM
     
     

    Hi Chris,

    Thanks for your reply,

    Unfortunately this is not my case , my list only holds 10 records or so.

    Any idea ?

    Oreng.


    Oren
  • Tuesday, December 07, 2010 9:53 PM
     
     
    We ran into this List View Lookup Threshold in an indirect way testing a solution involving a complex list that contains many fields. The list includes some lookup fields, several user fields, and several taxonomy fields. We started to encounter a problem where method Microsoft.SharePoint.Taxonomy.TaxonomyField.TouchAllTaxonomyColumns was throwing  "The SPListItem being updated was not retrieved with all taxonomy fields."  exceptions trying to update list items from a form. We were confused at first because it did not fail for certain users but failed consistently for other users. Then we saw in the Log file that just before the TouchAllTaxonomyColumns threw the above exception, there was this message: Some lookup fields were omitted from the query results because the list exceeds the lookup column threshold. I cranked up the List View Lookup Threshold in the Web Application Resource Throttling settings (in Central Admin) from the default of 8 to 80, did an iisreset and the problem has stopped. We'll put that threshold at something more realistic when we test more, but that proves it's the resource throttling that causes an issue for code working at the Object Model level.
    M. Cox
  • Saturday, December 11, 2010 8:47 AM
     
     

    Basically, SharePoint has a settings for each web application that limits the no. of lookup columns a list can have. And as the error says, your list has exceed the limits and if you try to execute a query that has more lookup columns than the limit, u'll get the exception.

     

    You can modify the limit from Central administration and then web application's general settings. However, it's recommended to keep the lookup column minimum for performance.


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com