Workflow Manager: The dispatcher failure rate has reached 11%

There are only a couple of posts on this across the web, none of which have any replies to them.  This is because this issue relates to any number of failures that can occur with the Workflow Manager service. 

One such error is when you attempt to send a DynamicValue as the request header to an HttpSend Activity.  If any of the headers have a significantly large string to them, you will cause a buffer overflow in the Workflow Manager Service. 

In Workflow Manager 1.0 RTM and service bus 1.0 RTM, this will lead to an error reporting service to consume the remaining memory on your application server and thereby rendering that app server useless.  In the Workflow Manager 1.0 Refresh and Service Bus 1.1 versions, the error simply kills the Workflow Manager service over and and over again.

Distributed Cache cacheHostInfo is null

There are several blog posts on this across the web, many will fix your issue, however, you may find that in some cases, none of them work for you. One such issue is if the configuration file of the Dist Cache has your machine registered, yet it cannot any details about that machine in SharePoint, you will get this error.  Even if you run all those wonderful SharePoint cmdlets.  The fix is to export the configuration file, remove the offending server, then upload the configuration file.  Then your SharePoint cmdlets will work:

  1. Export-CacheClusterConfig c: empfile.txt
  2. Remove the offending server
  3. Import-CacheClusterConfig c: empfile.txt
  4. Run the appropriate cmds to add it back

Here is all the scripts I have compiled that will help you to solve any issue you may come across:

  Get-AFCacheHostStatus | % {
    $ServerName = $_.HostName
    Get-AFCacheStatistics -ComputerName $_.HostName -CachePort $_.PortNo | Add-Member -MemberType NoteProperty -Name 'ServerName' -Value $ServerName -PassThru
} | Format-List -Property *   

Stop-SPDistributedCacheServiceInstance -Graceful;
Remove-SPDistributedCacheServiceInstance;

Add-spdistributedcacheserviceinstance

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Unprovision()

$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
$serviceInstance.Provision()

Register-CacheHost -Provider SPDistributedCacheClusterProvider -ConnectionString "Data Source=svr-jc-db1;Initial Catalog=SharePoint_Config_2013;Integrated Security=True;Enlist=False" -Account "NT AuthorityNetwork Service" -CachePort 22233 -ClusterPort 22234 -ArbitrationPort 22235 -ReplicationPort 22236 -HostName svr-jc-web2

Use-CacheCluster
Get-AFCacheHostConfiguration -ComputerName ComputerName -CachePort "22233"
Set-CacheHostConfig -Hostname SP2013 -cacheport 22233 -cachesize 300
Update-SPDistributedCacheSize -CacheSizeInMB CacheSize
start-cachehost
restart-cachecluster
Get-CacheHost
Get-CacheHostConfig -ComputerName SP2013 -CachePort 22233
Export-CacheClusterConfig c: empfile.txt
Import-CacheClusterConfig c: empfile.txt
Get-CacheClusterHealth

$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity domain_nameuser_name
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()

Clear-SPDistributedCacheItem -ContainerType DistributedLogonTokenCache

Security hole in O365 Partner sharing

Until further notice I am advising clients NOT to enable partner sharing.  This is because you never know who will be accessing your data from the partner side.  If your partner is a large SharePoint consulting firm, they have no ability to lockdown who can see your data on their side (out of the 100's or 1000's of clients they have). 

To be said another way, this means they have no way to keep random internal employees from checking out your site and data. Until they activate the ability to assign specific people to your accounts, I highly suggest that you stop partner sharing!!!

In other words, think Edward Snowden and Bradley Manning…type of security holes.

Vote for it here on UserVoice:

http://officespdev.uservoice.com/forums/224641-general/suggestions/5983421-enable-granular-permissions-for-o365-partners

Azure Workflows cannot call O365 APIs

