Monthly Archives: May 2009

Reset Crawled Content in MOSS 2007

In MOSS 2007 each Shared Services Provider has a single content index. Meaning that all content stored across the various content sources is referenced from a single index. This improves administration functions when you work with multiple content sources. When you make major changes to content sources and search settings or if you notice a large number of errors in search event logs, you may be required to reset the content index for your SharePoint environment. After this has been completed you need to manually initiate a Full Crawl of various content sources to repopulate the content index. If you do not rebuild the content index, search will be unable to work because the index will be empty.

How to reset all crawled content:

  • Go to your Shared Services Administration site of your SharePoint environment and select Search Settings.
  • Then select Reset All Crawled Content.
  • Leave the checkbox to deactivate all search alerts during the reset (see below image). This will avoid any unnecessary alerts being sent to users of the system during this update.

Reset Crawled Content


  • Once completed be sure to perform a Full Crawl to repopulate the content.

Posted by on May 27, 2009 in SharePoint Tips


Resource Cannot Be Found or File Not Found Error in MOSS

When attempting to navigate to our SharePoint portal we received the infamous “File Not Found” error. (See image below)


File not found

We tested our database connection by creating an ODBC connection and it was successful. Not only were the portals down but Central Administration was as well. So we made the following changes:

Follow these steps:

1.       Navigate to C:\inetpub\wwroot\wss\Virtual Directories\
<your web application’s virtual directory>

a.       You can also open IIS

b.      Expand Sites

c.       Right click on your sharepoint site

d.      Choose explore

e.      Then proceed to step 2

2.       Copy and paste the web.config file (making a backup)

3.       Open web.config using notepad.

4.       Search for “CallStack” , set this equal to true.

5.       Search for “Custom”, set the customerrors = “Off”.

6.       Save the web.config file and refresh your page in the browser.

After we made these changes we started receiving the message below:

Server Error

I then right-clicked on the page and selected “View Source” and saw the information highlighted below:


[FileNotFoundException]: The file /_catalogs/masterpage/_controltemplates/Welcome.ascx does not exist.
   at Microsoft.SharePoint.ApplicationRuntime.SPRequestModuleData.GetWebPartPageData(HttpContext context, String path, Boolean throwIfFileNotFound)
   at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)
   at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData)
   at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetDirectDependencies(HttpContext context, SPRequestModuleData requestData)
After looking in that directory the file was not missing. I decided to look at it using SharePoint Designer. What I saw using Designer was the following image:

Designer Error

I finally found this information:

Most likely the tilde sign “~” has dissapeared in your references on the masterpage after editing it in the sharepoint designer.

In the beginning of the masterpage you have register statements that should look like this

Code Snippet

<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>
<%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”~/_controltemplates/DesignModeConsole.ascx” %>

After reviewing the file in Notepad I realized the ~ symbols were in fact missing but after inputting them I received another error but at least it told me it was a problem with the default.master page. I copied over the default.master from the backup the night before and it worked like a charm. Not sure what changed the page but just another reminder to always have a backup copy!! I realize this is not an exact fix but when production is down and you know what the problem is, why wait to fix it?

Ok so after diving a little deeper into this after the fact it seems there is a glitch in SharePoint Designer where when you open certain pages, including default.master, it adds/removes code. We opened the same file this morning and saved it after making minor changes and it was corrupted again but when you open the same file in Notepad and make the needed changes and save it, it works fine. I am sending this to Microsoft Support to get their opinion on it. Just a note of caution to those of you who use SP Designer to make a backup copy before opening it period.

Microsoft’s Response:

SharePoint Designer actually breaks the master page when it opens because you are essentially un-ghosting the site.  The recommended way to customize this page is to make a copy of it, and edit the copy.  Then you would designate the custom master page to be the default master page for your site.  The reason it breaks is because SPD changes the path of two URLs within the master page.  To be specific, line 5 and 6 of the file look like this before you open it:

<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %> <%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”~/_controltemplates/DesignModeConsole.ascx” %>

After opening it, you see this:

