|
Hi,
on our server occured a NullReferenceException during calculation of code churn (see below). The file processed shouldn't be part of the calculation anyway, because it's a database script. So it seems like two bugs here.
The file itself(PBP_GESELLSCHAFTSANTEIL.pkg) is an 10KB ASCII File with Windows-1252 encoding which looks quite ok?? Beside form this issue everything seems fine on TFS side.
What can we do here?
Thanks for any help,
Markus
The Bugtrace:
Warehouse Category: None Type: Error Event ID: 3000 Description: TF53010: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff. Technical Information (for the administrative staff): Date (UTC): 8/24/2006 1:22:32 PM Machine: MUCS030470 Application Domain: /LM/W3SVC/3/Root/Warehouse-3-128008848405824133 Assembly: Microsoft.TeamFoundation.Warehouse, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, v2.0.50727 Process Details: Process Name: w3wp Process Id: 588 Thread Id: 5076 Account name: DEV\Ser-DEV-TFSService Detailed Message: Microsoft.TeamFoundation.VersionControl.Adapter: An unexpected exception occured while calculating code churn: Calculating differences. Previous: changeset 50, item $/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg, encoding 1252. Current: changeset 194, item $/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg, encoding 1252. , exception: Exception Message: Object reference not set to an instance of an object. (type NullReferenceException) Exception Stack Trace: at Microsoft.TeamFoundation.VersionControl.Common.Sbcs.CompareTokens(Token t1, Token t2, Boolean ignoreHash, DiffOptions options, Byte[] buffer1, Byte[] buffer2) at Microsoft.TeamFoundation.VersionControl.Common.LcsDiff.ApplyTwoPhaseForwardBias(DynamicTokenArray daParagraphX, DynamicTokenArray daParagraphY, DiffSegment dh, DiffSegment currentParagraph, DiffSegment backDiffBoundLine, DynamicTokenArray daX, DynamicTokenArray daY) at Microsoft.TeamFoundation.VersionControl.Common.LcsDiff.Diff(DiffSegmentOutputTypes types, DiffOptions options) at Microsoft.TeamFoundation.VersionControl.Adapter.Hatteras.Diff(String previousName, Int32 previousEncoding, String currentName, Int32 currentEncoding) at Microsoft.TeamFoundation.VersionControl.Adapter.Hatteras.calculateDifferences(Item previous, Item current) ; EventID: 0x00000BB8 (3000) - TF53010: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff. Technical Information (for the administrative staff): Date (UTC): 8/24/2006 1:22:32 PM Machine: MUCS030470 Application Domain: /LM/W3SVC/3/Root/Warehouse-3-128008848405824133 Assembly: Microsoft.TeamFoundation.Warehouse, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, v2.0.50727 Process Details: Process Name: w3wp Process Id: 588 Thread Id: 5076 Account name: DEV\Ser-DEV-TFSService Detailed Message: Microsoft.TeamFoundation.VersionControl.Adapter: An unexpected exception occured while calculating code churn: Calculating differences. Previous: changeset 50, item $/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg, encoding 1252. Current: changeset 194, item $/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg, encoding 1252. , exception: Exception Message: Object reference not set to an instance of an object. (type NullReferenceException) Exception Stack Trace: at Microsoft.TeamFoundation.VersionControl.Common.Sbcs.CompareTokens(Token t1, Token t2, Boolean ignoreHash, DiffOptions options, Byte[] buffer1, Byte[] buffer2) at Microsoft.TeamFoundation.VersionControl.Common.LcsDiff.ApplyTwoPhaseForwardBias(DynamicTokenArray daParagraphX, DynamicTokenArray daParagraphY, DiffSegment dh, DiffSegment currentParagraph, DiffSegment backDiffBoundLine, DynamicTokenArray daX, DynamicTokenArray daY) at Microsoft.TeamFoundation.VersionControl.Common.LcsDiff.Diff(DiffSegmentOutputTypes types, DiffOptions options) at Microsoft.TeamFoundation.VersionControl.Adapter.Hatteras.Diff(String previousName, Int32 previousEncoding, String currentName, Int32 currentEncoding) at Microsoft.TeamFoundation.VersionControl.Adapter.Hatteras.calculateDifferences(Item previous, Item current) | | MarkusSchiller | Hi Markus,
TFS will create the codechurn for every non-binary file, and that's why your .pkg file is also processed. But definitely it looks like a bug in how Version Control calculates the difference. We are investigating that problem. Is it possible for you to send me the previous and current version of that particular source file?
I also assume the source code control part of the warehouse processing is blocked by this problem. (Let me know if that's not the case.) We will try to come up with a workaround so that you can skip this particular file and unblock the rest of the source file processing.
Will keep you updated.
Patrick Ng - Visual Studio Team Foundation Server | | Patrick Ng - MSFT | Hi Markus,
You can add a dummy entry in the Code Churn table for that particular file/changeset. If the adapter is stalling on the fourth item in changeset 50, the the last entry in the code churn table has a tracking ID of ??0;3;0?? You can add a dummy entry with last tracking id of ??0;4;0????then the adapter will think that it already has processed the fourth item in changeset 50 and will proceed to the fifth item.
Here are the steps:
1 - Execute this select statement in TfsWarehouse - this gives you the last entry that the adapter put into the table.
SELECT [__TrackingId]
,[__LastUpdatedTime]
,[__LastUpdatedBy]
,[Changeset]
,[Date]
,[Checked In By]
,[Team Project]
FROM [TfsWarehouse].[dbo].[Code Churn] order by [__LastUpdatedTime] desc
2 - Find the ID of the file in the File table
SELECT [__ID]
FROM [TfsWarehouse].[dbo].[File]
WHERE [File Path] = '$/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg'
3 ??Figure out what the tracking id should be. If the tracking ID from (1) is ??0;3;0??or ??0;3;1?? then the tracking ID you insert should be ??0;4;0??nbsp; However, if the changeset of the last entry and this entry are different, then the tracking id you insert is "51;1;0"
4 - If the changeset of the last entry and this entry are different, then you'll also need to figure out the IDs for Date, Checked in By, Team Project and Changeset. You can do something similar as in (2) to find these. If they're the same, then you can use the entries from (1)
5 - Insert the dummy entry into the Code Churn table - many of these will require the same values as the select statement in (1)
INSERT INTO [TfsWarehouse].[dbo].[Code Churn]
([Lines Added]
,[Lines Modified]
,[Lines Deleted]
,[Net Lines Added]
,[__LastUpdatedTime]
,[__LastUpdatedBy]
,[__TrackingId]
,[Changeset]
,[Filename]
,[Date]
,[Checked In By]
,[Team Project])
VALUES
(0
,0
,0
,0
,<LastUpdatedTime from (1)>
,''
,<TrackingID from (3) >
,<Changeset from (4)>
,<File ID from (2)>
,<Date from (4)>
,<Checked in by from (4)>
,<Team Project from (4)>)
To prevent this file from being processed in the future, you can mark it as binary in the VC system so that code churn will not be calculated for it. You can execute the following and check in:
tf edit ??/Pharmapool_v1/Dev/PhamaPool DB/db_packages/PBP_GESELLSCHAFTSANTEIL.pkg??/type:binary
You??l probably have to repeat the above workaround for when the adapter processes this changeset. After this changeset, this particular file will not be processed anymore.
Please let me know if this works for you.
Mauli | | Mauli Shah - MSFT | Hi Patrick,
the two files are complete identical EXCEPT that the second (newer) version has different line endings. It was changed from 0D 0A (CR LF) to 0A (LF).
How do I notice if the source code control part of the warehouse processing is blocked? What I see is a rapid drop in the code churn after the error (34000 to 900).
Thanks for your help,
Markus | | MarkusSchiller | Hi Markus,
To tell if the the source control part is blocked you can:
1 - look in the event log to see if any errors with source "Tfs Warehouse" and with text: "Microsoft.TeamFoundation.VersionControl.Adapter.VCAdapter"
2 - look at the changeset table in TFSWarehouse, and see what the highest "Changeset ID" is. If this is substantially lower than the current latest changeset number in the VC, then processing has halted for the VC part.
Mauli | | Mauli Shah - MSFT |
|