As part of my 5-day O365 course I have a Workflow section that describes things like deploying workflows via Apps with event receivers that deploy to the Host Web.  Also a part of the lab is how to "theoretically" call an O365 API from workflow.  Unfortunately, you cannot call O365 APIs from workflows that live on-premises or in O365.  The reason is two fold. 

  • For on-premises, there is a buffer overflow in the Workflow Manager service (1.0, CU1, CU2 and 1.0 refresh) that barfs on large DynamicValue HttpHeaders in the HttpSend request.  Reference this post for the error you will see.
  • For O365, there is a special STS validation layer that barfs on the Azure AD access token (Error is "JsonWebToken.Issuer != clientId@realm"). If you pass the token in anything but the "Authorization" header it will pass right through, but it will not pass through in the "Authorization" header.

Therefore, the only avenue you have is to use "Basic" auth when making the calls.  This means you must store the user's username and password somewhere rather than allowing them to go through the basic OAuth process the way it should be.

If you would like to be able to do this, vote for it on UserVoice here:

http://officespdev.uservoice.com/forums/224641-general/suggestions/5981236-enable-azure-workflows-to-call-o365-apis

Top Rated Sessions at SPC14

Here is the top rated sessions from SPC14:

Office
365 service communications to customers
Ian Hameroff 5.00
Yammer mining
– dig in and "listen" to what your big *social* data is saying
Richard diZerega 4.91
SharePoint
2013 Search display templates and query rules
Matthew McDermott 4.90
3rd party
JavaScript libraries you need to know
Scot Hillier 4.87
SharePoint
Online Management and Control
Chris Bortlik 4.87
Leverage what
you already know about SharePoint as you move into 2013
Scott Jamison 4.86
The nuts and
bolts of upgrading to SharePoint 2013
Todd Klindt 4.85
Making
SharePoint Collaboration Rock by Increasing Discoverability
Scott Jamison 4.84
Advanced—and
Easy!—BI with Excel and SQL Server Data Mining
Rafal Lukawiecki 4.83
Subordinate
integrity: Certificates for SharePoint 2013
Spencer Harbar 4.83
Customizing
Search experiences with Azure Hosted Data and Bing Maps
Rainer Asbach, Timo
Heidschuster, Johannes Lemmerer
4.82
Futuristic
Search applications using Kinect and Yammer!
Chris Givens, Ben
Lower
4.82
Building
SharePoint Apps with Windows Azure Platform as a Service
Kirk Evans 4.81
Complex
problem solving with the new HTML5 APIs
Scot Hillier 4.80
Cargill:
Real-world challenges and value in introducing enterprise social
Melanie Hohertz 4.80
Beyond
Deployment: How IT Can Inspire, Motivate And Drive Sustainable Adoption?
Cyrielle Simeone, Dux
Raymond Sy, Steve Caravajal
4.80
The strategy
behind building a successful social intranet
Joel Oleson 4.80
Nationwide:
Building a World-Renowned Intranet with SharePoint 2013 and Yammer
Jeff  Schumann, Chris  Plescia , James Tsai, Shawn Domer, Matt
Huber
4.79
Multi-factor
authentication for SharePoint 2013 and SharePoint Online
Liam Cleary 4.79
Comprehensive
User Profile Synchronization
Spencer Harbar 4.78
Deep dive on
self-service data retrieval With Power Query
Matt Masson 4.78
Build your
own REST service with WebAPI 2
Scot Hillier 4.78
SharePoint
data security and compliance
Liam Cleary 4.77
AMD: 13
Million Users. 54 Million page views. www.AMD.com on SharePoint 2013. Done.
Bruce Weatherford,
Michael Mielke, Gil Canare, Katie Bowman
4.77
SharePoint
Business Continuity Management with SQL Server Always On
Neil Hodgkinson,
Wayne Ewington
4.76
SharePoint
Online Performance – Designing your Pages to be Fast
Phil Newman 4.76
Best Buy: The
rise of the ninjas—a SharePoint 2013 user adoption story
Matthew Ruderman,
Sarah  Haase
4.74
How to manage
and troubleshoot Search: A practical guide
Brian Pendergrass,
Jon Waite
4.73
Using
SharePoint as the canvas for student creativity and inspired solutions
Louis Zulli Jr 4.73
Site
provisioning techniques with SharePoint apps
Bert Jansen, Vesa
Juvonen
4.73
Operational
reporting and dashboarding using Microsoft Business Intelligence Solutions
John White 4.73
Federating
applications with Office 365 using Windows Azure Active Directory
Paolo Pialorsi 4.72
Work like a
network: The power of Enterprise Social
Jared Spataro 4.71
Managing
Search Relevance in SharePoint 2013 and O365
David Louis
Hollembaek, Mikael Svenson
4.71
Introducing
Codename Oslo and the Office Graph
Cem Aykan, Ashok  Kuppusamy  4.71
Branding
Internet facing web sites with SharePoint in the cloud
John Ross, Randy
Drisgill
4.71
When should
we use SharePoint out-of-the-box, add third-party apps or build custom
solutions?
Richard Harbridge 4.70
SharePoint
2013 Apps with AngularJS
Jeremy Thake [MVP] 4.69
Stress
testing and optimizing SharePoint 2013 shredded storage with traditional and
RBS storage
Chris McNulty 4.69
Simple
Options for Identity Management with Office 365
Paul  Andrew   4.68
Deep dive:
SharePoint and Office App Security Model (OAuth & S2S) 
Ted Pattison 4.68
Make your
SharePoint portal social in 1-2-3!
Runar Olsen, Thomas
Molbach
4.68
Best
practices for breaking down organizational barriers using Yammer
Allison Michels,
Steve Nguyen
4.67
Azure IaaS
and SharePoint 2013 WCM – better together!
Barry Waldbaum, Frank
Marasco
4.67
SharePoint
2013 demystified
Dan Holme 4.66
Using Windows
PowerShell with SharePoint 2013 and SharePoint Online
Shane Young 4.65
Anyone can
build a SharePoint App with Microsoft Access
Jeff Conrad, Chris
Usher
4.65
Automating
SharePoint operations and governance: site provisioning and group management
Dan Holme 4.64
Search
architecture and sizing in SharePoint 2013
Barry Waldbaum,
Thomas Molbach
4.64
Developing
Cloud-Hosted Apps with MVC5
Bob German 4.64
The Cloud:
Navigating the benefits and challenges of this disruptive innovation
Dan Holme 4.64
Optimizing
SQL Server 2012 for SharePoint 2013
Brian Alderman 4.64
Deliver
adaptive and personalized experiences for your SharePoint 2013 sites
Ryan Sockalosky 4.64

 