<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”_controltemplates/Welcome.ascx” %> <%@ Register TagPrefix=”wssuc” TagName=”DesignModeConsole” src=”_controltemplates/DesignModeConsole.ascx” %>

Notice the ~/ are missing from in front of src=”_controltemplates.

This is why when you try to look at the page in design view, you see all those errors, if you add the /~ back, the design view will no longer show all those errors and the page will render correctly. 

Also, another reason it is not recommended to edit the default master page is because you run the risk of a HotFix, Cumulative Update, or Service Pack overwriting it and potentially causing loss of functionality while you are fixing it or losing all your hard work if it was not backed up since you made changes to it. Please let me know if you have any questions.

  • This to me is a cop out answer for a Microsoft product they released specifically to edit SharePoint.

Posted by on May 21, 2009 in SharePoint Common Issues


How to Start/Schedule a Crawl in MOSS 2007

If you don’t see your item in search result in MOSS 2007, most likely means your item(s) have not been crawled. How can we do this manually or set a schedule for this?

  1. Open MOSS 2007 Central Administration > Application Management > Create or configure this farm’s shared services in “Office SharePoint Server Shared Services” group.
  2. Open your web applications Shared Services page
  3. Click on “search settings” in search group.
  4. Click on “Content sources and crawl schedules” and open context menu of your content source.
  5. In context menu you will get these options (see image below):
  • Edit
  • View Crawl Log
  • Start Full Crawl
  • Start Incremental Crawl
  • Resume Crawl
  • Pause Crawl
  • Stop Crawl
  • Delete

Content Sources

You can start crawling manually here but what is recommended is to set a schedule. To do this click on “Edit” and you will get two “Crawl Schedules” options. One is the Full Crawl option and the other is the Incremental Crawl option. Click on the link you want to create a schedule and give you schedule types, time and repeat times (if this applies). It is best practice to set Incrementals throughout the week and a Full on the weekend or evening considering the time it takes to complete. You can always run a crawl manually to have information appear immediately when necessary.

Click OK


Posted by on May 20, 2009 in SharePoint Common Issues


Crawl Log Errors/Warnings

We were receiving this error message in our crawl log for our top level site:

https://top level url

The item could not be accessed on the remote server because its address has an invalid syntax.

I had never seen this before in our logs so I actually tracked down the file that was specified in the top level url and navigated to it. When I found the specified document and clicked on it, it came up with the message below:

Crawl Log Error

I wanted a backup copy so I clicked on the drop down arrow to the right of the document and highlighted Send To and downloaded a copy (see image below) just in case. Then I deleted the document(s).

Download a Copy

