Showing posts with label SharePoint 2013. Show all posts
Showing posts with label SharePoint 2013. Show all posts

August 21, 2013

Workflow deployment timed out after 20000

I recently suffered a persistent activation an error when attempting to deploy any project with a feature containing a workflow.

The error  said that the feature activation timed out after 20000 milliseconds. (sorry, bit vague I know but to busy fixing the problem to cut-n-paste it before finding the solution)

Looking at the Event Logs hinted at a service bus issue:

Failed Service Bus Operation: System.OperationCanceledException: 40400: Endpoint not found.

I tried the usual (re)Register-SPWorkflowService but that had no effect. I tried restarting the Workflow and Service Bus Services aswell as the Server, but to no avail.

The only way I was able to solve the issue was to leave and then re-join the Farm.

To do this run Workflow Manager Configuration and click "Leave Workflow Manager Farm". Follow the prompts.

Run Workflow Manager Configuration a second time and select the third option Join a Farm. Enter your details and follow the Prompts.

After the configuration was finished I re-ran the powershell registration command:
Register-SPWorkflowService –SPSite http://devintranet.domain.local –WorkflowHostUri http://server.domain.local:12291 -force -ScopeName Development –AllowOAuthHttp

I was then able to successfully deploy my projects that contain workflows.





July 16, 2013

Sharepoint GUID problems

I have been recently working with (tearing hair out) Managed Metadata Columns in Visual Studio 2012 for SharePoint 2013.

This site has excellent information on the subject. After deploying the sites example code without error I progressed to make my own column. I generated some GUIDs from guidgenerator.com to use for my new TaxonomyFieldType and Note field elements.

After  several days of vague errors and feature activation fails I narrowed the problem down to the field GUIDs. I then replaced the generated GUIDs with GUIDs cut-n-paste from an SharePoint 2013 site (different server) and now my new column deploys without failure! huh?

This doesn't make sense to me but if it helps someone else, so be it.

July 1, 2013

Workflow Manager Client Download

Here is the direct link to download Workflow Manager Client

The download location for Workflow Manager Client is less than obvious. This little blog post is to hopefully  make it easier to "Goggle" for.


To download manually:

1) Go to Microsoft Download Center - Workflow Manager 1.0

2) Click the big orange download button.

3) Choose (check) "WorkflowClient.exe" from the list and click next.


After Installing you will need need to restart the server.

You also might need to open up the firewall ports (12290/12291)  on your Workflow Manager server. (Assuming you have installed the client for the purpose of connecting a new computer to the Workflow Manager.)

June 5, 2013

Restore-SPSite Error - nativehr nativestack

If you are attempting to restore a site backup using the PowerShell command Restore-SPSite and receive and error containing this nondescript text:

<nativehr>0x80070003</nativehr><nativestack></nativestack>

Try running the same command whilst logged in as Administrator.


May 27, 2013

Workflow 401 unauthorized error when calling SharePoint 2013 based WCF web service.

Update: the issue is fixed with the March Update of SharePoint 2013. Install it, re-register your workflow and the problem should be gone. As discussed here.

SharePoint 2013 no longer allows SharePoint developers to create custom coded workflows in Visual Studio. Instead we must now create web services that we call from a workflow with the http workflow action.

So this is what I did, create a custom wcf in Visual Studio 2012 and deployed it to my farm. After a bit of effort I was eventually able to get it to work and could see a response to my web service call from multiple web browsers (as multiple different users).

Whoever when I tried to consume the web service in a workflow I confronted with a 401 Unauthorized error. I Googled and found a many suggestions, mostly from older version of SP:

  1. Loop-back issues? Nope, my registry was already changed.
  2. Run C+ code with elevated privileges? Not valid, My service returns a simple string.
  3. Set Header to Authentication="". Didn't have any effect.
  4. Run in App Step? No effect.
  5. Enable anonymous in the web application...
I was rather reluctant to enable anonymous but unfortunate it turned out to be necessary to allow Workflow Manager to makes calls to my custom web service. 

Before you go...

Enabling Anonymous is the first but there are two spots to control anonymous access in a web application, and you might want to consider the second one also.

For both steps: open Central administration and navigate to: Application management > Manage web applications.

To Enable Anonymous access: Click/highlight a web application row > Authentication Providers > Click 'Default'. Tick Enable anonymous access.

Your web service will now work but...

Set Policy: Click/highlight a web application row > Anonymous Policy. I discovered that if you select "Deny All - Has no access" the web service calls will still work! 

Theoretically this means anonymous access is now off again but I can still make web service calls. I do not claim to know exactly what is going on here but this seems to fit my need perfectly: anonymous access denies but web service enabled, so I will take the win.