SharePoint 2013 Birthday Reminder Workflow

I haven't seen anyone blog this in 2013 style, so here we go. This workflow will send an email to people every year on the day someone has a birthday.  Here's the step by step of how to create this birthday reminder workflow!

STEP 1:  Create a Birthday Calendar!

STEP 2:  Fire up SharePoint Designer 2013, connect to your site

STEP 3:  Create the workflow

  1. In the navigation, click "Workflows"
  2. In the ribbon, click "List Workflow", select your calender list

  3. For the name, type "Reminder Workflow"
  4. For the type, ensure that "SharePoint 2013 Workflow" is selected:

  5. Click "OK"

STEP 4:  Configure the "Set ExecuteDate" stage

  1. Rename "Stage 1" to "Set ExecuteDate"
  2. Click in the stage, start typing "Set a workflow variable", press ENTER
  3. Click the "workflow variable" link, then select "Create a new variable"
  4. For the name, type "ExecuteDate"
  5. For the value, select "DateTime"
  6. Click "OK"
  7. Click the "value" link, then click the "Fx" button
  8. For the data source, select "Current Item"
  9. For the Field, select "Start Time"
  10. Click "OK"
  11. Click below the set workflow variable action
  12. Start typing "If value equals", press ENTER
  13. Click the first "value" link, then click the "Fx" button
  14. Select "Workflow Variables and Parameters"
  15. Select "Variable: ExecuteDate"
  16. Click "OK"
  17. Click the "equals" link, change the value to "is less than"
  18. Click the second "value" link
  19. Click the "…" button, select "Current Date"
  20. Click "OK"
  21. In the if condition, start typing "Add Time to Date", press ENTER
  22. Click the "0" for the months, set it to "12", press ENTER
  23. Click the "date" link
  24. Click the "value" link
  25. For the data source, select "Current Item"
  26. For the Field, select "Start Time"
  27. Click "OK"
  28. Click the "Variable: date" link, select "Variable: ExecuteDate"
  29. Click below the "Set ExecuteDate" stage, in the ribbon, click "Stage", a new stage should be added
  30. Change the name of the new stage to "Pause For ExecuteDate"
  31. In the "Set ExecuteDate" stage's transition to stage area, start typing "go to stage", press ENTER
  32. Select the "Pause For ExecuteDate" stage
  33. The stage should look like this:

