Thursday, October 30, 2008

InfoPath Forms Services best practices

This comes from: http://technet.microsoft.com/en-us/library/cc261832.aspx

Updated: 2006-12-01

We recommend that you follow these best practices when managing your InfoPath Forms Services environment.

Document limit of 2,000 in Windows SharePoint Services document libraries

If a form template will be filled out and submitted more than 2,000 times in total, you should either write code in the form template to submit to a database by using a Web service, or create a custom submit function that places forms into multiple libraries. This is due to a limitation in the capacity of Windows SharePoint Services 3.0 document libraries, which may experience performance degradation if more than 2,000 documents exist in the library.

If you think a form template may be submitted more than 2,000 times, it is easier to begin by programming the form to use an alternative submit method than to correct this issue once it becomes a problem, particularly if the form template is available to a publicly accessible Web site.

Use Form View when configuring session state for InfoPath Forms Services

You can configure InfoPath Forms Services to use the Session State Service (the default option) or Form View to control how user sessions are managed. When you configure InfoPath Forms Services to use the Session State Service, all browser sessions are maintained on the SQL Server database corresponding with the Shared Services Provider (SSP) associated with the Web application on which the form template is hosted. This scenario uses little network bandwidth, but has a cumulative performance impact on the computer running SQL Server. When you are using Form View, sessions are maintained on the client browser, and all session data is included in each postback to the server, up to 40 kilobytes of session data. This uses more bandwidth than using session state, but does not affect the computer running SQL Server. Once session data reaches 40 KB in size, the session automatically transitions to session-state management.

We recommend the use of Form View in environments that have smaller groups of users, because it reduces the impact on SQL Server. If your InfoPath Forms Services deployment will have many users, particularly if session data is below 40 KB for many high-usage form templates, session state is likely a better choice. If Form View is used, the bandwidth used by browser sessions of 40 KB or fewer can be monitored if there is a concern that network performance might be adversely affected.

Running SQL Server on a front-end Web server is not recommended

If you run SQL Server on an Office SharePoint Server front-end Web server (for example, in a single-server evaluation deployment), the ASP.NET cache will release system memory at a lower threshold than SQL Server, which could result in InfoPath Forms Services memory starvation.

ASP.NET employs a strategy of targeting maximum Internet Information Services (IIS) memory use of the lesser of either 800 megabytes or 60% of available physical RAM. These settings are configurable in IIS manager. ASP.NET also monitors physical RAM use, not just for the w3wp.exe process, but for the entire system. When 80% of the physical memory on the server is committed, ASP.NET begins periodically dropping the oldest and lowest priority 5% of the cache. When 85% of physical memory is committed, ASP.NET drops 50% of the cache periodically. At 90% or more, ASP.NET aggressively trims the cache and sets a low limit on the maximum number of entries, which remains in effect until ASP.NET reassesses memory pressure on the server and raises the threshold.

The memory usage threshold for SQL Server is higher by default than the ASP.NET cache. In this scenario, SQL Server never releases memory, because the ASP.NET cache will already have released memory before the SQL Server threshold is reached. This situation can lead to a condition in which the throughput of InfoPath Forms Services is reduced with a subsequent impact on performance.

To mitigate this issue, you should configure SQL Server memory limits manually when SQL Server is installed on the same computer as Office SharePoint Server. For more information on adjusting SQL Server memory settings, see the article Server Memory Options (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_config_9zfy.asp) on the Microsoft Web site.

Best practices for anonymously accessible forms

