SharePoint 2010: Usage files are not deleted, causing timer service problems.

On a SharePoint Server 2010 server, the Usage Provider (.usage) files are not deleted from the file system. Additionally, the .usage files keep growing.

 

The ULS logs are filled with the below errors :

 

Trace Management Service unable to delete file ‘D:\APPS\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS\IPW-SPWFE01-20160328-1257.usage’.  Error 00000020

 

To clear the old .usage files from the file system, I had to restart the SharePoint Timer Services. The .usage files were not getting automatically deleted and this is a known issue.

 

MS recommends the below action to fix this:

  1. Installing December 2013 CU for SharePoint 2010 (I would not recommend this )
  2. Set up a scheduled task to manually recycle the timer service (at least) once a day — every 4 to 6 hours would be better. 

 

You can use a PowerShell command like this to recycle the service:

restart-service -Name SPTimerV4

 

Then you just need to set up a scheduled task to run it every 6 hours on every SharePoint server in the farm.

When the timer service is manually recycled, the open handles to the .usage files are released, and they will be automatically deleted when the next instance of the Usage Data Import timer job runs (by default every 30 minutes).

 

There should be no need to manually delete the files or restart the services.

 

Advertisements

Disable the recognition of mobile browsers

It can be done by adding the following snippet in thesystem.web section of the web.config of your Web Application:
<browserCaps>
    <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <filter>isMobileDevice=false</filter>
</browserCaps>

SharePoint 2010: System.Security.Cryptography.CryptographicException – ERROR

SharePoint 2010 has a new feature which recycles the OWSTIMER.EXE process every night – similar to the application pool functionality in IIS – to avoid memory problems inside the timer service.

The recycling is controlled by a new timer job which has been added in SharePoint 2010: the “Timer Service Recycle” job which per default runs once a day at 6 AM.

While performing the recycling and shutting down the timer service the timer service runs into a problem in .NET which Tess Ferrandez has explained here.

The problem here is that the encryption key was created on a specific thread which was impersonated under a specific users account. When the .NET Finalizer processes the encryption key while the timer service shuts down it executed on a different thread which is not impersonated – so the key does not exist and you get an exception like “keyset does not exist”.

As this exception occurs in the final stages of the shutdown of the process it does not cause any harm – beside adding an event to the event log when it happens:

 

Eventlog Error

An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 4213
Exception: System.Security.Cryptography.CryptographicException

Message: Keyset does not exist

StackTrace:    at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
at System.Security.Cryptography.SafeProvHandle._FreeCSP(IntPtr pProvCtx)
at System.Security.Cryptography.SafeProvHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()

A more visible problem for a customer will occur when Visual Studio or a another JIT Debugger is installed on the affected box. In this case the following dialog will show up on the Console when the problem occurs:

Uninstalling Visual Studio will not resolve this issue as the registry settings which present this dialog are still active.

To configure the server to no longer show a dialog when an unhandled exception occurs, use the registry editor to delete the following registry keys:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger

On a 64-bit operating system also delete the following registry keys:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger

More details are at:
http://msdn.microsoft.com/en-us/library/5hs4b7a6(VS.80).aspx

Fix for Sharepoint 2010 issue with Workflows not firing with Content Organizer

When you attach a workflow to a document library that also has Content Organizer activated, and set that workflow to automatically activate on the addition or change of an item, sometimes the workflow will not fire – especially if a routing rule has been applied.

This fix watches for the addition or change of an item, and if the item is in a document library with the Content Organizer feature activated, it iterates through the attached automatic workflows and forces them to fire.

This is a known defect with Sharepoint 2010. You can read a current discussion here

Fix from our friends at CodePlex here 

 

Updating Content Type in the CTH does not update the individual Document Libraries

The Content Type Hub CTH can be a complex beast with settings located in lots of different places; Central Administration, Site Collections, sub-sites and the CTH itself.

You might come across a situation where you publish things to the CTH but they don’t get updated in the Document Libraries which inherits it.

There are four useful little tick boxes, which you’re only likely to see at the point you create the service, two of which have a huge effect on how the Content Type Hub functions.

To get to them go to Central Administration > Application Management > Manage Service Applications > Highlight the ‘Metadata Service Application Proxy’ (click anywhere but the title) > Select ‘Properties’ on the ribbon

This should bring up the ‘Edit Managed Metadata Service Connection’ window.

Here you can see the four options.

The first two are firmly aimed at the Term Store, but the last two have a huge impact on the CTH. The last one is clearly what we’re after so let’s tick that box!

You should now see your document libraries and lists updating from the CTH without a problem.

Increase the SharePoint 2010 Upload File Size Limit

  • Central Administration
  • “Manage Web Applications”
  • Select desired web application row (don’t click on the title, just select)
  • “General Settings” in the ribbon
  • Under Maximum Upload Size, change the setting to the desired value (e.g. 200 MB in our example)
  • “OK”

if it still doesn’t work…..

Increase the IIS7 request length

Use the following command on the machine you are running the IIS 7:

%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:valueInBytes

In our case, we’ll simply put 200x1024x1024=209715200 bytes.

You will receive a confirmation message after applying the command. Please bear in mind that you will need to run the cmd.exe in administrator mode.

 

 

Credits

SharePoint Feature Administration and Clean Up Tool

This cool program is nothing less than a Swiss Army knife for managing features in SharePoint.  It shows you which features are installed in your farm (farm, site collection, and web level), you can also activate/deactivate features, uninstall features, and (my favorite function!) – scan for problem features in the farm and remove them on the spot!
http://featureadmin.codeplex.com/

 

Credits : CODEPLEX