Skip to main content

From The Field

Go Search
From The Field
  

From The Field > Categories
Create Managed Properties - The Easy Way
OK, so I got to publish another script to the SharePoint Management PowerShell scripts project - this one is called Set-ManagedProperty. Does exactly what the name suggests - allows you to automate creation of managed properties in Search configuration and mapping them onto crawled properties.
 
You may find this especially useful if you are planning to install Podcasting Kit for SharePoint (or have to re-build it regularly). One of the most tedious steps in the installation and configuration of PKS has always been having to create over a dozen of managed properties - now all you have to do is download and run this script, as it even defaults to properties required by PKS if given no other input!
Crawler Impact Rules - What not to do
In a recent engagement I was asked to troubleshoot an indexing problem for a customer. Essentially the SharePoint indexer despite running on 64bit with 12GB ram and having real fast network links to the Database and remote File Shares was crawling very slowly.
 
So this first thing I did was take a look at these performance counters to assess the state of play:
 
 
Perf Counters
 
What was obvious from this was that the Documents Filtered rate was extremely low at an average of 2 per second. Moss Indexer at full throttle should be indexing considerably faster than this, 80 docs per second is not uncommon in well performing systems.
 
What was also apparent was that the Threads Accessing Network was a similar figure to the Filtering Threads total. This is indicative of threads waiting on response from the data source.
 
So where to go from here?
 
The thread count was so high in these counters that I wanted to see what 'tuning' had been applied to the Indexer. Two places to check.
 
  1. The SSP Search Settings on the Indexer for the Indexer Performance Setting.
  2. Any Crawler Impact Rules that may have been set

In this case the Indexer Performance Level was set to Maximum which is fine with a dedicated Indexing Server.

When Checking the Crawler Impact Rules though I discovered a whole world of problems.

Crawler Impact Rules

What I found here was over twenty crawler impact rules had been configured for the search service but each one had been setup to use the maximum number of requests for the crawl - Sixty Four.
 
Best Practice and Technet provide guidance for crawler impact rules as follows.
 
For crawling internal content in your organization, you can set crawler impact rules based on the performance and capacity of the crawled servers. For example, you might try to avoid crawling internal servers at peak load times. However, for crawling external sites, this kind of coordination is usually not feasible. Therefore, it is best to configure crawl requests to minimize consumption of external site resources and bandwidth so that external site administrators are less inclined to restrict your future access.
During initial deployment, set your crawler impact rules to minimize impact on crawled servers while crawling them frequently enough to ensure relatively fresh results. Later, during the operations phase, you can adjust crawler impact rules based on your experience and the data from your crawl logs.
With many impact rules and all set to sixty four the target servers were simply overwhelmed with requests resulting in a major bottleneck in the search service and reduced performance as we have seen.
 
Testing the search service by reducing the crawler impact rule maximum requests to the default of eight resulted in immediate improvements in the document filtered rate to around thirty documents per second and the threads accessing the network : total filtering threads ratio improved enormously.
 
This was by no means the end of the story and the next task involved a lot of trial and error to determine the optimum configuration for the impact rules (or deleting them entirely).
 
The moral of this tale though is to get the message out about what Crawler Impact Rules are all about. They are not there to squeeze more output from the search engine, they are there to reduce the impact the crawler has on the sources being crawled. There is almost never a reason to increase this number beyond the default and in many cases, such as this one, reducing the number actually improves performance.
Search Settings generating multiple errors!

I was helping a customer recently investigate an issue that was causing the Search Settings page (searchsspsettings.aspx) within the SSP Administration site to generate an error.

No connection could be made because the target machine actively refused it

This issue is generally caused because of communication issues between the WFE hosting the SSP Admin site and the Index server (in this case they were seperate servers). After doing some investigation we found that this error was caused because the World Wide Web Publishing service was stopped on the index server, once this was started the issue was resolved….well sort of!

We were now faced with a different error:

Exception from HRESULT: 0x80040D1B

The next step was to follow the steps in the KB article to re-sync the service accounts on each server - How to change service accounts and service account passwords in SharePoint Server 2007 and in Windows SharePoint Services 3.0 http://support.microsoft.com/kb/934838

This then presented us with another error…..when will they stop!

403 Unauthorized