When you deploy a form to a location where it is exposed to anonymous users, such as a public SharePoint document library or an embedded form in a Web page on the Internet, ensure the integrity of your form. There are several additional steps you should take to mitigate the risk of improper form usage, Denial of Service (DoS) exploits, and potential performance issues.

  • Ensure that form templates cannot be accessed by scripts or other automated processes. One way to achieve this is to force users who are submitting a form template to enter an identification code such as a short alphanumeric string displayed in an image, which cannot be "read" by a script or automated process.

  • Form templates that contain sensitive information such as authentication information, server or database names, or proprietary code should never be exposed to anonymous users.

  • Form templates that contain an e-mail submit data connection should not be deployed to servers that are anonymously accessible, as e-mail messages generated when the form is submitted will show "sent by anonymous user" in the Subject line.

  • Form templates that contain code or functionality that can invoke processes on a server should be carefully evaluated and tested to ensure that security cannot be compromised by making the form template accessible to anonymous users.

  • In order to prevent users from submitting multiple copies of a form, you might consider including code that tracks the IP address of each user who submits a form and prevents duplicate submissions from the same IP address.

  • Protect the integrity of form templates by enabling protection to prevent the form template from being changed.

Thursday, October 23, 2008

MOSS Page Setting Error - Value does not fall within the expected range

Thanks to these guys for the solution

I found an error when trying to change the Page Settings of a default.aspx in one of my sites today.

I wanted to update the page layout template in use but on selecting Page Settings from either the Page drop down in edit mode or from the Site Content & Structure page i received the follwoing error:

Value does not fall within the expected range
  1. Open the site in SharePoint Designer
  2. Select File / Export and choose the page you are trying to update
  3. Open the page locally using Notepad
  4. Search the source for “mso:PublishingPageLayout"
  5. Look at the path :

    http://mossdev/_catalogs/masterpage/customLayout.aspx, Custom Reports Layout

  6. The string points to my old development environment http://mossdev
  7. Update the path to the live environment eg: http://mosslive
  8. Save the file
  9. In SharePoint Designer select File / Import and choose the modified file
  10. Check the files back in and approve them.
Problem solved - i can now update the page settings with no error.

Thursday, October 09, 2008

SSP Stuck on Unprovisioning

I tried to delete a test SSP the other day via Central Administration. Having selected the options to also delete associated content databases and web applications i hit ok and left it to run. The SSP status changed to 'Unprovisioning' and an hour later was still stuck.

I then followed this example in the hope the SSP would delete.
  • http://prequest01.wordpress.com/2008/08/16/unable-to-delete-shared-services/

    1. Tried: stsadm -o deletessp "TestSSP" –force, but this did not work
    2. Login to SQL server.
    3. Open SQL Management Studio and expend Databases.
    4. Expand Configuration Database & Tables.
    5. Opened table for dbo.object.
    6. Executed following query in query analyzer: SELECT * FROM [MOSS_CFG_CA_01].[dbo].[Objects]where name like ‘Name of the Shared Services’.
    7. Copy the ID of object referenced in objects table of configuration database.
    8. Open command prompt and changed directory to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> and executed following command to delete the Shared Services using the ID which was copied: Stsadm -o deleteconfigurationobject -id “id retrieved from object table”
  • To clean up we decide to delete the DBs via SQL Management Studio and delete the web applications via Central Administration.