STEP 5:  Configure the "Pause For ExecuteDate" stage

  1. Start typing "If value equals", press ENTER
  2. Click the first "value" link, then click the "Fx" button
  3. Select "Workflow Variables and Parameters"
  4. Select "Variable: ExecuteDate"
  5. Click "OK"
  6. Click the "equals" link, change the value to "is greater than"
  7. Click the second "value" link
  8. Click the "…" button, select "Current Date"
  9. Click "OK"
  10. In the if condition, start typing "Pause until…", press ENTER
  11. Click the "this time" link, select the "Variable: ExecuteDate"
  12. Click below the "Pause For ExecuteDate" stage
  13. In the ribbon, click "Stage"
  14. Rename the new stage to "Send Email"
  15. In the "Pause For ExecuteDate" stage's transition to stage area, start typing "go to stage", press ENTER
  16. Select the "Send Email" stage
  17. The stage should look like this:

STEP 5:  Configure the "Send Email" stage

  1. Start typing "If value equals", press ENTER
  2. Click the first "value" link, then click the "Fx" button
  3. Select "Workflow Variables and Parameters"
  4. Select "Variable: ExecuteDate"
  5. Click "OK"
  6. Click the "equals" link, change the value to "equals (ignoring time)"
  7. Click the second "value" link
  8. Click the "…" button, select "Current Date"
  9. Click "OK"
  10. In the if condition, start typing "Email", press ENTER
  11. Click "these users"
  12. Select a sharepoint or ad group that you want to email
  13. For the subject, click the "Fx" button, select the "Current Item: Title", click "OK"
  14. In the body, type "Happy Birthday!"

  15. Click "OK"
  16. Below the Email action, start typing "Add Time", press ENTER
  17. For the month, type "12"
  18. For the two variables, set them to "Variable: ExecuteDate"
  19. Below the if condition, start typing "If value", press ENTER
  20. Click the first "value" link, then click the "Fx" button
  21. Select "Workflow Variables and Parameters"
  22. Select "Variable: ExecuteDate"
  23. Click "OK"
  24. Click the "equals" link, change the value to "is less than"
  25. Click the second "value" link
  26. Click the "…" button, select "Current Date"
  27. Click "OK"
  28. Below the if condition, start typing "Add Time", press ENTER
  29. For the month, type "12"
  30. For the two variables, set them to "Variable: ExecuteDate"
  31. In the "Send Emails" stage's transition to stage area, start typing "go to stage", press ENTER
  32. Select the "Pause For ExecuteDate" stage
  33. The stage should like this:

STEP 6:  Set the Workflow firing actions

  1. In the navigation breadcrumb, click the "Reminder Workflow" node
  2. On the workflow properties page, in the "Start Options" section, check the "Start workflow when an item is created" checkbox:

  3. Press "Ctrl-S" to save the workflow
  4. In the ribbon, click "Publish"

Create an item, fire the workflow!

Enjoy!
Chris

All O365 MVPs Blogs and Twitter Handles

Updated as of 6/3/1024:

Since I am doing a lot with the O365 APIs at the moment, I figured it would be good to drop the O365 MVP list in addition to the SharePoint one.  I also attached the script to follow all of them below.  So here you go:

Name Blog Twitter
Alberto Pascual (Alberto Pascual) Blog guruxp
Alexandru Dionisie Blog AlexDionisie
Alvaro dos Santos Rezende Blog
Amin Tavakoli Blog amintvk
Arnaud Blog
Ayman Mohammed El-Hattab Blog aymanelhattab
Ben Curry Blog
Benoit HAMET Blog benoit_hamet
Brendon Ford Blog stewartisland
Brett Hill Blog bretthill
Brian Nøhr Blog Bsnohr
Dan Holme Blog
Danny Burlage Blog
Darrell C Webster (Darrell Webster) Blog DarrellCWebster
Diogo Dias Heringer Blog
Dragan Panjkov Blog panjkov
Eunjoo Lee (Eunjoo Lee) Blog
Fernando Andreazi Blog fandreazi
Genki Watanabe Blog
Gilles Pommier Blog
Goran Husman Blog
HeeJin Lee (Hee Jin Lee) Blog
Igor Pavlekovic Blog igorpnet
Jeremy Dahl Blog
Jesper Ståhle Blog JesperStahle
Jethro Seghers Blog jseghers
JinHwan Woo Blog
Jorge Castañeda Cano Blog xorxe
Kazuhiko Nakamura (?? ??) Blog
Kelsey Epps Blog kelseyepps
Kerstin Rachfahl Blog himmlischeit
Laurent Miltgen-Delinchamp Blog
Loryan Strant Blog thecloudmouth
Malin Dandenell Blog
Mario Cortes Flores Blog
Markus Widl Blog markuswidl
Martina Grom Blog magrom
Masayuki Mokudai (????) Blog Office365Room
Mauricio Cassemiro Blog
Michael Kirst-Neshva Blog ankbs
Myles Jeffery Blog
Naoki Osada Blog
Nitin Sadashiv Paranjape Blog
Nuno Árias Silva (Nuno Árias Silva) Blog NunoAriasSilva
Paul Woods Blog paulwoods
Poo Ching Loong Blog
Raphael Köllner Blog ra_koellner
Rene Dominik Modery Blog modery
Robert D. Crane Blog
Sara Barbosa Blog Sarabarbosa
Sean McNeill Blog s_mcneill
Seiji Noro (?? ??) Blog
Steve Noel Blog CloudItca
Tomislav Bronzin (Tomislav Bronzin) Blog tbronzin
Vincent Choy Blog
Yoni Kirsh Blog
Yoshihide Sakamoto Blog
Zeljka Knezovic Blog zeljkak
Zoltan Zombory (Zombory Zoltán) Blog zomby_z
Peter van Hees Blog mrpetrovic

Extending SharePoint 2013 REST APIs

As promised, here is my blog post on how to extend SharePoint 2013 REST APIs! This post is similar in technical depth as the Extending Ceres engine post here.

