Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Please see the latest edit at the bottom.

I have multiple sites, within the same Sharepoint site, that each have documents within the Shared Documents section of the site. The majority of these sites work perfectly fine, people can view, download, edit, etc, all the files stored there.

There is one site, however, that does not give access to anything the majority of the time. When I try to go into the folders I am greeted with the error:

Index was out of range. Must be non-negative and less than the size of the collection

This particular site is not setup any differently to the rest and, strangely, it doesn't happen ALL the time, just the majority of the time.

Why would this be happening? What should I do to stop it?

EDIT: I can open the folders in Windows Explorer and see everything I need to see, it's just when trying to view them inside the Shared Documents library that the error occurs.

I have tried removing and re-adding all the documents to see if it made any difference, but it didn't. Still index out of range exception.

EDIT: Using the ULSViewer when replicating the error does not produce any error messages. When I click on other links it does produce entries in the log, just nothing when I replicate the problem.

EDIT: The stack trace looks like:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index] System.ThrowHelper.ThrowArgumentOutOfRangeException() +78
System.Collections.Generic.List`1.get_Item(Int32 index) +53
System.Web.UI.WebControls.MenuItemCollection.RemoveAt(Int32 index) +27 ASP.adeceef9_c3cf_4497_aaed_b0aa3202002d_489600446.Page_Load(Object sender, EventArgs e) +67
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42 System.Web.UI.Control.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Control.LoadRecursive() +191
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

EDIT: OK I have figured out that it is definitely a View problem. When I click into a file or folder in the document list, it returns the error from above. However if I remove, from the URL, the text &View=%7b8439DB47%2d3CED%2d470F%2d9ED5%2d8BA42A63B41C%7d it displays correctly. So, I don't know how to display this properly automatically. Obviously there is a change I need to make with regards to the Views but I don't know where to start?

share|improve this question
    
am afraid you might need to provide a bit more of informations for noobs like me ;) lol –  Muhammad Raja Apr 26 '12 at 15:17
    
I don't know what other info I can provide to be honest! That's half the reason as to why it is so confusing. There is nothing special about the page/library, it just seems to be random. –  anothershrubery Apr 26 '12 at 15:22
    
because this is a general error and can occur because of enormous reasons, so I wonder if anyone will be able to answer it without looking at any code or content of your site. –  Muhammad Raja Apr 26 '12 at 15:56
    
I understand that, but I don't believe it can possibly be anything to do with code or markup as there is no changes to the code or markup and other document libraries, within the main Sharepoint site, work as expected and they haven't been amended either. While I understand it is a generic error, I believe there must be things I can check without looking into code and markup. –  anothershrubery Apr 26 '12 at 16:08
    
do it again and upload the log file here. –  Esteban V Apr 30 '12 at 9:47

5 Answers 5

From your description it sounds as if it's when you show the default view of the DocLib that it breaks.

Do you know if anything has been changed here?

You might want to open the Site in SharePoint Designer go to the DocLib and add a new view and set it as default. And the try to open the doclib in the browser.

share|improve this answer
    
Tried that. Unfortunately, it is still showing the error. –  anothershrubery Apr 27 '12 at 8:08
    
Can you add any message in the ULS log for the request to the question? –  Per Jakobsen Apr 27 '12 at 9:31
    
I've even tried creating a new document library with all default settings and putting the files in there, but still receiving the same error. I don't know where to find the ULS log or what to look for in it...It even happens when I click on a folder which doesn't have any files in it. It seems to be on anything more than a level deep. –  anothershrubery Apr 27 '12 at 12:45
    
The ULS logs are in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS directory on the Server. The best way to view the is to run ULS Viewer while you reproduce the error. –  Per Jakobsen Apr 30 '12 at 10:36
    
I have commented in my question above about the ULS log entries but it says: Using the ULSViewer when replicating the error does not produce any error messages. When I click on other links it does produce entries in the log, just nothing when I replicate the problem. –  anothershrubery Apr 30 '12 at 11:53

You need to have uls log viewer and then we can help you further. Install this http://sharepointlogviewer.codeplex.com/

Then click on play and it will start streaming the log in realtime.

Then do the action that throws the error. Then on the logviewer click pause and find the correlation id that the page shows you.

paste the error here

share|improve this answer
1  
I have commented in my question above about the ULS log entries but it says: Using the ULSViewer when replicating the error does not produce any error messages. When I click on other links it does produce entries in the log, just nothing when I replicate the problem. –  anothershrubery Apr 30 '12 at 11:54
    
didnt you see anything as Unexepected in the log? thats pretty uncommon. –  Esteban V Apr 30 '12 at 13:12
1  
Absolutely nothing was entered into the log when clicking on the link that causes the error. Tried numerous times, but it does not log anything. –  anothershrubery Apr 30 '12 at 13:59

Although without having a exact look at the ULS trace , it will be a bit shot in the dark but from what you have explained and the problem that is occuring I think there is a very good chance that we can narrow down the scope of the issue to publishing page layouts and content types.

A number of similar issues with the same "Index Out of range" exception in SharePoint has always occured in the past due to corrupt page layouts and content types used by Document Libraries.

For the above scenario I would rather suggest you closely refer to the below solution:-

http://blogs.msdn.com/b/sridhara/archive/2011/09/06/not-able-to-create-publishing-pages.aspx

share|improve this answer

Do you know if the VIEW FORM has been customized by any chance for this library? You get this exception in the cases where someone inadvertently removed from the View the Original LISTVIEW which ID is used for the proper functioning of any list. In other words, even if a new view has been added, deleting the original ListView WP can cause this (sometimes even worse, forbid total access to items. If you do not have any special Metadata (or use custom Content Type) i would suggest you copy all the files (via Windows Explorer View, or use the Manage Content & Structure on Publishing Sites, or simply use Chris O'Brian tool on CodePlex http://spdeploymentwizard.codeplex.com/ and re-create the library.

Hope it helps, C:\Marius

share|improve this answer

Can you create another site and move all content from the misbehaving site to the new one (only a copy at first, just get all content from the library using explorer view first, then copy it into the new site). If that works, delete the old site and instruct users to use the new one. If it still doesn't work, check for file name length / weird characters etc. If someone added a file with a bad name (i.e. a # in it) using explorer view it might break sharepoint virtual path provider or something else sharepoint uses to build the menu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.