Timeout and Workflow issues when using the Deployment Manager in Dynamics CRM 4.0

12. January 2009

I've been trying to re-deploy a CRM 4.0 installation from a client's site into our development domain so that I can work with some of the data in the system.  Using the provided CRM 4.0 Deployment Manager is pretty easy (instructions found here), but wasn't working. 

The deployment manager would run for a good 30+ minutes and eventually come back to me with a SQL Server Timeout error.  The details of this error follow:

Import Organization (Name={Name}, Id={ID} failed.

The changes made during Import Organization could not be rolled back. Please manually delete the Organization database from the 'SBCRM01' SQL Server if it was not successfully deleted.

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
… 
   at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)

I Googled, hooked up SQL Server Profiler and searched Microsoft’s knowledge base – desperate for some sort of answer to this problem.  I finally found a forum post online that described a similar scenario being resolved by installing Microsoft Dynamics CRM 4.0 Update Rollup 1

It wasn’t until I looked at the deployment log file that I realized that the timeout expired error was really just a symptom of another problem.  Turns out that below the Timeout exception I found another exception message that describes what’s really going on.

Import Organization (Name={Name}, Id={ID}) failed with Exception:

Microsoft.Crm.CrmException: Unable to find metadata information for attribute {attribute_name}
   at Microsoft.Crm.Workflow.ObjectModel.MetadataProvider.GetAttributeMetadata(EntityMetadata entityMetadata, String attributeName)

   at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)

What the heck is this?  Turns out, the issue is caused by having workflow in CRM that references an attribute that is subsequently deleted.  Per Joel CustomerEffective (forum post), here’s some things you can do to resolve the issue:

1. Recreate the missing attribute (you can delete after import).
2. Delete any rows that reference that attribute from the workflowdependencybase table
3. Import the organization into an environment that is pre-rollup 1
4. Wait for KB958571 to be released--they are testing it now.  If you search for it, you will find the KB article for it, but the hotfix has been redacted pending further testing.

Of course, KB958571 talks about a hotfix that isn’t publically available.  Sad – really sad, but have no fear!  After wasting 6 hours today working on this problem, I’m still waiting on getting an answer from Microsoft about the availability of the patch.  I’ve attempted solution #2 (removing the dependencies from the source database before performing the import) without success.  Options #1 and #3 aren’t available to me at the moment.  If you know of a better solution, please post a comment to this blog!

Development ,

Troubleshooting guide for TFS installation

7. January 2009

Looks like the good folks in Redmond got some time to write up a much-needed troubleshooting guide for TFS server installations.  You can find the guide on MSDN using the following link:

Troubleshooting installation of Team Foundation

The guide goes over how to interpret the installer log files, as well as diagnosis for many common TFS errors.  Here's a list:

  1. Error 32000. The Commandline ‘[1]’ returned non-zero value: [2]
  2. Error 29112. Team Foundation Report Server Configuration: Either SQL Reporting Services is not properly configured, or the Reporting Services Web site could not be reached. Use the Reporting Services Configuration tool to confirm that SQL Reporting Services is configured properly and that the Reporting Service Web site can be reached, and then run the installation again. For more information, see the Team Foundation Installation Guide.
  3. Error 29109. Team Foundation Report Server Configuration: SQL Reporting Services configuration encountered an unknown error. Verify that you have sufficient permissions to configure SQL Reporting Services, and try again.
  4. Error 28806. An unexpected error occurred. Verify that SQL Server Reporting Services is installed and running on the Team Foundation app tier and that you have sufficient privileges to access it. For more information, see the setup log.
  5. Error 29000. An unexpected error occurred. Verify that SQL Server Reporting Services is installed and running on the Team Foundation app tier and that you have sufficient privileges to access it. For more information, see the setup log.
  6. Error 28805. The setup program cannot complete the request to the server that is running SQL Server Reporting Services. Verify that SQL Server Reporting Services is installed and running on the Team Foundation app tier and that you have sufficient permissions to access it. For more information, see the setup log.
  7. There is an error with the collation settings for SQL Server. The collation settings are not compatible with Team Foundation Server.


There are also sections for troubleshooting the installation of Team Build or Team Explorer in Visual Studio, as well as some helpful hints for post-installation pains.  This article has now taken the place of a dozen of my favorites -- thanks Microsoft!

Technorati Tags: ,,

Development , ,

Single server Internet-facing TFS 2008 installation guide

2. October 2008

Last week I completed (after 4 attempts) an Internet-facing TFS 2008 deployment.  All the hard effort was certainly worth it as I'm now using TFS 2008 for some personal projects and I've got a demo server that will allow me to show others the benefits of Microsoft's Team Foundation Server 2008.  Without further delay, let's jump right into the installation!

First, I attempted to install TFS 2008 without reading the installation guide.  I wouldn't recommend anyone do this, so please learn from my mistake.  I built a Windows Server 2008 (64-bit) VM from the ground up, installed SQL Server 2008 and configured IIS 7.  When I went to insert the TFS DVD into the drive and go install, low-and-behold, I learned that the TFS application tier isn't currently supported on 64 bit operating systems.  This was completely my goof, and I've kept the Windows Server installation configured as a sandbox for other test projects.  We'll consider this attempt number 1. 