The general premise is to add your own end points to the REST APIs in an on-premise environment.  This is a totally valid scenario similar to extending sharepoint with your own Service Applications.  This technique is used by the Project Server team (totally different team from the SharePoint team) to extend the ProjectServer and ProjectData REST end points.  I have published the sample project here. Here are the high level steps of what you must do:

  1. Create a class decorated with ClientCallableType
    1. Set the name to the same name as the class
    2. Generate a new ServerTypeId set it
    3. Set the FactoryType to a Object Factory that you will create next
  2. Add methods and properties to the class, decorate with ClientCallable, ClientCallableMethod, ClientCallableProperty
  3. Create the Object Factory that inherits from ClientCllableObjectFactory (this will create an class instance using an identifier)
    1. Decorate the class with the Clietn
    2. CallableObjectFactory attribute, set the ServerTypeId to the one you generated for the class
    3. Implement the GetObjectById method
  4. Create a ServerStub class that inherits from Microsoft.SharePoint.Client.ServerStub
    1. Decorate the class with the ServerStub attribute, set the type to the class type, set the TargetTypeId to the ServerTypeId
    2. Implement a public constructor
    3. Override the following properties and methods
      1. TargetType (returns typeof(class))
      2. TargetTypeId
      3. TargetTypeScriptClientFullName (the name of your client target type you will create next)
      4. ClientLibraryTargets (what clients can call your rest endpoint)
      5. GetProperty Method
      6. InvokeConstructor method (for both the CSOM and REST calls)
      7. Constructor implementations called from InvokeConstructor
      8. InvokeMethod (this calls the object's method)
      9. GetMethods (this is required to tell the $metadata endpoint what is available)
      10. GetProperties (similar to GetMethods)
  5. Create another class in a .Client namespace
    1. Decorate it with the ScriptType attribute, set the name and ServerTypeId
    2. Make it inherit from ClientObject
    3. Create the properties and methods that match to your server side class
  6. Create a ScriptTypeFactory that implements the IScriptTypeFactory interface
    1. Implement the IFromJson method, use a switch statement to generate a Client class object based on the scriptType string
  7. Create the ProxyLibrary.xxx.xml file
    1. Deploy to the {SharePointRoot}/ClientCallable directory
  8. Open the project's AssemblyInfo.cs file
    1. Add a UrlSegmentAliasMap attribute
    2. Add a ClientNamespaceMap attribute
    3. Add a ClientTypeAssembly attribute
  9. Deploy the Farm Solution
  10. Perform an IIS Reset
  11. Hit a "_/api/$metadata" endpoint, you should see your end point displayed!

Enjoy!
Chris

 

Random MVP Stats

Last year (2014), 24 never before SharePoint MVPs were honored:

firstname lastname blog twitter country
Alistair Pugin (Alistair Pugin) http://www.ecmninja.co.za alistairpugin South Africa
Brandon Atkinson http://brandonatkinson.blogspot.com/   United States
Chris McNulty   cmcnulty2000 United States
Christopher Clement http://christopherclementen.wordpress.com/ ClemChristopher Belgium
Colin Phillips http://mmman.itgroove.net itgroove_colin Canada
David Sánchez Aguilar http://davidsanchezaguilar.wordpress.com davidsancheza Costa Rica
Eric Riz   rizinsights Canada
Heber Lopes http://www.heberlopes.com.br heberolopes Brazil
Jason Warren http://www.habaneroconsulting.com/insightsby?Author=jason-warren jaspnwarren Canada
Keith Tuomi http://yalla.itgroove.net   Canada
Margriet Bruggeman http://www.sharepointdragons.com margrietvuur Netherlands
Marius Constantinescu http://nettitude.wordpress.com c_marius Switzerland
Melick Rajee Baranasooriya http://melick-rajee.blogspot.com/ MelickRajee Sri Lanka
Nicki Borell http://www.sharepointtalk.net/ NickiBorell Germany
Roger Haueter http://www.techtask.com techtask Switzerland
Chris Givens https://blogs.architectingconnectedsystems.com givenscj United States
Gokan Ozcifci http://gokanx.wordpress.com GokanOzcifci Belgium
Hemendra Agrawal (Hemendra Agrawal)     India
Hirofumi Ota   hrfmjp Japan
Miguel Tabera (Miguel Tabera) http://www.sinsharepointnohayparaiso.com migueltabera Spain
Romeo Donca (Romeo Donca) http://www.romeodonca.ro/ romeodonca Romania
Thomas Vochten http://thomasvochten.com ThomasVochten Belgium
Vlad Catrinescu http://www.absolute-sharepoint.com   Canada
Wesley Hackett http://weshackett.com weshackett United Kingdom

By Country Breakdown:

5    Canada
3    Belgium
3    United States
2    Switzerland
1    United Kingdom
1    Brazil
1    Costa Rica
1    Germany
1    India
1    Japan
1    Netherlands
1    Romania