Please feel free comment on this querk if you are knowledgeable on the subject. 

May 21, 2013

Connect a SharePoint Farm and Workflow Manager with both HTTP & HTTPS

We finally got our SharePoint 2013 server running with SSL certificates in place, Workflow Manager configured, Office Web Apps connected and SQL servers syncing. It seems fair to say that SP 2013 installation is a bit more effort that SP 2010! Which created a time issue: I needed to get our new intranet operating ASAP so I had to skip the separate development environment and develop on same server in a separate web application. (Not ideal, I know, but its temporary)

So, I setup my temporary development web application but I have a problem: the Live web application uses HTTPS and I want my development site to use HTTP. How can I connect SharePoint to Workflow Manager on both web apps?

The Powershell command to connect SharePoint to Workflow Manager has a scopeName property, we can use this.

Lets look at the first connection, https:

Register-SPWorkflowService –SPSite https://intranet.xyz.local –WorkflowHostUri https://hostname.xyz.local:12290

The default scopeName is "sharepoint", so no need to use scopeName for our first connection.

My second (HTTP) connection looks like this:

Register-SPWorkflowService –SPSite http://dev.xzy.local:10985 –WorkflowHostUri http://hostname.zyx.local:12291 -ScopeName Development –AllowOAuthHttp

Using scopeName will create a second connection to Workflow Manager called "Development". Use port 12991 (not 12990) for WorkflowHostUri and you must add –AllowOAuthHttp.

More detailed info can be found in this helpful blog entry.

April 22, 2013

2013 Workflow canceled: App Step 401 Error

Shear unbridled frustration, is the fate I hope to save you from by letting you know this one thing: disable then re-enable 'Workflows can use app permissions' site feature. This, for me, fixed the problem of getting a canceled workflow every time it tries to perform an App Step action.

The, rather unhelpfully workflow error is:

System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPRequestGuid":["1baa1cc3-5c49-bbe9-5965-69c4ae7ba771"],"request-id":["1baa1cc3-5c49-bbe9-5965-69c4ae7ba771"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Mon, 22 Apr 2013 04:10:44 GMT"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} The HTTP response content could not be read. 'Error while copying content to a stream.'.

I suspect the issue came about when I created a site collection in my live environment from a dev environment backup.

March 7, 2013

SharePoint Designer 2013: an error occurred while trying to fetch data from your sharepoint


Whilst try to open a SharePoint 2013 site with SP Designer 2013 I received this error: "an error occurred while trying to fetch data from your SharePoint site".

A Google search returned nothing but results for similar issues with SP Designer 2010. Many of the posts (like this one) I found suggested the solution had to do with windows authentication, but none of solution matched with what I saw in windows IIS in Windows 2008 SP2.

There is a private joke among the help desk support guys that I have worked with: "Shut up and reboot" Which is the crude way of saying sometimes the only thing you can do is restart, and many times, as in this time, it works. The solution, In IIS, disabled then re-enabled Windows Authentication in on the SharePoint - 80 Site.

Let me walk you through it:

In Windows Server 2008:
1) Open IIS.
2) Click on "SharePoint - 80"
3) Double-click the Authentication icon.
4) Right Click "Windows Authentication".
5) Click Disable.

4) Right Click "Windows Authentication".
5) Click Enable.

Hopefully, you will no longer receive the error when trying to open a site in SharePoint Designer 2013.





February 7, 2013

How to edit 2013 Seattle and Oslo Master pages


SharePoint 2013 has a fancy new system called Design Manager that is there to help making pages from scratch much easier than in SP2010. However if all you want to do is modify the Seattle or Oslo default master pages and, say, add a footer then all the Design Manage seems to do is obscure what should be a simple process. But it is possible to edit these master pages! Here is how...

1) You must have Design Manager enabled. To do this make sure you enable 'SharePoint Server Publishing' & 'SharePoint Server Publishing Infrastructure' features in both the Site Collection & Site Features.

If like me you get errors and cant enable these features in the browser then try these command lines:
Enable-SPFeature -Identity PublishingSite -URL http://siteurl -Force
Enable-SPFeature -Identity PublishingWeb -URL http://siteurl -Force


2)  In your site open: Site Settings > Master pages and page layouts.

3) Find seattle.html  and open "Edit properties".

4) Uncheck "Associate File".

SharePoint should now allow you to edit the master file directly without throwing errors.

A Gotcha...

If you are including your own .css file make sure the path is correct, from trial-and-error it looks like SharePoint will not render the tag if it cant find the file, so it will give the impression that you are unable to save the .html file. ie: look like the above instructions have not worked.
 <SharePoint:CssRegistration Name="/Style Library/blah.css" runat="server" /> 

If you find this helpful please share a comment. Thanks!