Blog

SharePoint issue resolution – PortalSiteMapProvider was unable to fetch children for node or Unexpected System.Web.HttpException: Request timed out #SharePoint

Request time out is a very generic issue and can happen due to numerous reasons but error PortalSiteMapProvider was unable to fetch children for node can occur only if site navigation nodes cannot be fetched that is Top Navigation or Left Navigation.

Issue Symptoms: SharePoint sites does not load at all and give error after more than a minute. If you look for error message via correlation ID you will see Request time out message and below error messages

  • PortalSiteMapProvider was unable to fetch children for node
  • Caught a thread abort exception in TemplateRedirectionPage.ProcessRequest, the exception may be expected
  • Unexpected System.Web.HttpException: Request timed out

Issue Analysis: The first error is the key here as it mentions that it has experienced issue while fetching Navigation from site. This issue can be triggered if you duplicate nodes in site collection or between multiple site collections in the same content database. It’s important to understand that this can happen in the same content database site collections. You can consider this is as a kind of bug in SharePoint because this scenario is valid to have duplicate nodes. To identify and confirm that you have this issue you need to fire below SQL query on the content database you have the issue. I know I know we should fire any queries in SharePoint database but in this case you have to and got in confirmed from Microsoft, also they mention that it is prohibited to update data.

SELECT TOP(20) Count(nav.Eid) AS ‘DuplicateCount’, nav.DocId, ad.Dirname, ad.Leafname FROM NavNodes AS nav with(nolock) INNER JOIN AllDocs AS ad with(nolock) ON nav.Docid = ad.Id WHERE (nav.EidParent = 1025 OR nav.Eidparent = 1002) AND DocID IS NOT NULL GROUP BY nav.DocId, ad.DirName, ad.LeafName ORDER BY ‘DuplicateCount’ DESC

If it has data then it means you have duplicate nodes issue. A lot of users in some other articles have mentioned that they somehow were able to find numerous nodes and they fixed it by deleting the nodes which were basically junk nodes not added by them. But in our case we did not have any junk nodes but it occurred due to real nodes.

Once above is confirmed we need to find out which stored procedure failed as that it will re-confirm above and also what fix we need to do. To do that we need to change verbose level of logging and capture more detailed log. To change verbose use below commands to start and stop it. Between them you need to perform the issue that is load the page

set-sploglevel -traceseverity verboseex

Clear-SPLogLevel

Based on correlation ID you should see that this stored procedure “sp_recompile proc_getwebnavstruct” is the culprit. If this is also confirmed then we can go for the fix

Issue fix: To fix the issue you will have to do things, first is it to update statistics table and second free cache of stored procedure. Note that statistics update is only needed if it has not been updated to check that fire below query on content database

USE WSS_Content_name

GO

SELECT name AS index_name,

STATS_DATE(OBJECT_ID, index_id) AS StatsUpdated FROM sys.indexes order by’index_name’ ASC

GO

If the row Nav_Nodes does not have dates same as today then please update it using below command

EXEC sp_MSforeachtable ‘UPDATE STATISTICS ? WITH FULLSCAN’

Once done we should also run below command to update query plan cache

DBCC FREEPROCCACHE

Once done site should load normally now as it use to do before.

Note that the fix is all about running SQL queries on SharePoint content database, it has to be done carefully and also only if needed.

Refer to below support link for details

https://support.microsoft.com/en-us/help/3103194/outdated-database-statistics-decrease-sharepoint-server-performance,-cause-time-outs,-and-generate-run-time-errors

In case you need more help on this or other SharePoint issues please contact us via our Contact Us page or via our Facebook page or via Twitter

Like us on Facebook and follow us on Twitter

 

 

 

 

SPFX SharePoint : Building your environment for client side webpart #spfx #spfxsharepoint

As of 22nd feb 2017 GA version of SPFX SharePoint Framework has been released. SharePoint Framework SPFX that is client side web part is a new framework introduced to provide one more option for client-side development other than Script Editor based and Add-in model.