We then discovered the Scheduled Tasks directory - %windir%\Tasks had, had its default permissions amended due to a recent virus outbreak, basically this directory had been marked as read only. MOSS 2007 requires write access to this so we then followed the instructions in the following KB article to configure the correct permissions - Error when you try to edit the content source schedule in Microsoft Office SharePoint Server 2007: "Access is denied" http://support.microsoft.com/kb/926959

After all of this we finally managed to get access to the Search Settings page!

Troubleshooting Index Server Moves
I recently helped a customer through some problems with an index server move.  They have 3 MOSS servers (in this example; server 1, 2 and 3).  Server 1 and 2 are front ends and and server 3 is an application server.  Server 1 had the index and query roles.  The wanted to move the index role to server 3 and have a second query role on server 2.
 
They had been able to move the index role and run a crawl, but that new index would not propagate to either of the query servers.  I wrote them an action plan that got them to where they wanted to be.  It might help if you are in a similar situation.
 
Deactivate Alerts
1. Go to SSP admin > Search settings
2. Search based alerts
3. Deactivate
4. Check the Search alerts status is inactive on the status page.
 
Stop the search services on server 1
1. From Central Administration > Services on Server
2. Change the context to server 1
3. Stop the Office SharePoint Server Search
4. Repeat this on server 2 and server 3 - just in case they are running
 
Delete old Indexes from all servers
1. Just to be tidy: on all servers - go to C:\Program Files\Microsoft Office Servers\12.0\Data\Office Server\Applications
2. Remove index folders (folders named with a GUID) – leave the Applications folder where it is.
 
Add the Index Role to server server 3
1. From Central Administration > Operations > Services on Server
2. Change the context to server 3
3. From Office SharePoint Server Search click Start
4. Check the box for indexing on this server
5. Use the default index location (will probably be greyed out anyway)
5. Fill in the service account details and start the service.
6. After a few minutes check the index location exists on the file system
 
Change the index location
1. Go to server 3 console
2. stsadm -o editssp -title YourSharedServicesName -indexserver server 3servername -indexlocation filePathtoIndex
3. After a moment check the new location exists
 
Change the SSP
1. Go to Central Admin > Application Management > Create or configure this farm's shared services
2. Edit properties of SSP (SharedServices1 for example)
3. Go to the index server section and choose server 3 as the new indexer.
 
Add query role to server 1
1. From Central Administration > Operations > Services on Server
2. Change the context to server 1
3. From Office SharePoint Server Search click Start
4. Start the search service – check the box for querying on this server
5. Fill in the service account details
 
List search info
1. stsadm -o osearch -action list
2. You should see:
a.  server 3 and server 1 and their roles - check that they are ok at this point
b. Some farm contact info and service account - check these are correct
 
Just to be sure – set the propagation location
1. On server 1
2. stsadm -o osearch -propagationlocation filePathtoPropagationShare (same as index but on the query server)
3. After a little while you should see the folder shared on the query server file system.
 
Run a full crawl
1. From SSP admin > Search settings
2. Select content source and run full crawl
3. Monitor until Idle
 
Check Propagation to server 1
1. Once the crawl has finished
2. From SSP admin > Search settings
3. Wait for a while and monitor propagation status -
a. Idle - Is good - carry on to Add query role to server 2
b. Propagation Not required - not so good - check the query service is running server 1.  Check the SSP is using server 3 as the index server.
c. Propagating to New Query server - might need attention if it stays like that for too long - give it 5 minutes.  Check the application event log for 6398 and 6482.
 
If propagation doesn't work we are into troubleshooting mode.  Things to check:
a. The index location exists on the server 1
b. Its shared as searchindexpropagation
c. The share permissions include the WSS_WPG_ADMIN group and it has full control
d. The WSS_WPG_ADMIN group has full control on the Security tab as well
e. Events on server 3 – like can’t propagate, no access to share, shared doesn’t exist etc. Also 6398, 6482
If Propagation seems to work OK – got to a web app and run a search query
 
Add query role to server 2
1. If we see propagation working ok from server 3 to server 1 we start search on server 2
2. From Central Administration > Services on Server
3. Change the context to server 2
4. Start the search service – check the box for querying on this server
5. Fill in the service account details
 
Just to be sure – set the propagation location
1. On server 2
2. stsadm -o osearch -propagationlocation filePathtoPropagationShare (same as index but on the query server)
3. After a little while you should see the folder shared on the query server file system.
 
Check Propagation to server 2
1. From SSP admin
2. Search settings
3. Monitor propagation status -
a. Idle - Is good
b. Propagation Not required - not so good
c. Propagating to New Query server - might need attention if it stays like that for too long - give it 5 minutes.
 