A week later I discovered that one of our servers had rebooted itself with the following log (don't yet know if this is related):

System Failure: Stop error
Reason Code: 0x805000f
Bug ID:
Bugcheck String: 0x000000c5 (0x00000004, 0xd0000002, 0x00000001, 0x8089bce3)
Comment: 0x000000c5 (0x00000004, 0xd0000002, 0x00000001, 0x8089bce3)


I then discovered that the search was no longer working. Submiting a query returned the following error:

Cannot connect to the search service

The status of the test SSP i had tried to delete was still stuck on 'Unprovisioning'. Also the other SSPs 'Edit Properties' pages in Central Administration were no longer available and returned the following error:

An unhandled exception occurred in the user interface.Exception Information: Cannot open database "xxx" requested by the login. The login failed. Login failed for user 'xxx'.

In the event log on the server I found multiple instances of the following error:

Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (e6a1ecb4-3aa8-45cd-a179-d7e053aa927a).

Reason: Cannot open database "xxx" requested by the login. The login failed.
Login failed for user 'xxx'.


Solution:
  1. Restart the Office SharePoint Server Search service in via the Computer Management console - Search still not working.
  2. I retried the STSADM CMD
    stsadm -o deletessp "TestSSP" –force
Operation was successful this time and the SSP has now gone. The event log is now clear of all errors and the unavailable pages in Central Administration are now available again.

Monday, September 29, 2008

MOSS Search Broken

MSS search has been broken for a few weeks now. One of the issues with the fault has been that MOSS had stopped writing to the error logs so we had no way of finding specific error inforation. I logged a call with Microsoft because of this and they suggested that i recreate the SSPs as they must be coorupt.

I tested this by creatiing a new SSP and true enough it did allow search queries and returned results. But, recreating our SSPs is no small job because once you do so you have to recreate all your customisations as well. This means redeploying custom webparts and setting them up on your sites. Recreateing audiences and resetting targeted content on the sites, etc etc. Depending on your set up this can take quite an effort.

Before heading down the last resort of recreating the SSPs i decided to try and solve the issues first. For info I am running a standard installation with 3 servers:
  • MOSS01 - Index
  • MOSS02 - WFE
  • MOSS03 - Query & Central Admin
Take note that it took a weekend of digging around and trying the same steps over and over again to finally fix everything. There's a list of the errors and how to fix them at the bottom of this post. I have tried to put the main steps that i followed into order below - i hope this helps someone...

******************************************************

Attempt 1

  1. Reboot Index server
  2. Reboot Query server
  3. Propagate the Index file to a new location using STSADM
    stsadm -o osearch -propagationlocation
Result: Index moved to new location sucessfully. Search not working.

Attempt 2
  1. Start the Indexing service on the MOSS Index server using Computer Management / Services
  2. Stop the Search Services (Index & Query) using STSADM
    stsadm -o osearch -action stop
  3. Start the Search Services (Index & Query) using STSADM
    stsadm -o osearch -action start
Result: Search not working.

Attempt 3
  1. Reset the Indexer in each SSP to the Index server via Central Admin SSP Proerties page
  2. Add the process accounts to each SSP on the Edit Properties page - http://ssp/admin/_layouts/searchsspsettings.aspx
  3. Set the security for C:\Windows\Tasks to read & write for the WSS_WPG account:
    1. On the Index server make sure that you can see the Sharing and Security tab in the Windows tasks folder (usually C:\Windows\Tasks) by open a command prompt and type attrib –s %windir% \tasks.
    2. Browse to C:\Windows\Tasks in explorer, right click and select properties. Grant the WSS_WPG group Read and Write permissions on the tasks folder.
    3. Open a command prompt and type attrib +s %windir% \tasks to reset the tasks folder to its default view.
  4. Delete the content index in each SSP
  5. Start a full crawl in each SSP
Result: Search now returning results correctly in 2/4 SSPs. MOSS event logs are now populating.
  • SSP1 status - Propagating to new Query server. Search index status 'Computing ranking'. Search not working. When I manually started a crawl, there's a pop up message saying 'Crawling might be paused because a backup or an index move operation is in progress. Are you sure you want to resume this crawl?' Selected 'Yes'.
  • SSP2 status - Propagating to new Query server - Search not working
  • SSP3 status - Propagating - Search is working
  • SSP4 status - Idle - Search is working
Attempt 4
  1. Reboot Index & Query servers
  2. Stop the Search Services (Index & Query) using Central Administration
  3. Recreate the Search Services (Index & Query) using Central Administration
  4. Reset the Indexer in each SSP to the Index server
  5. Set the security for C:\Windows\Tasks to read & write for the WSS_WPG account
  6. Reset the content index in each SSP
  7. Start a full crawl in each SSP
Result: Search working in all SSPs.

One remaining error in the event log is now: Tracing Service failed to create the trace log file directory 'D:\MOSS\12\LOGS'. Error 3: The system cannot find the path specified.

******************************************************

General Error List

Some of the errors i have worked through are listed here:
  • Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information
    • Reassociating the indexer and search service with the ssp under application management on the central administration site
  • Content index on Portal_Content could not be initialized. Error The content index is corrupt.
  • Query server not responding
  • Could not create a database session
  • Error trying to access the SSP search settings page: http://ssp/admin/_layouts/searchsspsettings.aspx - 403 FORBIDDEN
  • 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
      To work around this issue, you must add the WSS_WPG group to the Tasks folder. To do this, follow these steps:
      1. Use an account that has administrative permissions to log on to the computer that is running the Office SharePoint Server 2007 indexing service.
      2. Click Start, click Run, type cmd, and then click OK.
      3. At the command prompt, type the following command, and then press ENTER:
        attrib –s %windir%\tasks
        Note In this example, %windir% is the path of the Windows folder. For example, the path can be C:\Windows.
        Note If Windows Explorer is open when you make this change, you will not see the extra tab in Windows Explorer. If Windows Explorer is already open, close and then reopen it before you perform step 4.
      4. In Windows Explorer, right-click the Tasks folder, and then click Properties.
      5. In the Tasks Properties dialog box, click the Security tab, and then click Add
      6. In the Select Users, Computers, or Groups dialog box, type WSS_WPG in the Enter object names to select box, and then click OK.
      7. Grant the following permissions for the WSS_WPG account, and then click OK: Read & Write
      8. Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
      9. In Internet Information Services (IIS) Manager, right-click ComputerName (local computer), click All Tasks, and then click Restart IIS.
      10. Click Start, click Run, type cmd, and then click OK.
      11. At the command prompt, type the following command, and then press ENTER:
        attrib +s %windir%\tasks
        Note This resets the Tasks Property back to the default view.
  • The search service is currently offline. Visit the Services on Server page in SharePoint Central Administration to verify whether the service is enabled. This might also be because an indexer move is in progress.
    • http://www.sharepointblogs.com/jasonmedero/archive/2008/09/15/moss-2007-error-when-moving-indexing-role-the-search-service-is-currently-offline-visit-the-services-on-server-page.aspx
      1. Stop and start search services on new index server and all servers running the query role
      2. Then restarted the search service via central administration under operations tab>>Services
      3. Went into Services.msc and found the Office Search Service and restarted it manually
      4. Checked to make sure that the search service account had correct rights to SQL.
    • None of the above worked so...
      1. Going into the SSP settings (clicking on SSP administration not the SSP link itself) within the left quick launch navigation from within central administration.
      2. Selecting the dropdown arrow next to the SSP where I was having the search issue
      3. Select edit properties
      4. Within the properties screen of the SSP look for the “Process accounts”
      5. Make sure that your search account is in there!
  • Test Shared Service Provider stuck on 'Unprovisioning' after trying to delete it and associated databases.
    • http://prequest01.wordpress.com/2008/08/16/unable-to-delete-shared-services/
      1. Login to SQL server.
      2. Open SQL Management Studio and expend Databases.
      3. Expand Configuration Database & Tables.
      4. Opened table for dbo.object.
      5. Executed following query in query analyzer: SELECT * FROM [MOSS_CFG_CA_01].[dbo].[Objects]where name like ‘Name of the Shared Services’.
      6. Copy the ID of object referenced in objects table of configuration database.
      7. Open command prompt and changed directory to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> and executed following command to delete the Shared Services using the ID which was copied: Stsadm -o deleteconfigurationobject -id “id retrieved from object table”
  • The search request was unable to connect to the Search Service

Tuesday, June 17, 2008

SharePoint RSS Viewer Error

Having added the SharePoint OOB RSS web part on to my site and configured it to point to a feed i received the following error in the log:

RssWebPart: Exception handed to HandleRuntimeException.HandleException System.Net.WebException: Unable to connect to the remote server

Found the solution here: http://yasirbutt.spaces.live.com/blog/cns!A8677D5751E6B4DA!1409.entry

The following needs adding to the site web.config file (at the bottom of the file):

<system.net>
<defaultProxy>
<proxy usesystemdefault = "false" proxyaddress="http://proxyservername" bypassonlocal="true" />
</defaultProxy>
</system.net>