Translate

Tuesday, May 9, 2017

December '16 Cumulative Update for SharePoint 2013 Issue - Data View Web Parts Stopped working without workaround

The SharePoint Data View Web Part in On Prem environment is not working as expected after the Dec '16 CU is installed. This is fixed in April '17 CU. So, after you patch your SP 2013 environment with Dec '16 CU you would see your DVWP breaking. Below are the error details and workaround available.

If you add a DVWP in your page you would see an error like below.

Error On the Page :
Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

Correlation ID: -------

Error in ULS Log :
If you search the ULS log with the correlation id you will see an error like below.

Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.   
 at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteSelect(DataSourceSelectArguments selectArguments, String aggregateString, Boolean wantReturn, BaseXsltListWebPart webpart, SPListItem& listItem, SPListItemCollection& listItems, String[]& fieldList)   
 at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()   
 at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()   
 at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String viewPath)   
 at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

Workaround :

Open the page in SharePoint Designer and remove the below tags from the data source.

<SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Project Study" Name="ListName"></WebPartPages:DataFormParameter><asp:Parameter DefaultValue="0" Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0" Name="nextpagedata"></asp:Parameter><asp:Parameter DefaultValue="1" Name="MaximumRows"></asp:Parameter>
OR
<asp:Parameter Name="StartRowIndex" DefaultValue="0"/><asp:Parameter Name="nextpagedata" DefaultValue="0"/>


Observation :
The issue is not reproducible in environments where Dec '16 CU is unavailable. I have tested this.

Solution :

MS has confirmed that it is a known bug. The issue is fixed in April '17 CU, but I haven't installed and tested this to confirm. Patch installation requires planning, approval and downtime which is time consuming. Once I test this, I will update again to confirm.


Wednesday, April 19, 2017

SharePoint 2013 Site Collection Change Lock State using PowerShell


There are various situations where a site collection administrator has to make changes to the lock status of a/multiple site collections. It could be because you are migrating, or you want to execute some auditing and so on. Below is a script which can help you do the same. We can change the Lock state of a site collection to any of the available one. You can also add multiple site collections in the $sitelist parameter.

Hope it helps :) !


$sitelist = @("https://yoursitecollectionURL",)
foreach($site in $sitelist){
  $s = get-spsite $site
  $s.LockIssue = "Any text you want to add for logging purpose"
  //Set-SPSite -Identity $site -LockState [NoAccess|UnLock|ReadOnly]
  Set-SPSite -Identity $site -LockState NoAccess
                                         }

500 Internal Server Error - SharePoint STS Application Pool

Often we have noticed 500 Internal Server Error in SharePoint Site collections. The issue typically occurs when the service account that is used by the STS was used for an interactive log on and afterwards logged out. For example, an administrator logs on to a WFE server by using the farm account and then log off. By doing this, it forces the registry keys to be unloaded in the profile of that account. This condition makes the keys unavailable for future use. The most common errors which we notice in the ULS log would be like below.

SPSecurityContext: Request for security token failed with exception: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs
STS Call Claims Windows: Problem getting output claims identity. Exception: 'System.Runtime.InteropServices.COMException (0x800703FA): Illegal operation attempted on a registry key that has been marked for deletion. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)  at System.DirectoryServices.DirectoryEntry.Exists(String path) 
STS Call: Failed to issue new security token. Exception: System.Runtime.InteropServices.COMException (0x800703FA): Illegal operation attempted on a registry key that has been marked for deletion. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Exists(String path) 

Workaround :

1.  Recycle the STS app pool
2.  If some users are still getting 500 Internal Server Error, clear the browser cache of the user machine and it should work

Solution :

There are two steps involved to fix the issue of 500 Internal Server Error.

Step 1 : Enable auto recycle of STS App pool during off business hours.

Step 2 : Enable "Load User Profile" feature in the IIS against STS app pool. You can refer this article to configure the same.




Monday, July 4, 2016

Get ULS Log Using Powershell

How to get the ULS log entries using powershell

It is not easy to search for an error using correlation id from the sharepoint log. We use ULS log viewer to make the ULS log look nicer. However, powershell provides us a way to extract the log between a specified time frame and provide a text file. Run the below command to get it.

Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPLogEvent -StartTime "07/02/2016 11:35:00" -EndTime "07/02/2016 11:40:00" | ?{$_.Correlation -eq "3c768c9d-5f2e-70a4-962e-b5dddb8ca4f2"} | select Area, Category, Level, EventID, Message | Format-List | out-file "D:\Corelog.txt" 

Monday, May 30, 2016

SharePoint 2013 Server - The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'.




SharePoint 2013 Server - Unexpected response from server. The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'


When everything is working fine and suddenly you start receiving an error while the SharePoint page loads, "Unexpected response from server. The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'". That too from only one front end server. First thing first;

  • Remove the front end server from the load balancer.
  • Now your site is fine for end users, but not for you ;)
  • Login to the front end server where the issue is occurring.
  • The issue occurs mostly because of occupied memory. If memory utilization is more then you will receive this error.
  • Right click on Task manager and check the memory occupied.
  • The users who are logged into the servers and forgot to log off has occupied space.
  • Right click on the username and force log off them; except your userid ;)
  • Refresh the SharePoint site, the error is no more.
  • Enable the server in the load balancer again.

Cheers !

Thursday, July 16, 2015

Build a Table of InfoPath Repeating Section and Send Email using Nintex Workflow

If you have followed my previous post on how to read the Repeating Section data then this section would help you. On this post I will explain on how to form a table out the repeating section and build a string to Send an Email using Nintex Workflow.

1. Add a Build String activity after the Log to History activity. (Please have a look at my previous post here). This activity is added inside the For Each.

2. Create a multiple lines of text variable varStoreChargeCodes and form the table like above. Store the table result in varStoreChargeCodes
3. After the For Each activity, add another Build String activity, this will form the Email Body. We will use the varStoreChargeCodes variable, which is nothing but our table, containing the Project Names and corresponding Charge Codes.
4. You can add any detail you want to add on the build string, like for me I created a table to add the Employee Name, Employee Badge ID# and then added the variable containing Project Names and Charge Codes. Store the Email body is a variable varFormTable.
5. Finally add a Send Email activity like below, where the email body would contain the varFormTable variable.

That's it. The repeating section data would appear in a table. For me the email looks like below.


Happy Reading !