Activate Alerts
When everything is working as expected
1. Go to SSP admin > Search settings
2. Search based alerts
3. Activate
4. Check the Search alerts status is active on the status page.
Search Administration link missing

I recently ran into an issue with a customer who had built a new MOSS 2007 farm using SP1 slipstreamed media and the December cumulative hotfix package, this package includes the enhanced search functionality that is found in Search Server 2008 - http://www.microsoft.com/enterprisesearch/serverproducts/searchserver/default.aspx such as search federation and an improved management interface. This functionality was originally introduced to MOSS 2007 with the infrastructure update. As the December hotfix package is fully cumulative it also includes the infrastructure update - http://blogs.msdn.com/sharepoint/archive/2008/12/17/announcing-december-cumulative-update-for-office-sharepoint-server-2007-and-windows-sharepoint-services-3-0.aspx

The problem that they experienced related to the Search Administration page that is added with the December hotfix package, the link to this within the SSP Administration site was missing also when they attempted to navigate to the Search Administration page using the link to this that is stored within the Search Settings page this generated a 404 error.

In the screenshot below you can see how this should appear:

After much investigation it was found that this was problem was caused because the feature that adds this page had not been installed and activated, this was easily fixed by running the following command:

stsadm.exe -o installfeature -name S2SearchAdmin -force

stsadm.exe -o activatefeature -name S2SearchAdmin -url http://SSP URL/ssp/admin  -force

Index Server recovery without Index Reset

In a recent conversation with one of our top SharePoint support engineers Victor Butuza we chatted about how to recover a corrupt indexer by using the indexes from one of the farm query servers.

 

I can't claim to be the first to blog this as Victor has done so himself here, but I wanted to make sure we added this material to the from the field blog for archival purposes if nothing else.

 

As a final update the actual bug that can cause this issue is now resolved in the October Cumulative Update and can be reviewed here

 

Also I should add that using this approach could render you in a temporarily unsupported state for a couple of reasons.

  • The index files on the query server cannot be 100% guaranteed to be in sync with the search database
  • The index files on the query server are optimised for read access whereas the files on the index server are optimised for write. This could lead to performance issues with indexing.

So anyway here goes with this interesting approach to get indexing back online without a full index reset.

 

When the Microsoft Office SharePoint Server 2007 index server experiences power failure or restarts unexpectedly, the index is corrupted

 

Cause: The index corruption may occur during the unexpected shutdown (most likely a power failure or an application patch and a reboot) of the server while crawling.
The shutdown catches a newly created shadow index incompletely flushed on the disk resulting in index corruption on restart.

 

Resolution: The recommendation for recovery from the index corruption on the indexer is a reset of the indexed content which means restarting indexing from scratch with loss of query capabilities while the index is rebuilt.

 

There now follows a description of an alternate method to recover the index but this is not guaranteed to be successful in all cases. If it doesn't recover the index then you must follow the recommended guidance above.

 

Alternative Recovery Option:

 

If the propagation is Idle and the error is present only on the index server and the error is only in catalog AnchorProject (Portal_Content), the following manual recovery procedure can succeed, without losing the indexed content (if not, a rebuild of the index is mandatory):

 

  • Disable and stop osearch service on the indexer
  • Check if the propagation is idle and a master merge of the indexes on the query server has occured:

Open SQL Management Console and the SSP Search Database:

  • The following 2 tables must be empty

MSSPropagationPropagationTask,

MSSPropagationSearchServerReady

The table MSSPropagationSearchServerTable must have the MachineStatus column set to 3 for the query server which you pick to be used for the recovery (from which you will retrieve the index files).

  • Copy the Portal_Content catalog (<index_location>\<applicationGUID>\Projects\Portal_Content\Indexer\CiFiles\*.*) from the query server to the indexer.
  • Enable and restart osearch service on the indexer

If this procedure fails rebuild the index completely :

Stop and restart the search service on all servers (this will delete the index completely)

 

If this procedure works determine the most appropriate time to rebuild the index so to avoid the supportability issues mentioned above.

 

Neil Hodgkinson

 

 

Search settings - Authentication failed because the remote party has closed the transport stream

I recently run into a peculiar problem with MOSS 2007 search, to give you some background to the issue that I had a new farm had been provisioned running MOSS 2007 SP1, it contained two servers:

·         Server1 - Web Front End / Query

·         Server2 - Index

I started hitting problem when attempting to configure search using Search Settings within the SSP administration site, it generated the following error:

Authentication failed because the remote party has closed the transport stream

After much investigation including reviewing the Application and ULS logs I found the cause of the issue being the fact that Server1 could not connect to the search web service on Server2 using the following URL https://server2:56738/SharedServices1/Search/SearchAdmin.asmx

To rule out an issue with a firewall or intermediary networking device I ran the following command using cmd.exe from server1 to test connectivity to server2

telnet server2 56738

This connected successfully, which meant that the issue was likely to be caused by the SSL certificate that is created during installation/configuration and is used by the Office Server Web Services site.

To resolve the issue, I used the IIS 6.0 resource kit tool SelfSSL to re-create the SSL certificate used for the Office Server Web Services site on both servers. This tool is available from http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&displaylang=en.

I ran the following command on both servers to do this:

Selfssl /s:(IIS ID of the Office Server Web Services site) /v:(length of validity for the certificate in days – I opted for 1000)

This then replaced the existing certificate with the newly created SelfSSL certificate and Search Settings now worked.

My investigation into the root cause of this continues….I’ll keep you all posted!

UPDATE 08/01/09 - This issue can potentially be caused when MOSS 2007 is installed on a server running .NET 3.5 SP1. This can be worked around by applying SP1 for .NET 3.5 after MOSS 2007 has been installed a KB article is now live at http://support.microsoft.com/?id=962928

Brendan Griffin

Advanced Search - Where has Contains and Does not Contain gone?
If you are a keen user of the Advanced Search page in MOSS 2007 you may have noticed that the option to perform a search using the Property Restrictions: Contains and Does not Contain has magically disappeared.
 
These options were removed from the default Advanced Search page with hotfix 950280 (and all other cumulative MOSS 2007 updates released since) due to potential performance issues http://support.microsoft.com/?kbid=950437 - Expensive Transact-SQL queries are generated in the back-end instance of SQL Server when you perform a search in SharePoint Server 2007.
 
The following Blog post outlines how these options can be re-added - http://blogs.msdn.com/mmcintyr/archive/2008/09/29/hotfix-for-advanced-search-issue-in-moss-950437.aspx
 
Brendan Griffin
 
Faceted Search

Premier Field Engineering legend Neil Hodgkinson (the SharePoint team lead engineer in the UK) has just posted on the SharePoint Product Group blog no less!

Read Lawrence Liu's intro to his post:

"This first of two guest blog entries, written by Neil Hodgkinson, a Microsoft Premier Field Engineer based in the UK, will cover the "why we did it" aspect of the open source faceted search solution for MOSS 2007 and MSS 2008 that has been released on CodePlex at http://www.codeplex.com/facetedsearch. The second guest blog entry, scheduled to be posted within a couple of weeks, will be written by Leonid Lyublinski, a Microsoft Consultant based in Ohio, USA, and will cover the "how we did it" aspect of the solution."

Read Neil's post:

http://blogs.msdn.com/sharepoint/archive/2008/01/30/open-source-faceted-search-for-moss-2007-and-microsoft-search-server-2008-part-1-of-2.aspx

Nice one Hodge!

Using a dedicated Web Front End for crawling
One thing to watch out for when using Search with a dedicated web front end for crawling and running MOSS 2007 in least priveleged mode as per the following documents.

Plan for administrative and service accounts (Windows SharePoint Services)
URL: http://technet2.microsoft.com/WindowsServer/WSS/en/library/89e4c579-5720-45e0-917e-abeb95266c3e1033.mspx

 
Configure a dedicated front-end Web server for crawling (Office SharePoint Server 2007 for Search)
URL: http://technet2.microsoft.com/Office/en-us/library/1ac6211c-8708-4fbd-a1b8-12e30a8a7ffd1033.mspx
 

Grant the following permissions for the server farm account on the C:\WINDOWS\system32\drivers\etc\HOSTS directory:

 

·         Traverse Folder / Execute File

·         List Folder / Read Data

·         Read Attributes

·         Read Extended Attributes

·         Create Files / Write Data

·         Read Permissions

 

An entry in the hosts file is required to ensure that the Index server connects to the dedicated web front end and doesn't connect to any other WFE's within the farm.
1 - 10 Next

 Error

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.

Error Details:
[UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.]
  at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Guid guid)
  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)