Monday, May 06, 2013

Ironing out an SP2013 install

This might save you some time...or at least it'll save me time again when I forget all the things I did to get my 2013 install done!

I started with the AutoSPInstall script for 2013 - if you're unfamiliar with this do yourself the favor and get over to CodePlex and download a copy.  It's a great timesaver.  Apart from naming all of SP's databases with prefixes, it automates the install cycle...very helpful and repeatable!

But - once the install finished, I had some issues.  My logs showed a batch of errors.

1) Certificate Validation Operation took 150003.361 milliseconds... error 8321.  See the separate post for this.  The fix was to set my company's proxy script in the registry for each of the SP Service accounts.  If you get to that HKEY_USER key, you'll know which keys to update - or you can find some handy PowerShell out there to convert a SID to an account if you'd like.  I just set this for everyone there, where it wasn't already set.  I also set an entry in my server's Hosts file 127.0.0.1 crl.microsoft.com, followed by an ipconfig /flushdns - seemed the hosts entry did the trick.

Update 1/26/14: This link really works - follow the steps to export the SharePoint root certificate & import to your trusted root certs & you'll be good to go.  http://support.microsoft.com/kb/2625048

2) Error 2548/2159 errors...for this, two fixes.  1) Whack the Search Service Application, delete the databases too, then redo the service.  Then, add the Search Service account to the local administrators group...gets search working.

3) My favorite - killed myself on this and it was a real SharePoint d'oh moment...I was getting loads of 3355 connection timeout expired errors.  Do yourself a favor and skip trying to fix the timeouts - the real issue was right there on my Hyper-V Manager console.  The additions were out of date...yeah, put in the Hyper-V Integration Services DVD image, ran the AMD64 setup, rebooted, and no more 3355s.

I was getting these on another install - had the integration services already updated - the two changes I made were disabling named pipes on the SQL Server client configuration, and added the SP Farm account to the local admin group.  I vote for the former as the fix.

4) Related to all of this was a real goofy "An exception occurred" message on my publishing sites.  Once I got the Search Service working again, this error also went away.

Hope this helps you...

Thursday, April 18, 2013

We don't need no stinkin Task Outcomes!

Ah, au contraire, yes you do.  I had one of those SharePoint WTF challenges today.  I'm building out a SharePoint Designer workflow against a custom list in a custom web template.  I know what you're thinking, and I thought the same, but it wasn't the case!

What was going on was, in my workflow, I have a standard approval task.  Clicking on the task in Designer opens the page where I can modify the properties of the task, like its name, allow reassignment, that sort of thing.  It's also the page where I can define the outcomes of the task - Approved, Rejected, or custom items like Wait Til Next Year or In Your Dreams for those vacation request denials.

Problem is, when I open the page, there were no task outcomes defined...and worse, when I clicked the "New.." button or "New Outcome" on the ribbon, nothing happened, nada:


Not pretty, is it?  I did verify the same workflow worked fine with an OOTB site definition, so my first approach was to look at the web template definition and list definition, and yeah there were a few things wrong...but that didn't fix this issue.  Redeployed the web template, IISRESETted, rebooted, still No Task Outcomes.

The Solution
I've decided to make the solutions succinct and clearly findable - so you Dear Reader can skip all of the fluff above and get your workflow deployed so you can get home and relax.

Go to Site Settings and in Site Collection Features, deactivate all workflow related features; then go back and re-active those feature. 

Worked for me twice, the third side I had really screwed up and got an error that a list "wfpub" in my web was already created so I couldn't activate the workflow features again, so it goes.

Have a slice for me!

Monday, March 25, 2013

CSOM in a CQWP

The post title explains it all!  I've been trying to put together some dynamic web page content based on items in a SharePoint list, using JavaScript code inside a Content Query Web Part on one of my site pages.  Shouldn't be so hard, right?

Well, turns out it isn't.  Found a nice link here with some of the steps needed:  http://techtrainingnotes.blogspot.com/2012/02/sharepoint-how-to-add-javascript-to.html - but with that code on my linked in JavaScript source file, the code still wasn't firing.

Here's what's needed.  At the bottom of the code, add in the following:
function myJSfunction {
   var clientContext = new SP.ClientContext.get_current();

}

