Wednesday, April 29, 2015

Unable to process the request . Wait a few minutes and try performing this operation again

Issue Description

Recently I came across this issue where some of the end users were getting an error message when they tried to open an Excel file in SharePoint in the browser.

Unable to process the request.
Wait a few minutes and try performing this operation again.

Unable to process the request 1

Cause

The Excel Services Application server computer is in a non-valid state and may need to be restarted.

Resolution

Most of the online articles were asking me to restart the Central Administration server.I did not want to do that and found a different fix.


Identify the application pool running the Excel Services service application (from IIS) and Recycle it.

1) Start –>Run –> inetmgr

2) Under the Sites click on SharePoint Web Services. This will list down the Services in SharePoint.

3) Click on each GUID –> Change the view from Features View to Content View

4) On finding ExcelService.asmx -> Right click that web service -> Manage Application -> Advanced Settings.

5) Identify the Application Pool (make a note of this).

6) Now in IIS –> Application Pools –> choose the Application Pool you noted down in previous step   -> Recycle (recycle the application pool).



Unable to process the request 2

Identify the Application Pool for a Service Application

1) Start –>Run –> inetmgr

2) Under the Sites click on SharePoint Web Services. This will list down the Services in SharePoint.

3) Click on each GUID –> Change the view from Features View to Content View

4) On finding SearchService.svc -> Right click that web service -> Manage Application -> Advanced Settings.

5) Identify the Application Pool (make a note of this).


6) Now in IIS –> Application Pools –> choose the Application Pool you noted down in previous step   -> Recycle (recycle the application pool).



Tuesday, April 28, 2015

Internal server error exception: System.NullReferenceException: Object reference not set to an instance of an object

Error Description

Recently I came across this error with SharePoint Search. I was searching in a SharePoint list and got the below error.
Error
Internal server error exception:
Troubleshoot issues with Microsoft SharePoint Foundation.

On checking the ULS logs I found the below entries

01/28/2015 10:59:51.10         w3wp.exe (0x31D8)                0x2030    SharePoint Server Search      Query      fm9a        Unexpected                CoreResultsWebPart::OnInit: Exception initializing: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader()     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e)               7001a8bf-b506-4096-b46b-003fbb5ec91b

01/28/2015 10:59:51.10         w3wp.exe (0x31D8)                0x2030    SharePoint Server Search      Query      g1j9         Exception                Internal server error exception: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader()     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e) System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.SetPropertiesOnQueryReader()     at Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart.OnInit(EventArgs e)               7001a8bf-b506-4096-b46b-003fbb5ec91b


01/28/2015 10:59:51.10         w3wp.exe (0x31D8)                0x2030    SharePoint Server  Unified Logging Service       c91s        Monitorable                Watson bucket parameters: SharePoint Server 2010, ULSException14, 06175311 "sharepoint server search", 0e001b67 "14.0.7015.0", 17853a8f "microsoft.office.server.search", 0e001bd1 "14.0.7121.0", 531f1826 "tue mar 11 10:05:26 2014", 000032a4 "000032a4", 0000002d "0000002d", 4a6d3421 "nullreferenceexception", 67316a39 "g1j9"    7001a8bf-b506-4096-b46b-003fbb5ec91b


Solution 1

If you go into Central Administration -> System Settings -> Manage Services on Server. Make sure the below services are started.

- SharePoint Server Search
- Search Query and Site Settings Service

Solution 2

Click through all the Search Administration pages in Central Admin.Click through all the Search Administration pages in Central Admin. Now perform the search again. The issue should have disappeared.


Solution 3

Identify the underlying application pool for search (Reference)
Perform an application pool recycle

Wednesday, April 15, 2015

SharePoint Crawled Properties and Managed Properties

Last year, when I had an interview, I was asked the difference between crawled property and managed property. Though I have come across this multiple times and even after working on Search Project, I could not give a satisfactory answer.(honestly ,even for me the answer was not satisfactory)

So what is Crawled Property and Managed Property in SharePoint ???

Crawled Properties and Managed Properties are very basic SharePoint concepts but they are building elements of SharePoint Search. Below is an example which might help you understand this in a better way.
SharePoint crawls data from different sources. The data in these various source systems have metadata which can have different names but it refers to the same information.

As an example different systems can store the information about the Author in various systems with the name as :

Author
Created By
Writer
Owner
and in case of emails it is stored in field From.

But all these fields represent the same information which represent who has created this.

Now when SharePoint crawl these various systems , all these properties become Crawled Properties.
In SharePoint we can group all these Crawled Properties under one Managed Properties.
The below image is a pictorial representation of what I said above.


















Note

One crawled property can be part of multiple Managed Properties.
Managed property can be used in scopes, refiners..etc.

Tuesday, April 14, 2015

Cascading Drop-Down List in a SharePoint 2010 List

Cascading Drop-Down List in a SharePoint 2010 List
This post explains how to implement a Cascading Drop-Down List in a SharePoint 2010 List using jQuery and SPServices. To implement a Cascading Drop-Down List in a SharePoint 2010 List using jQuery and SPServices follow the below steps.

Steps

1. Create a Country custom list


Country List



2. Create a State Custom list with a Country lookup column.


Look up Column Settings


State List



3. Download the following jquery files and upload in your Sharepoint site in site Assets library in a folder named JSLibrary(Create the folder if is not present).

jquery-1.4.2.min.js
jquery.SPServices-0.5.7.min.js



4. Create a CascadeDropDownList with Country and State lookup columns.




5. Select the Default New Form under the List tab of the newly created List CascadeDropDownList.