Once I removed the document(s), I ran a full crawl and the error did not reappear. What I found out was that we had actually exceeded the 256 character path limitation. This file was about 8 folders deep in a subsite so it was 1 character too long. Here is my suggestion on working around this and also a list of MOSS limitations. I hope this helps!

 This is a limitation of .NET (C#, VB, etc), the language that SharePoint was built on.  

When programming in .Net there are ways around this using Win API calls, but I am inclined to believe that MS did not use any WIN API calls, but rather used the native .Net file handlers

I’ve found a way around this by creating another network place on the server that points to the folder that is buried a lot further down.

For example:
\\server\path1\longpath2\longpath3\longpath4\reallylongname.txt   (assume this is 300 characters)


Short of that, there is not much you can do.

Another suggestion as far as some of the limitations…inform the client not to use spaces in file or folder names. If they need a space, they should use a dash or an underscore since html for a space is %20. This takes up three characters in the URL versus one for a – or an _. Those extra spaces add up fast.

SharePoint 2007 Maximum Limitations

Following is a list of names and other parameters with the maximum allowable size on each.

Entity                        Max Permissible Size
Site Name                    128 characters
Site URL                 255 characters
Display name                 128 characters
Connection string                 384 characters
Email address                    128 characters
Version numbers                064 characters
Virtual Server Friendly Name            064 characters
SQL Database Name                123 characters
SQL Database Column                128 characters
SQL Database Table Name            128 characters
SQL Role Name                    128 characters
Server Name                    128 characters
Windows User Name                300 characters
Windows Password                300 characters
Dependencies per object            032 objects
Zone enumeration value            004 zones
Default SQL command timeout             300 seconds
Number of simultaneous
workflows that can be run*             015

If during your course of using the product, you inadvertently cross these limits, then you would end up with errors. These are hard limits.

Leave a comment

Posted by on May 20, 2009 in SharePoint Common Issues


Submit your SharePoint Issues

Please submit any questions you have here and I will do my best to assist or at least point you in the right direction. It is difficult to get good SharePoint help that doesn’t cost anything so let me know what I can do to help.


Posted by on May 19, 2009 in Your SharePoint Issues


Extract documents from a SharePoint database

We had a situation come up where we had taken down a SharePoint server and of course all of the users said they had everything they needed from it until 3 weeks later when several documents were found “conveniently missing”. All we had left were the databases from the installation and I found a really good script to extract documents from your database.

General Warning

This script goes directly against a MOSS 2007 content database which is generally discouraged. Any code using the database directly will not be supported by MS Product Support Services. Instead, the SharePoint and WSS APIs are the way to go. If the database is modified directly rather than through the published SharePoint and WSS APIs Product Support Services cannot properly troubleshoot any unexpected issues. This script reads from the database so we’re safe from errant modifications. However, the data structure the script queries could change in a future service pack.

Here is the script we used and you can copy and paste this into Notepad and save it as ex “extractdoc.vbs”.

Dim contentDatabase
Dim leaf
Dim outputPath
server = “server name
contentDatabase = “database name
leaf = “filename
outputPath = “C:\Temp\filename

ExtractDoc server, contentDatabase, leaf, outputPath

Sub ExtractDoc(server, contentDatabase, leaf, outputPath)

  Dim conStr, selectStr

  conStr = “Provider=SQLOLEDB;data Source=” + server + “;Initial Catalog=” + contentDatabase + “;Trusted_Connection=yes”

  selectStr = “SELECT dbo.AllDocStreams.Content FROM dbo.AllDocs ”
  selectStr = selectStr + “INNER JOIN dbo.AllDocStreams ”
  selectStr = selectStr + ”  ON dbo.AllDocs.ID= dbo.AllDocStreams.ID ”
  selectStr = selectStr + ” AND dbo.AllDocs.Level = dbo.AllDocStreams.Level ”
  selectStr = selectStr + ” where LeafName='” + leaf +”‘ AND IsCurrentVersion=1″

  Set cn = CreateObject(“ADODB.Connection”)
  Set rs = CreateObject(“ADODB.Recordset”)
  cn.Open conStr
  Set rs = cn.Execute(selectStr)
  Set mstream = CreateObject(“ADODB.Stream”)
  mstream.Type = 1
  mstream.Write rs.Fields(“Content”).Value
  mstream.SaveToFile outputPath, 2
End Sub

This took some research to find but it worked like a charm. Simply replace the server name, database name and filename fields with the appropriate values and you’re good to go. The filenames unfortunately have to be exact or it will not find it. Also, be sure to include the extension with the filename.

Hope this helps!


Posted by on May 12, 2009 in SharePoint Tips


SharePoint won’t uninstall

So you need to uninstall SharePoint and you go to the Control Panel and Add/Remove Programs and select “Remove”. It goes through telling you that certain services will have to be restarted etc etc and it seems to start the uninstall process with the progress bar but then it the screen just blinks and your back at the Add/Remove Programs box with SharePoint still there. This is usually a pretty simple issue but there have been two instances when this has happened to me.

One instance is where you still have databases that are connected to the SharePoint instance you’re attempting to uninstall. You need to remove the databases or at least detach or take offline the ones that are there. If not, SharePoint still sees it as an existing connection and could stop the uninstall from happening. However, this is not always the case.

Another instance is simply if your Application Log in the Event Viewer is full. It seems silly but if you’ve ever had your server hang for no apparent reason then it’s an easy fix but not something  you think of right off the bat. As soon as I set the Application Log to overwrite as needed it uninstalled successfully.

Leave a comment

Posted by on May 12, 2009 in SharePoint Common Issues