function DelayUntilMyJSLoaded()
{
    ExecuteOrDelayUntilScriptLoaded(myJSfunction, 'sp.js');
}

_spBodyOnLoadFunctionNames.push('DelayUntilMyJSLoaded');

What these lines will do is to call my function, but only when the function is ready to be called based on having the base 'sp.js' file loaded.  If you do a view source on the hosting page, there toward the bottom you'll see something very similar.

Tuesday, February 26, 2013

So that's what the Host-Only Adapter is used for! (Windows Phone SDK VM challenge)

Preparing for a talk this Saturday at Grand Rapids DevDays, I wanted to demo the new capabilities for mobile development with SharePoint 2013.  The Visual Studio tooling (alas, sorry MS people, but I have one of those fruit company phones and I like it!) has a good story for Windows Phone, but for the rest of us?  Another story - white paper forthcoming.

For Windows Phone development, here's the big kicker: can't use that Phone emulator virtualized.  Nope, nada, nil, ixnay, no can do.  The Windows 8 SDK requires hardware virtualization with SLAT support - great on physical iron but not virtual iron, so that's right out.  With the Phone 7.1 SDK, same issue - first there's a big warning about not having a compatible GPU, then the phone emulator would continuously reboot to the OS and my app never came up.

So...this gets us to the point of this post, what's a virtualization developer to do?  Ever notice in VirtualBox you have a bunch of choices for networking?


I've been using VirtualBox since I needed x64 support & Virtual-PC just couldn't do it...I've used NAT, Bridged, Internal Network...but Host-only adapter?  What the heck is that for?  Out of the box it has an IP address of 192.168.1.56, what good is that?

Well, turns out this is your way in from the host to your guest internal network.  I assigned an IP in the range of my guests, assigned the guest DNS and default router, changed the VM's to use Host-only Adapter instead of Internal Network, and look at that, I'm in!  The host is not part of my domain but no worries, I need to use Forms Based Authentication anyway for my mobile testing, so we're good to go.

The only other change is to add in entries to the Hosts file on the host for the DNS entries you'll need.  I wasn't able to resolve the hosts values otherwise, and no farm in it.

I'm installing the SDK 8.0 now on my Windows 8 VM with Visual Studio 2012...got a feeling this will work, I'll let you know.

Update: Strike One.  SDK 8.0 enables Hyper-V.  Not a good thing for running VirtualBox VMs.  And there can be only one hypervisor - if Hyper-V is enabled then VirtualBox can't run.  Uninstalling SDK 8.0 and VS 2012, going back to VS2010 and let's hope SDK 7.1 behaves better.

Update: Strike Two and probably three...the good news is I can start up Visual Studio 2010, connect to my SharePoint guest VMs, get list data, prepare my app, but then when I start up the emulator - wham!  There go the VMs.  Seems the VS2010 Windows Phone Emulator is also using the same virtualization VirtualBox needs, and so it knocks out my VirtualBox VMs.  I guess the answer will be to go to Hyper-V with the SDK 8.0 version, but I won't get to that til next week.  Oh well!

SharePoint Foundation 2013 Service Applications list

Below is a screen capture of the set of service applications available with SharePoint Foundation 2013:

Available in Foundation are:

  • App Management Service - used for the new Apps feature set of SharePoint 2013
  • Business Data Connectivity Service - get at that external data through external list definitions
  • Secure Store Service - store credentials and other data centrally and with encryption
  • Application Discovery and Load Balancer Service App - created with the farm
  • Security Token Service Application - used for authentication.
Here's the list of services available on the server - including SharePoint Server Search:


Here the list is:
  • App Management Service
  • Business Data Connectivity Service
  • Central Administration
  • Claims to Windows Token Service
  • Distributed Cache
  • Lotus Notes Connector
  • Microsoft SharePoint Foundation Incoming E-Mail
  • Microsoft SharePoint Foundation Sandboxed Code Service
  • Microsoft SharePoint Foundation Subscription Settings Service
  • Microsoft SharePoint Foundation Web Application
  • Microsoft SharePoint Foundation Workflow Timer Service
  • Request Management
  • Search Host Controller Service
  • Search Query and Site Settings Service
  • Secure Store Service
  • SharePoint Server Search

Plenty more when you enable Standard and Enterprise features, but I was trying to find out specifically what we get with Foundation.

