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

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.

 

Backup and restore strategy for SharePoint Online#SharePoint #Office365

SharePoint on-premise Backup and Restore is a big topic of its own but in SharePoint online you don’t have such options. On-prem version you could use PowerShell to do perform nightly jobs to take Backup or you can take SQL backups which can be used to restore later.

Nothing like this is possible in SharePoint Online, because you don’t have servers and there are no PowerShell commands to take back up or export a site , list or library.

So question is how we safeguard ourselves with scenarios which can happen and might have happened in on-prem.

  • User claims a file has been deleted as he / she can’t find it
  • User deletes a file and realizes after long time that he / she needs it back
  • Lot of permission settings have been changed and mistakes have been done, so how to see what it was like 1 day before so that same can be replicated again

Well what are the options with us

  1. Enable version history: Although it does not solve your backup and restore concerns but it can be helpful is certain scenarios such as user updated the document wrongly if version history is not enabled you end up losing earlier version. Of course you can ask Microsoft for a restore which they keep for 14 days but note that it is not a granular restore which means whole site collection is restored and you might have duplicates
  2. Use Recycle Bin: To lot of extent this solves a lot of worries of Backup and Restore. Each file, item , list or library, site deleted will be stored in Recycle Bin for 90 days. You can always restore your own files for 90 days and if deleted from own recycle bin it will be stored in site collection recycle bin. Also we have second stage recycle bin which can be accessed by site administrators. If a site collection is deleted then it can be restored within 30 days as it depends your Office 365 storage.
  3. Request Microsoft for a restore: Microsoft keeps 14 days backup and it can be restored by making a request to Microsoft. So if you do the math if a file was deleted 105 days back it can still be restored as you can go 14 days back with backup and considering that deleted file might be in Recycle bin so you can restore it from there. But this is not very ideal as you will have duplication of data and it can be only done on site collection level and both old and new files will be presented to user.

So what are other alternatives, you can go for some third-party tools which are available in market, they allow you to take backups, do granular restores much like you were doing in on-premise SharePoint but of course it drives cost due to licenses and storage costs in Azure or some other services or cheap in house storages.

Another thing I can think of is taking backup on your own and storing it in some cheap storage locally / in-house. I have not built any solution like this but it can be done as below

  • You already have Recycle bin and Microsoft 14 days backup which can save you in most of the scenarios
  • But what if there are some business critical data which you want to safeguard beyond what you are getting and you don’t want to spend more money on third party tools etc.
  • You can write a script using REST API which download data for business critical sites and stores locally. Download list data to excel. REST API supports downloading of data which can easily structured as backup if the script is written that ways. Frequency can be once a week so we have some extra cushion or daily depending on how long it takes to run, you can run parallel or multi threaded scripts to execute parallel.

If you like the idea of REST API let me know I can help you provide a solution based on that. Leave a comment and we can take it from there.

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