But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

TFS 2010 RC –> RTM upgrade problem with the warehouse

I recently did an in-place upgrade of a TFS 2010 RC  to RTM box. All appeared to be going fine, all the verification in the upgrade wizard passed, but when I hit configure the first step failed. It said there was a missing  dbo.sysobjects in the warehouse DB. I then had to resort the configuration DB as it was partly upgraded to try again as the DB was left partially upgraded.

I got round this problem by telling the upgrade to ignore the reporting side of TFS. The upgrade completed without issue. I was then able to re-add the reporting via the TFS administration console (optional configuration of features in 2010 is really useful!). I actually chose to recreate the warehouse DBs anew to make sure I was bringing over no corruption. Once TFS had rebuild all the DBs and cubes all was working fine.

So the technical tip: if upgrading TFS 2010 and you are getting a problem with the reporting sub system, consider bypassing the upgraded and just rebuilding that system when you are finished

[Update 19th May 2010] 

Saw the problem again today on another site going a RC->RTM upgrade. the exact error message you get is

Exception Message: TF255356: The following error occurred when configuring the Team Foundation databases: Error occurred while executing servicing step Upgrade Warehouse for component Tfs2010WarehouseBeta2ToRTM during Tfs2010Beta2ToRTM: Errors in the metadata manager. The dimension with the name of 'Work Item Tree' already exists in the 'Tfs_Analysis' database.

TF246064 upgrading TFS 2010RC to RTM

I have a basic installation of TFS 2010 running on my Windows 7 laptop. This is really useful for testing build customisation and the like, a great new feature for 2010. Today I got around to trying to upgrade it from RC to RTM, but on the verification test I got the error

[ Configuration Database ] TF255407: An error occurred while attempting to validate the configuration database. Error message: TF246064: No database could be found for the following host: TestCollection. The host has the following ID: eaf3c572-8657-4268-9852-3d73a799cdf5. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.

Turns out I had been a bit stupid. I had created a couple of test team project collections (TPC) whilst testing some attach/detach scenarios for a client. I deleted the underlying SQL DBs, but not deleted the TCP in TFS, I guess as part of some test, but for the life of me I cannot remember why.

So as the error message suggested I tried to run the TFSConfig command

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig remapdbs /sqlinstances:Typhoon\sqlexpress /databaseName:typhoon\sqlexpress;TFs_configuration
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_CFG_AT_0504_090019.log
Command: remapDBs
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
The Team Foundation Server configuration could not be reconfigured. The following errors were encountered:

TF246064: No database could be found for the following host: test1. The host has the following ID: 4e9b737a-b666-48f4-9411-20249aed7ae0. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.
TF246064: No database could be found for the following host: TestCollection. The host has the following ID: eaf3c572-8657-4268-9852-3d73a799cdf5. To fix this problem, use the TFSConfig RemapDBs command-line tool and make sure that you specify the SQL Server instance that contains this database.

So the same error as the upgrade wizard. I also tried detaching and deleting the TCP, but got:

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig collection /delete /collectionName:TestCollection
Logging sent to file C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_TPC_AT_0504_090828.log
Command: collection
TfsConfig - Team Foundation Server Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.
Could not find file 'C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\web.config'.

But this failed as I had already removed the 2010RC instance, so there was no web.config to read.

So what to do?

I opened SQL Management Studio and connected to my local SQL instance, open the Tfs_Configuration DB and found the tbl_ServiceHost table. I then removed the rows that referenced the TPC that had I deleted the DB for. Of course I had made sure I had a backup of the DB before I started.

Once this was done the upgrade wizard passed verification and completed without error.

Now I would not recommend this as a good way to work, but it did get me out of a hole. In my case it was only a test system so if I lost it, it was not that important. However it is good to know there is a reasonably simple solution address problems with missing TPC DBs

Technical Tip: Make sure all your TPCs are valid before you start the upgrade process, so you don’t see this issue in the first place!

Speaking at Developer Day South West

I have just heard I will be speaking at Developer Day South West on June the 5th. My subject is Using the new Developer and Test features of VS 2010 to track down and fix bugs, this is basically the same session as I have at our TechDays fringe event yesterday.

Hope to see you there

DDDSouthWest2BadgeSmall[1]

Useful tool to move Reporting Services reports between servers

When you are moving TFS contents around between servers, as many people will be doing as they implement new 2010 servers and want to make use of Team Project Collections; you often have to move Reporting Services reports. In many cases you find people have lost their customised .RDL files they uploaded in the first place, and don’t want to restore the whole Reporting Services DB.

So how to extract an RDL file from a Reporting Services instance and moving it to a new Reporting Services instance?

Well have a look at Reporting Services Scripter, make makes the process fairly straight forward.

Down in London for TechDays

I am down in London for the first two days of the Microsoft TechDays event. First day has been very interesting, there seems to be a good buzz over the new testing features. So it looks good for my session tomorrow when I will be presenting on Lab Manager hope to see you there.

Error running Ivonna tests with ASP.NET 4

When I tried to run a working Ivonna test, previously targeted at .NET 3.5, against .NET 4 I found my test failing with the error

------ Test started: Assembly: Webpart.Tests.dll ------
<html><body>Bad Request</body></html>
Setup information
Physical Web path: C:\Projects\Test\TypeMockSample\TestWebSite
Actual path: C:\Users\fez\AppData\Local\Temp\Temporary ASP.NET Files\root\156567f2

Turns out that the fix to simple, you have to use an absolute path i.e. the / in front of the BasicTest.aspx is vital

 

[TestMethod, Isolated]
        public void LoadWebPage_HelloWorldWebPart_NoError()
        {
            TestSession session = new TestSession(); //Start each test with this
            WebRequest request = new WebRequest("/BasicTest.aspx"); //Create a WebRequest object
            WebResponse response = session.ProcessRequest(request); //Process the request
            System.Web.UI.Page page = response.Page;
            //Check the page loaded
            Assert.IsNotNull(page);
        }

So this is a temporary work around for now, for me it is not an issue having to use a absolute path. I understand from the writer of Ivonna that this issue will be further investigated now that .NET 4.0 has RTM’d

Experiences upgrading to Lab Manager 2010 RC

Whilst preparing for my session at Techdays I have upgraded my 2010 Beta2 Lab Manager to RC. I am pleased to say the process is far more straight forward than the initial install. Again I used the Lab Manager team blog as my guide, they have revised ‘Getting started with Lab Management 2010 RC’ Parts 1, 2 ,3 and 4 posts to help.

I was able to skip through the initial OS/VMM setup as this has not altered. I chose to throw away my TestVM (with its Beta agents) and create a new one. I upgraded my TFS 2010 instance to RC. The only awkward bit was that I had to extract the RC version of the Lab Build Template from a newly created RC Team Project Collection and load it over my existing Beta2 version. I then recreated the Lab E2E build – and it just worked. My basic sample created for Beta2 build and tested OK.

I got confident then and so decided to build my own application with Coded UI tests, and surprise, surprise it work. OK this was after some reconfiguring of the Test VM to allow UI interactive testing, and a few dead ends, but basically the underlying system worked and I think I now have a working understanding of it.

The whole process is just much slicker than it was, and the online MSDN documentation is much more useful too. This is certainly becoming as more accessible product, but you still do need a good mixture of ITPro and Developer skills that I bet many teams are going to struggle to find in a single person. The best thing I can recommend is build your own system step by step (following the blog posts) so you know how all the moving parts interact. Once you do this you will find it is less daunting.