Friday, February 22, 2013

VirtualBox - SetHDUUID COM error

Quick tip in case you have the same issue.  I use VirtualBox as my server virtualization tool - it's a bit nicer on the laptop than running Hyper-V, but that's a whole other discussion!  With VirtualBox, when you set up a template VHD image, to use that image for a new virtual server, you need to assign a unique ID to the VHD image.

Usually, no problem.  VirtualBox has two ways to do this, either the CloneHD command or a SetHDUUID command:

c:\program files\oracle\virtualbox\vboxmanage internalcommands sethduuid

So what's the problem?  I had opened up a command prompt, entered in these commands, but got an error back that the VirtualBox COM server was not running:

VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execu
tion failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or
failed to start.


The solution?  Since this is an admin sort of thing to do I had opened up the command prompt as administrator (Windows 8 - type in CMD, right click Command Prompt, choose Run as Administrator)...and apparently that was the wrong answer!  Open up a regular ol' Command Prompt window and the command goes through just fine.

I'm sure this is a permissions issue - next slow rainy day I'll crack open ProcessMonitor and see exactly what VboxManage can't grab, but for now we're good to go.

Monday, February 18, 2013

Test Lab Guides for SP2013

Looking for some help setting up your SharePoint 2013 environment?  Microsoft's published a series of guides to walk you through the process of setting up a 3-tier farm, then once you have that done, you can configure Claims, Forms Based Authentication, setting up an intranet, and enabling social features:

Three-Tier Farm Configuration

SAML-based Claims Authentication with SharePoint 2013

Forms-Based Authentication

Intranet Collaboration with SP2013

Demonstrate Social Features for SP2013

Full details on the test lab guides:
http://social.technet.microsoft.com/wiki/contents/articles/12409.sharepoint-server-2013-test-lab.aspx

Setting up Forms-Based Authentication now to get my mobile development environment ready for demo!

Thursday, January 03, 2013

IIS Error 500 - app pool culprit

I was helping a coworker today with an error trying to get a SharePoint site up and running.  We were able to provision a new web app with SharePoint Central Admin, and were able to create a site collection in that web app, but when we opened up the web app we got the ol' "Internal Server Error 500" error.

What was different with this one was there were no entries in the Windows event viewer or the ULS logs, so I thought it was an issue with IIS - the IIS log did show an entry with a code 500 0 0 23 and 500 0 0 22.  The problem was not with security as I thought, whether an invalid app pool ID, invalid permissions for the app pool account, having anonymous enabled on the site, and so on...

It turned out the problem was a setting with the app pool.  If you go into Advanced Settings for the app pool, the value for Enable 32-Bit Applications was set to True, but the default and proper setting is False, as shown below.



We changed the value back to False, recycled the app pool, and no more error 500!

SharePoint Foundation Event ID 8321, solved

I have two servers running SharePoint 2013 and both were getting the same Event ID 8321 error every 15 minutes or so in the Event Viewer:

A certificate validation operation took 15004.9996 milliseconds and has exceeded the execution time threshold. If this continues to occur, it may represent a configuration issue. Please see http://go.microsoft.com/fwlink/?LinkId=246987 for more details.

I made two changes to solve this, not sure which one did the trick finally but both are worth trying.  The first, my company uses a proxy server, but I didn't have this configured on either server.  The second was to download the latest (December 2012) Root Certificates from Microsoft here:  http://www.microsoft.com/en-us/download/details.aspx?id=35945


So far no more 8321 errors, if they do come back I'll let you know!

Happy 2013!


Updated 5/6/2013...well, turns out it was the first trick that solved this.  My company uses a proxy server to connect out to the Internet, but it's set up with a configuration script.  So...the fix is:

1) Regedit
2) In HKEY_USERS, for each SID based ID (not with _Classes) drill in to:

\Software\Microsoft\Windows\CurrentVersion\Internet Settings

3) Create two keys:

AutoConfigURL, string, set the value to your config script URL
ProxyEnable, DWORD, set to 0

Reboot for good measure.  This did work for me, no more of those pesky errors.

Update 1/21/14:
Found this Support article describing a fix which adds the SharePoint certificate to the trusted certificates store on the server:  http://support.microsoft.com/kb/2625048