The new framework is based on both of the existing solutions but in most of the scenarios SPFX is a preferred way to develop, two major plus points

  • Responsive controls
  • Can be deployed on modern pages and classic web part pages as well

More information can be read here Why SPFx

Building your environment for doing development using SPFX is very welll documented on this article but while doing the same for me I got few issues so I am just going to highlight few points which I thought was confusing or should be highlighted

There are four major things you need to do to set up your development environment

 

  • Install Node JS : You need to install Node JS, make sure you do install LTS version from here https://nodejs.org/en/ . Unfortunately I installed it from here first time and it did not workout good https://nodejs.org/en/download/ . Refer more details here
  • Install Yeoman and gulp : Once Node JS installation is done you should run below commands to install Yeoman and gulp, make sure you run these commands in Windows PowerShell, I have assumed that you are using a Windows 10 machine. Also I tried using CMD prompt but it did not work out good. Also make sure you create a separated folder under C Drive and then perform all the steps
    • npm install -g npm
    • npm install -g yo gulp
    • npm install -g @microsoft/generator-sharepoint
  • Install Visual studio code : Install Visual Studio code from here 

If all steps are successful then your development environment is set up and you are ready to develop your first client side web part.

In case you need more help on this or other SharePoint issues please contact us via our Contact Us page or via our Facebook page or via Twitter

Like us on Facebook and follow us on Twitter

 

Redirect SharePoint site from HTTP to HTTPS- Issues and Resolutions #SharePoint #SharePoint2013

When we start with SharePoint infrastructure lot of time SSL is not taken into consideration but at later point of time and surely in Production you should have SSL for encryption.

Since your users are used to HTTP URL you cannot ask every one of them to go to HTTPS from now on. The best is to redirect users automatically from HTTP to HTTPS. This article is not about how do this automatic redirection you can get to know the steps from here

Redirect HTTP to HTTPS

We also did steps same as above but we faced some issues after which you might also get which depends on how your infrastructure has been set up

  1. Issues with OneNote : If your end users have stored OneNote in document library all of them will have HTTP URL as their source so after redirecting to HTTPS you cannot save it to HTTP anymore. If one of users save it with new URL then it will be saved as new OneNote file. This is a tricky situation as you cannot get the old file and all will have local copies. Best strategy is to have the latest OneNote saved before you do redirection and upload it as new one after redirection.
  2. Issues with embedded links in files : If you have embedded links of MS Office documents in other documents then you will still be able to open documents but all of them will open in read only mode but usually you will have option to edit directly from them. Solution to this to update the links after redirection, there is no alternative to this. Good part is still you can open the file.
  3. Search issues : If you have HTTP URL as default URL in AAM or have used HTTP URL in search configuration then your search might break, you will not see any results but no error as well. To fix this you just use HTTPS URL at all places.

So these are things you need to consider if you plan for HTTP to HTTPS redirection.

Some other reference

http://support.microsoft.com/kb/2818415

In case you need more help on this or other SharePoint issues please contact us via our Contact Us page or via our Facebook page or via Twitter

Like us on Facebook and follow us on Twitter

 

Connect to Outlook and Sync to Outlook in SharePoint Task list #SharePoint #SharePoint2013 (We weren’t able to start syncing your tasks because one or more prerequisites for connection to Exchange server could not be found. Please contact your Administrator to resolve the issue)

When you create a Task list in SharePoint you can see two options in List Settings tab depending how the Farm has been configured.

Two options are

  1. Connect to Outlook
  2. Sync to Outlook

Users will see Sync to Outlook option if a Farm level feature called “Farm Level Exchange Tasks Sync” is enabled else they will see Connect to Outlook.

Note this feature is accessible only from Central Admin under Manage Farm Features.

farmlevelsynctasks

Issue with Sync To Outllok option is that just enabling this will not make Sync To Outlook work properly, most probably you will get error like below

synctooutlooj

We weren’t able to start syncing your tasks because one or more prerequisites for connection to Exchange server could not be found. Please contact your Administrator to resolve the issue.