For attempt #2, I decided to ditch Windows Server 2008 for this install altogether.  Now that I had a 64-bit Windows 2008 sandbox server configured, I didn't have a compelling reason to try Windows Server 2008 for TFS, and apparently it only adds some additional installation steps anyway.  For my second attempt, I decided to clone an existing 32-bit Windows Server 2003 installation that already had IIS 6 configured and simply install SQL Server 2005 and TFS on top. So, I did.  After installing SQL Server 2005 I realized I hadn't changed the SID on the new clone, so I used NewSID to do so.  As it turns out, you don't want to change the SID after installing SQL Server.  I wasn't able to install Service Pack 2, or un-install SQL Server afterwards.  So, I had a brick for an image, let's call this attempt number 2, and start again.

For attempt #3, I changed the SID before the SQL Server 2005 installation and was able to install the service pack.  A little exhausted from all this work, I went on to make some lunch.  In my hate, I hadn't set a "sa" password during my SQL installation, and forgot that this server was exposed to the Internet.  Wouldn't you know in the hour and half break I took, the server had already been compromised and over 6 different worms had been installed.  Pasky little buggers those worms, so I scrapped the image once again and moved on to attempt #4. 

Up until now, all the TFS installation pains I had were really my fault.  I didn't read the install guide, hadn't considered the implications of changing the SID after SQL installation and got careless with security.  Determined to correct these silly user errors, I set out one more time to build my TFS 2008 server image.  This time, I was able to complete the TFS 2008 server installation.  I also installed Team Build.  With security in mind, I created 2 different user accounts (TFSService and TFSReports) responsible for managing the TFS and SSRS services.  Everything was going well until I checked the event log.  Errors and errors were preventing me from successfully creating a Team Project using Team Explorer.  Here's the rundown:

  1. Error messages from ASP.Net about not being able to get the private byte memory limit for the W3WP process.  Turns out this is a result of the cloning process not successfully changing SIDs for all the ASP.Net keys.  Thanks to "Joe unfiltered" and this post for providing a resolution.
  2. "Team Project Creation Failed" error message that appears when trying to create a new Team Project.  This was caused as a result of the improper permissions on the folder:

    %AllUsers%\Application Data\Microsoft\Crypto\RSA\MachineKeys

    This folder (and it's subfolders) must have Full Control for "Everyone".  Thanks to this forum post for identifying the problem/solution.
  3. Still can't create a project?  I couldn't, because I was using a fully qualified domain name (FQDN) as my server from an outside network.  Turns out, everything's coded to the NetBIOS name of the server (how deliciously archaic) and you have to change these values.  Thankfully, this is much easier in TFS 2008 than it was in TFS 2005.  Check out this blog entry By Buck Hodges for the details.

 

After doing these 3 things, I could not connect to my TFS server and create a new project.  Source Control works, WSS works, SSRS works!  Time to install Service Pack 1.  Unfortunately, I had some hang-up's there, too:

  • I got a cryptic error when installing the service pack, "There is a problem with this Windows Installer package.  Please refer to the setup log for more information."  Ever actually read one of those .MSI installer logs?  Turns out, the FQDN issue noted above was causing problems with the installation of TFS, as the TFS setup couldn't use WMI to connect to the server anymore because of it's FQDN.  Time to use the TfsAdminUtil to change the server name to it's NetBIOS name, then do the install, then use the TfsAdminUtil to change it back.  This procedure was sort of indicated in this forum post, which gave me the right inspiration.
  • At this point I now had the SP1 installation complete, but couldn't connect to my TFS server anymore.  If you're getting 403 (Forbidden) errors, read this blog post a solution.

Finally, I had my dazzling TFS server with Service Pack 1 installed (which I promptly took a snapshot of).  Now I was ready to install the awesome TFS Web Access.  This installation went fairly well, with one exception:

  • Turns out, you can't install TFS web access as a virtual directory underneath an existing WSS 3.0 web site.  This limitation stinks, and the installer won't warn you about it either.  Instead, you'll get a crytic SecurityException when you attempt to access the Web Access URL.  This forum post explains it all.  The solution is to uninstall web access, and re-install it under a new IIS website.

And there you have it!  This is a chronicle of my TFS 2008 install experience.  I'm going to be doing a server upgrade from TFS 2005 to TFS 2008 next week, which I imagine will yield more interesting results, so you can expect a follow-on post.  What's most important to say is, despite all these installation headaches, I'm still entirely in love with TFS as a product.

Development , , ,

Enabling Javascript Intellisense for Dynamics CRM 4.0 in Visual Studio 2008

9. September 2008

If you're like me, you're certain that the best new feature (and most anticipated) in VS2008 is Javascript intellisense.  Wish you could get that great feature available to you when working with custom CRM entities?  You can.  Check out the video here.

Technorati Tags: ,

Development ,