Wednesday, 18 September 2013

Search Service Application : Memory gates checking failed because the free memory (314294272 bytes) is less than 5% of total memory.


Today’s issue is related to Search Service Application. We have our new deployment and noticed that search was not working.
We were getting a following error in event viewer:


WebHost failed to process a request.

 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/57773521

 Exception: System.ServiceModel.ServiceActivationException: The service '/_vti_bin/client.svc' cannot be activated due to an exception during compilation.  The exception message is: Memory gates checking failed because the free memory (314294272 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. ---> System.InsufficientMemoryException: Memory gates checking failed because the free memory (314294272 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.

   at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

   --- End of inner exception stack trace ---

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)

 Process Name: w3wp
 Process ID: 11704

This issue is related to memory. We have only 8 GB memory in our development environment. Since we had deployment and then full crawl, and there are total 7 web applications in content source to be crawl. So lots of memory gets consumed and search service started throwing such types of an exceptions.
 
We killed some not required processes just to free the some memory, did the IISRESET and wonder happened search service back to normal state and result is shown.

Other solution might be by restarting the following services
  1.        SharePoint Search Host Controller
  2. SharePoint Server Search 15
This will release all the consumed memory.
 
Thanks!
Enjoy reading J
Feel free to comment / feedback if any or if you have any query J



Friday, 23 August 2013

Difference between Managed Property created at Site collection level VS Search Application level


Hello All,
Recently I got a chance to work on SP 2013 search and one new feature related to manage properties I found which is - in SP 2013 we could create new managed property at Site collection level. 
Following figures showing the different Search options available in SP 2013 site and SP 2010 site

 
Fig.1 SP 2013 site options
 
Fig.2 SP 2010 site options






 

In SP 2013 site there is Schema option available under the Search and Schema link redirect to _layouts/15/listmanagedproperties.aspx?level=site page (_admin/search/listmanagedproperties.aspx?appid=eddfe58b%2D9920%2D41c2%2D96b6%2D9d2fb96b1711 –managed properties listing page at Search service application level)

 


Fig.3 Managed properties page at Site collection level


 But there are some differences when you create managed properties at site collection level VS SSA level

When we crate managed property at site collection level there are some limitations

1.       We can create managed property only of type Text and Yes/No – Boolean as shown in following Fig.4
2.       Managed property cannot be Refinable – as shown in following Fig.5
3.     Managed property cannot be sortable – as shown in following Fig.6


Fig.4 creating new managed property at Site Collection Level – Available Types

Fig.5 creating new managed property at Site Collection Level – No Refinable


Fig. 6 creating new managed property at Site Collection Level – No Sortable
Few more points


1.       If we want to make the managed property Sortable and Refinable then we could do that but from Search Service Application

2.       Except above three limitations there is no difference between the managed property created from the Site collection level and managed property created from the Search Service Application level


Thanks!

Enjoy reading :)
Feel free to comment / feedback if any or if you have any query :)

 



 

 

Tuesday, 30 July 2013

Common exceptions while configuring the User Profile Service Application in SharePoint 2013

Hello All,

Small sharing regarding exceptions which got while configuring the User Profile Service Application for SharePoint 2013


I was preparing the SP 2013 environment. I am done with installation and central administration configuration. Next I started with the User Profile Service Application; I have created new User Profile Service Application.  When I am going to access the User Profile getting a following exception:

User Profile Application Proxy failed to retrieve partitions from User Profile Application: Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: UserProfileApplicationNotAvailableException_Logging :: UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have bfc81ba0-789c-4972-bed6-cd7a3e60457b     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext)

After doing some research I found that following services are stopped (_admin/Server.aspx).

User Profile Service
User Profile Synchronization Service

So I started these services and tried to access User Profile Service Application again but no luck. But then I did IISRESET and access the User Profile Service Application and it worked like a charm J

But then next I noticed that User Profile Synchronization Service is in “Starting” mode for some time and then stopped. I went through the SP logs and found following exceptions