To make this lot of prerequisites are required, details can be found here

Sync To Outlook Configuration – TechNet

If this works it means that Tasks will be synced at real time on all devices on which you have Outlook and you can Sync only the tasks Assigned to you. Unfortunately if the prerequisites are not met users can get frustrated by above error message.

In case your organization cannot fulfill prerequisites for Sync to Outlook then best is to go for Connect to Outlook which can at least make a Copy of Task list but not on all devices, only on current device.

In case you need more help on this or other SharePoint issues please contact us via our Contact Us page or via our Facebook page or via Twitter

Like us on Facebook and follow us on Twitter

 

 

2nd Microsoft Flow Template – Send Push Notification & Slack Message for a WordPress post #MicrsoftFlow #SharePoint #Office365

I was able to get my second Microsoft Template published in Microsoft Flow

Template can be used from here

Send Push Notification & Slack Message for a WordPress post

Functionality in this template is quite simple, when a WordPress post is made a push notification is made and also a Slack Message is posted in a particular group

To learn how to publish a template you can read my below blog about it

How to submit a Flow in template Gallery ?

To learn more about Microsoft Flow you can read below blogs

My tryst with Microsoft Flow!

Microsoft Flow – Create from blank

Microsoft Flow – Advanced mode options #SharePoint #MicrosoftFlow

What is SharePoint WebHooks ? #WebHooks #SharePoint #SharePointWebHooks

Before we describe SharePoint WebHook, first let’s understand what is a WebHook.

I believe you are familiar with concepts of API which has been popular for few years now, in API model / setup you request data from an application and in return you get data from the application.

So let’s consider a scenario that you want to know every time something changes in the application, to deal with that in API is cumbersome you will have to keep on asking for data and find out if there was any change from last time.

What if you can get a notification that something has been changed, means you get a response without asking that something has been changed. Now that is what WebHook is, you get a notification that something has changed.

Before I describe SharePoint WebHook you must know that WebHook is not something which has been created by Office 365 or Microsoft but it’s a concept already used in WordPress etc.

SharePoint WebHook can be created for Lists as of now, so basically any changes in a library or list will send a notification if you have subscribed to WebHook. Based on this notification you should a response and also process it further for implementing changes or activities.

Now if you know about Remote Event Receivers you might find it similar but it is different as you can prevent the action or change happening in SharePoint but only be notified about it. Also like traditional WCF based notifications you don’t have information of what has been changed, you just a get a response that something has been changed in library or list.

So as an Application you need to do certain things to make WebHook work

  • First of all subscribe to a WebHook
  • Once subscribed you will receive POST messages from SharePoint
  • Once you receive POST message you should response in 5 seconds with HTTTP/1.1 200 OK
  • After that your application should store the notification to process it further.

This is basic overview of SharePoint WebHook, in next post we will do more hands on and learn to set up WebHook and how to process it.

 

SharePoint 2013 Search Error : object reference not set to an instance of an object – Fix #SharePoint #SharePointSearch

This a common error message which you can see if you have search issues “Object reference not to set an instance of an object”. This error message does not tell much and you will have to look SharePoint log and find the correlation ID.

If you search on the internet for this error you will hit numerous reasons and fix for it. Problem is that error message is very generic and can be seen for various kind of issues. I have encountered this in two scenarios which I am gonna list down.

First thing you need to check SharePoint health, if there is an error in that best resolution is to recreate the index

You must have some error message in SharePoint search status like below

search-topology-monitoring

Reset search index

If that is the not the case the other reason can be you have orphaned items in your farm / content database. Generally you will get error message in SharePoint Health Analyzer for this but in our case we did not get it strangely. So basically you cannot trust it so best is to look for correlation ID in SharePoint Log.

What I observed is that when you search in SharePoint it will enumerate all site collections and it might fail doing so if you have orphaned items. You should look carefully and find out which content database it was enumerating.