6. Add a HTML Form Web Part and select Edit HTML Source under the Format Text Tab.



7. Copy and Paste the following code in the HTML Editor:

<script language="javascript" src="/SiteAssets/JSLibrary/jquery-1.4.2.min.js" type="text/javascript"> 
</script> <script language="javascript" src="/SiteAssets/JSLibrary/jquery.SPServices-0.5.7.min.js" type="text/javascript"></script> 
<script type="text/javascript"> 
  $(document).ready(function() { 
            $().SPServices.SPCascadeDropdowns({ 
                relationshipList: "State", 
                relationshipListParentColumn: "Country", 
                relationshipListChildColumn: "Title", 
                relationshipListSortColumn: "ID", 
                parentColumn: "Country", 
                childColumn: "State", 
                promptText: "Choose State...", 
                debug: true 
            }); 
}); 
</script>




SharePoint 2010 Error Message : The current page has been customized from its template. Revert to template

Error Description

Recently I noticed that there was message like this on a SharePoint site Home Page.

The current page has been customized from its template. Revert to template


The below steps hides this message and is not a fix

1. Edit the page in browser and then click on Add webpart, from media and content webpart select Content Editor webpart.

2. Then in the content editor web part Click on "Click here to add new content" to edit the contents of the web part.

3. In the Ribbon, go to the Format Text section, select HTML in the Markup group, and choose HTML Source.

4. Now paste the below code and save the page.

<style type="text/css">
    body #pageStatusBar{height:0px; font-size:0px; padding:0px; border-style:none;}
</style>

Monday, April 13, 2015

How to create a SharePoint State Service application through PowerShell

If you configure the SharePoint service applications manually and not run the configuration wizard, you will miss creating the State Service Application as it is not listed down as a service application option in Central Administration -> Manage Service applications page. ( This Service Application is not available for creation in the New dialog in Central Administration, Manage Service Application)

So it should be created through PowerShell. Below are the commands to create one :

$serviceApp = New-SPStateServiceApplication -Name "State Service Application"
New-SPStateServiceDatabase -Name "SharePoint_Service_State" -ServiceApplication $serviceApp
New-SPStateServiceApplicationProxy -Name "State Service Application Proxy" -ServiceApplication $serviceApp -DefaultProxyGroup



Friday, April 10, 2015

SharePoint Search Service Application Creation through PowerShell

Search service Application can be created and configured through Central Administration and PowerShell as well. The below commands creates the Search Service Application and the associated databases.Further configuration can be done from Central Administration. The main purpose of doing this is to create search related databases without GUID’s.

$SSADB = "SearchDB”
$SSAName = "Search Service Application"
$SVCAcct = "Domain\UserName"
$SSI = Get-SPEnterpriseSearchServiceInstance -local

1. Start Services search services for SSI
Start-SPEnterpriseSearchServiceInstance -Identity $SSI

2. Create an Application Pool.
$AppPool = New-SPServiceApplicationPool -Name $SSAName" AppPool" -account $SVCAcct

3. Create the SearchApplication and set it to a variable
$SearchApp = New-SPEnterpriseSearchServiceApplication -Name $SSAName -Applicationpool $AppPool -DatabaseName $SSADB

4. Create search service application proxy
$SSAProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name $SSAName" ApplicationProxy" -Uri $SearchApp.Uri.AbsoluteURI

5. Provision Search Admin Component.
Set-SPEnterpriseSearchAdministrationComponent -SearchApplication $SearchApp -SearchServiceInstance $SSI

The database names would be as below by running the above PowerShell.

Administration Database: SearchDB
Crawl Database: SearchDB_CrawlStore
Property Database: SearchDB_PropertyStore

"Your local machine time zone does not match your current SharePoint regional setting" warning message in an Access web database in a SharePoint site

Error Description

When you open a Microsoft Access web database in a SharePoint site, you receive the following warning message: “Your local machine time zone does not match your current SharePoint regional setting. Operations involving dates will not work correctly”


Cause

This problem occurs because a different time zone is used in the regional settings of Windows and the SharePoint server.

Fix

To resolve this problem, follow these steps.
1. Identify the time zone setting in the SharePoint site to which the Access web database is published. To do this, follow these steps:

a. At the top of the SharePoint site, click the arrow next to Welcome <User name>, and then click My Settings.
b. On the User Information page, click My Regional Settings.
c. In the Follow Web Settings section of the Regional Settings page, make sure that the Always follow web settings check box is selected.
d. Check the Time Zone setting.

2. Set Windows and the SharePoint server to the same time zone. To do this, follow these steps:

a. Click Start, click Control Panel, and then open the Date and Time item.
b. In the Date and Time item, click Change time zone, and then select the time zone that is used by the SharePoint site.

Thursday, April 9, 2015

How to create a SharePoint Usage and Health Data Collection Service Application through PowerShell

Usage and Health Data Collection Service Application collects Data about Usage and Health of your farm. This information is used for Health Monitoring and this is also required for running the Web Analytics Service. If you do not have a Usage and Health Data Collection Service Application or your Usage and Health Data Collection Proxy is stopped, you will not see any data in the Web Analytics Report.

You cannot create Usage and Health Data Collection Service Application from Central Admnistration.
You have to use PowerShell for this :

New-SPUsageApplication -Name “UsageAppName” -DatabaseServer “DBServerName” -DatabaseName “DBName”

$Usage = Get-SPServiceApplicationProxy | where {$_.TypeName -eq “Usage and Health Data Collection Proxy”}

$Usage.provision()