OWSTIMER.EXE (0x25CC)                       0x004C          SharePoint Foundation                Topology                                  8xqz   Medium        Updating SPPersistedObject UserProfileApplication Name=User Profile Service Application. Version: 13333 Ensure: False, HashCode: 5871419, Id: 1969f112-342f-4845-bacd-1c5b7be0913e, Stack:    at Microsoft.Office.Server.Administration.UserProfileApplication.Update()     at Microsoft.Office.Server.Administration.UserProfileApplication.ResetILMFlags()     at Microsoft.Office.Server.Administration.ProfileSynchronizationSetupJob.Execute(SPJobState state)     at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)     at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)    
   
OWSTIMER.EXE (0x25CC)                       0x004C          SharePoint Foundation                Topology                                  75bd  High               UpdatedConcurrencyException: The object UserProfileApplication Name=User Profile Service Application was updated by another user.  Determine if these changes will conflict, resolve any differences, and reapply the second change.  This error may also indicate a programming error caused by obtaining two copies of the same object in a single thread. Previous update information: User: <User Name> Process:OWSTIMER (9676) Machine:<Machine Name>  Current update information: User: <User Name> Process:OWSTIMER (9676) Machine:<Machine Name>
OWSTIMER.EXE (0x25CC)                       0x004C          SharePoint Foundation                Topology                                  8xqz   Medium        Updating SPPersistedObject UserProfileApplication Name=User Profile Service Application. Version: 13343 Ensure: False, HashCode: 63289421, Id: 1969f112-342f-4845-bacd-1c5b7be0913e, Stack:    at Microsoft.Office.Server.Administration.UserProfileApplication.Update()     at Microsoft.Office.Server.Administration.UserProfileApplication.ResetILMFlags()     at Microsoft.Office.Server.Administration.ProfileSynchronizationSetupJob.Execute(SPJobState state)     at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)     at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)         3bca319c-c15d-f09a-9557-4865fa31fa48

OWSTIMER.EXE (0x25CC)                       0x004C          SharePoint Foundation              Topology                              8xqz   Medium        Updating SPPersistedObject ProfileSynchronizationSetupJob Name=ProfileSynchronizationSetupJob. Version: 13329 Ensure: False, HashCode: 13815511, Id: c7317b26-6311-46fa-97f2-50e3c2a376a1, Stack:    at Microsoft.SharePoint.Administration.SPJobDefinition.Update()     at Microsoft.Office.Server.Administration.ProfileSynchronizationSetupJob.Execute(SPJobState state)     at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)     at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)         3bca319c-c15d-f09a-9557-4865fa31fa48

For the above exception we need to reset the timer service. So I reset the timer service and User Profile Synchronization Service started

So here my intention is just to share the kind of exception could come if those services are stopped and then IISRESET is must.

Thanks!

Enjoy reading J

Feel free to comment / feedback if any or if you have any query J

Friday, 7 June 2013

SharePoint 13 – Configuration wizard failed on step 8 – Failed to create sample data


Hello All,

Today new problem J

Problem: After installing SharePoint 2013 on non-domain server, configuration wizard is failed on step 8 – Failed to create sample data.

I didn’t find solution for the given problem but found it on MS forum, so just sharing it J since I struggled for couple of hours to find the exact solution.

On our fresh new server having RAM 16 GB we have installed SharePoint 2013 on non-domain server. After installation done we have started SharePoint Products Configuration Wizard but it is getting failed on Step 8 and showing following error.

and the exception is