If you have find out you should use below command to Refresh Sites for the content database. This method synchronizes information between content and config databases.

$db = Get-SPDatabase | where {$_.Name -eq “DatabaseName”}

$db.RefreshSitesInConfigurationDatabase()

If this also does not work you can use below as well but this needs to be done out of office hours.

Dismount-SPContentDatabase “<ContentdBName>”

Mount-SPContentDatabase “” -DatabaseServer “” -WebApplication http://SiteName

Hopefully this well help someone and I just added one more solution in list of solution available.

In case you need more help on this or other SharePoint issues please contact us via our Contact Us page or via our Facebook page or via Twitter

Like us on Facebook and follow us on Twitter

Microsoft Flow template published #MicrosoftFlow #SharePoint #Office365

So finally my first Microsoft Flow template has been published, I am quite excited about it! It took sometime for Microsoft to add in the list of templates but better late than never.

Template can be used from here

Send email and add item in SharePoint List when WordPress Post is created

Functionality in this template is quite simple, when a WordPress post is made, you can get an email and same information can be added in SharePoint List.

To learn how to publish a template you can read my below blog about it

How to submit a Flow in template Gallery ?

To learn more about Microsoft Flow you can read below blogs

My tryst with Microsoft Flow!

Microsoft Flow – Create from blank

Microsoft Flow – Advanced mode options #SharePoint #MicrosoftFlow

Basics of Data Science #DataScience #MachineLearning – Machine Learning Day 1

Data Science is all about understanding data, finding patterns and at the same time predict something out of it.

First step in data science is about getting hold of data, data can be available in different formats such as csv, excel, SQL tables, txt files etc.

Once we get data we can start exploring it and refining it as well. Excel is a very good tool to explore data which comes with lot of inbuilt functionalities.

Step two figure out any anomalies of data you have got and remove them such as

  • Duplicate data
  • Incorrect data such as most of the data ranges in 2 digits but suddenly you have a 3 digit or 4 digit data so you need to understand whether this is correct or should be removed
  • Blank data, any blank data can be filled with relevant data like  by taking an average or removing it.

Above list is not exhaustive but relevant, there can be other scenarios as well.

Once you have cleaned your data, third step is to use some methods to understand your data better

Using these methods you might be able to identify some trends or understand it better than before.

Once you have understood it better and you are smart enough you can ask following types of questions which forms basics of data science

  • Descriptive: Questions like how many?, how much ?
  • Associative: Relational data questions, like if temperature is high you sell more ice creams or you sell more ice creams between 2 PM to 4 PM
  • Comparative: Compare of flavor of ice creams being sold and compare them in a day or a month
  • Predictive: You can predict data such as chocolate flavor ice cream is most liked by children

If you can ask above questions it means you understand data quite well. Next step is to plot data in different ways such as Graphs, Charts, Histograms and also visualize data in 2D and 3D (Pivot table and charts)

Some common techniques are listed below

So these are some basics of data science, more in next blog

Data Science is huge subject which cannot be dealt in one blog, I have started a journey of acquiring a new skill “Machine Learning”, I am writing blog as I learn to keep notes for myself and for future learners. First day we learnt about basics of data science.

PowerShell to update an item in SharePoint List #SharePoint #PowerShell

If you are working in support you might get tickets to update a particular item as users are not able to update some columns as it’s locked due to some workflow or checks in forms´customization. The user in workflow is on leave or currently not available so as support you can do it from back via PowerShell.

It can be done via some simple PowerShell commands as below

$web = Get-SPWeb “Put site URL here”

$list = $web.Lists[“ListName”]

$item = $list.GetItemByID(46)

$item[“Status”] = “Approved”

$item.update()

So in above example first we create reference to the web we are going to work upon, then refer to list on which you are going to work upon.

Next step is to get a specific item by using ID and we are using GetItemByID function. As an example we have used item id 46, you need to replace this with your ID.

Next is to update a particular column value, here “Status” is a column name, which is being updated with new value “Approved”.

Last step “update” function is important else value will not be updated.