Exception: System.ArgumentException: The SDDL string contains an invalid sid or a sid that cannot be translated.
Parameter name: sddlForm
   at System.Security.AccessControl.RawSecurityDescriptor.BinaryFormFromSddlForm(String sddlForm)
   at System.Security.AccessControl.RawSecurityDescriptor..ctor(String sddlForm)
   at Microsoft.SharePoint.Win32.SPNetApi32.CreateShareSecurityDescriptor(String[] readNames, String[] changeNames, String[] fullControlNames, String& sddl)
   at Microsoft.SharePoint.Win32.SPNetApi32.CreateFileShare(String name, String description, String path)
   at Microsoft.SharePoint.Administration.SPServer.CreateFileShare(String name, String description, String path)
   at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.CreateAnalyticsUNCShare(String dirParentLocation, String shareName)
   at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.ProvisionAnalyticsShare(SearchServiceApplication serviceApplication)
   at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.CreateDefaultStoreLocation(SearchServiceApplication serviceApplication)
   at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.ProvisionRawEventStore(SearchServiceApplication serviceApplication)
   at Microsoft.Office.Server.Search.Administration.AnalyticsServiceAdministration.Provision()
   at Microsoft.Office.Server.Search.Administration.SearchServiceApplication.Provision()
   at Microsoft.SharePoint.PostSetupConfiguration.EvalModeProvisionTask.ProvisionServiceApplicationsAndProxies()
   at Microsoft.SharePoint.PostSetupConfiguration.EvalModeProvisionTask.Run()
   at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
 
Solution: I found exact solution for this problem on Ms Forum –
Thanks!
Enjoy reading J
Feel free to comment / feedback if any or if you have any query J


Tuesday, 14 May 2013

SharePoint 13 – Workaround for – Sign in as Different User


Hello All,

I was doing some testing for my application and there is need for changing with different user who has different permission than the current logged in user. I clicked on current user in right top corner; pop appears but no “Sign in as Different User” option. So in SharePoint 2013 there is no “Sign in as Different User” option available as shown in following diagram




One possible solution is open new browser and log in with different user.  

But if we want to log in as different user in the same browser then other workaround is using direct URL in address browser, I opened my SP 2010 site and check the URL – _layouts/closeConnection.aspx?loginasanotheruser=true, I copied this URL and appended to my 2013 site url and it worked well.

Only thing SP 2013 added automatically 15 hive in URL so URL became _layouts/15/closeConnection.aspx?loginasanotheruser=true”.

Thanks!

Enjoy reading J

Feel free to comment / feedback if any or if you have any query J

Wednesday, 8 May 2013

Enabling the incoming email setting for custom generic list


Hello All,

In our one of the SharePoint 2010 project, we have one of the requirement is our custom list should receive an email and message from email should be updated in one of the list column.

Incoming e-mail settings option is enable under Communications column in list settings. 




1.       Document, picture, or form library
2.       Announcements list
3.       Calendar list
4.       Discussion board
5.       Blog


So here we have challenge to receive incoming emails for our custom list. After doing some research it found that if we associate SPEmailEventReceiver to my custom list, my list could also receive an email and “Incoming e-mail settings” will be available.

Following is the sample code where I have EmailEventReceiver class derived from SPEmailEventReceiver and override the EmailReceived method.

namespace MyNameSpace.EmailEventReceiver
{

    /// <summary>
    /// List Email Events
    /// </summary>
    public class EmailEventReceiver : SPEmailEventReceiver
    {
       /// <summary>
       /// The list received an e-mail message.
       /// </summary>
       public override void EmailReceived(SPList list, SPEmailMessage emailMessage, String receiverData)
       {
       }
   }
}

In above EmailReceived method,  SPEmailMessage contains all the details like Subject, Body etc.  We can read email subject and body as follows

//Email subject
string subject = emailMessage.Headers["Subject"];


//Email message in HTML format
string htmlBody = emailMessage.HtmlBody;

//Email message in Plain text format
string htmlBody = emailMessage.PlainTextBody;

Since I have created list through object model, I have associated above event receiver to my custom list as follows:

if (list != null){
   list.EventReceivers.Add(SPEventReceiverType.EmailReceived, "my fully qualiefied assembly name", "MyNameSpace.EmailEventReceiver.EmailEventReceiver");
   list.Update();
}

Thanks!

Enjoy reading J

Feel free to comment / feedback if any or if you have any query J