How to fix “TF400898: An Internal Error Occurred.” on your Kanban board in TFS 2012 Update 2

How to fix “TF400898: An Internal Error Occurred.” on your Kanban board in TFS 2012 Update 2

Rate This
  • Comments 8

Kanban customizable columns was made publicly available in VS Update 2. You can read the release notes for an overview of the feature itself, and you can read an in-depth article to understand what happens under the hood.

If you have an on premises installation of TFS, you might see the following error on the Kanban board

 

The goal of this blog post is to get this error resolved.

Why is this happening?

In the in-depth article you can read that the work items on the board have states and the board columns. When you visit the board for the first time there are no board settings yet and it provisions itself to create the initial board settings. During the provisioning the board is creating a column for all the states that are mapped in the common configuration.

Imagine that you have the following common configuration

<RequirementWorkItems category="Microsoft.RequirementCategory" plural="Stories">
    <States>
      <State value="New" type="Proposed" />
      <State value="Active" type="InProgress" />
      <State value="Resolved" type="InProgress" />
      <State value="Closed" type="Complete" />
    </States>
  </RequirementWorkItems>

It will create the following board by using the following rules

  • Incoming column: first state in the Proposed or InProgress ‘metastate’.
  • Outgoing column: last state in the Complete ‘metastate’
  • In Progress: all other states

 

 

When displaying the board we run two queries, a query to get all Proposed and InProgress items and the other one for the Complete items. And this is were the bug is: it makes the (wrong) assumption that all the items returned by the Complete query are in the Outgoing (the green) column.

How to fix it?

Fortunately the bug is only in the provisioning logic. The steps that are described in the post are temporary changes to provision the board successfully and they will not cause any data loss. Once the board is provisioned, you can undo the temporary changes.

The two scenarios how you can get work items in a ‘Complete’ state which is not the Outgoing column are:

  1. Have multiple states mapped to the Complete metastate
  2. Have multiple work item types in the Requirement category, and these work item types do not share the last Complete state

Follow these steps to resolve the issue (replace the bold snippets with your own values) :

  1. Open the Developer Command Prompt for VS2012
  2. Export the categories

    witadmin exportcategories /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\categories.xml
  3. Open in notepad

    %windir%\system32\notepad %temp%\categories.xml
  4. Locate the snippet: <CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">. It should look something like the following

      <CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">
        <DEFAULTWORKITEMTYPE name="Product Backlog Item" />
        <WORKITEMTYPE name="Bug" />
      </CATEGORY>
  5. Remove all work items types except the DEFAULTWORKITEMTYPE by commenting them out (so you can undo the changes), which would result in my example in

      <CATEGORY refname="Microsoft.RequirementCategory" name="Requirement Category">
        <DEFAULTWORKITEMTYPE name="Product Backlog Item" />
    <!--    <WORKITEMTYPE name="Bug" /> -->
  6.   </CATEGORY>
  7. Save the changes
  8. Import the categories

    witadmin importcategories /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\categories.xml
  9. Export the common configuration

    witadmin exportcommonprocessconfig /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\commonconfig.xml
  10. Open in notepad

    %windir%\system32\notepad %temp%\commonconfig.xml
  11. Locate the snippet: <RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">. It should look something like the following

    <RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">
      <States>
        <State type="Proposed" value="New" />
        <State type="InProgress" value="Committed" />
        <State type="Complete" value="Approved" />
        <State type="Complete" value="Done" />
      </States>
    </RequirementWorkItems>
  12. Now update the mapping, so only the last state (based on the order you had defined in the States section of the RequirementsWorkItems) is mapped to Complete, and the work item type that was left in the Requirement category contains that state, which would result in my example in 

    <RequirementWorkItems category="Microsoft.RequirementCategory" plural="Backlog items">
      <States>
        <State type="Proposed" value="New" />
        <State type="InProgress" value="Committed" /> 
        <State type="InProgress" value="Approved" />
       
    <State type="Complete" value="Done" />
      </States>
    </RequirementWorkItems>
  13. Save the changes
  14. Import the updated common configuration

    witadmin importcommonprocessconfig /collection:http://myTfsServer:8080/tfs/DefaultCollection /p:MyTeamProjectName /f:%temp%\commonconfig.xml
  15. Now visit your board to start the provisioning. Wait until the board shows up.
  16. You can now undo the changes in the categories and the common configuration by using the same steps
  17. When you now visit your board, you might get an error, but that’s expected and let you correct the column mappings to a valid state.  

Note: we have seen one case where the customer got the exception after undoing the changes. If it happens to you, you want to follow these additional steps:

  1. Follow again the steps 1 to 14 from above
  2. Go to the board
  3. Click on the Customize Columns, which will bring up a dialog
  4. Rename all column names (by adding a ‘1’ for example to the name)
  5. Click OK to accept the changes and close the dialog
  6. Undo the changes to the Requirement category and the common configuration
  7. Go to the board

 

If you still have problems, please leave a comment and we will reach out to you.

Leave a Comment
  • Please add 6 and 6 and type the answer here:
  • Post
  • After following these steps we still get this error. The error occurs after commenting the lines and importing and returning to the board, and also after undoing the changes and importing and visiting the board.

    Are there any other steps involved in re-provisioning the board (step 15). I simply visited the board in the browser and pressed refresh?

    Background info:

    We have an additional state of type "Complete" called "Complete". This has also disappeared from the TASK board. But the task board doesn't give the error the column is simply missing.

    The backlog board error text is:

    TF400898: An Internal Error Occurred.

    Error: TF400898: An Internal Error Occurred.

       at Function.Error.create (http://********:8080/tfs/_static/3rdParty/_scripts/MicrosoftAjax-4.0.0.0.js:5:2736)

       at Function.Error.serverError (http://********:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.min.js?__loc=en:4:377)

       at http://********:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en:4:2406

       at m (http://********:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en:4:1703)

       at Object.error (http://********:8080/tfs/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en:4:2083)

       at Object.c.resolveWith [as rejectWith] (http://********:8080/tfs/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:28:8797)

       at p (http://********:8080/tfs/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:35:36195)

       at XMLHttpRequest.e (http://********p:8080/tfs/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:35:42692)

  • We also still have a problem after going through the above steps. Note that we already have only one work item type listed in the RequirementCategory, so I didn't make any changes for step 5, though did import the categories configuration anyway.

    Below is the error (truncated to fit in this post) logged in the Application event log on the TFS server, when attempting to view the Kanban board:

    Exception Message: The given key was not present in the dictionary. (type KeyNotFoundException)

    Exception Stack Trace:    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.Models.WorkItemSource.<>c__DisplayClassa.<GetCompleteWorkItemData>b__6(IDataRecord dataRecord)

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.Utility.WorkItemServiceUtils.<GetWorkItems>d__c.MoveNext()

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.Models.WorkItemSource.GetCompleteWorkItemData(ICollection`1 rowData, ICollection`1 hierarchy, ISet`1 parentIds)

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.Models.WorkItemSource.GetPayload()

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.JsonExtensions.ToJson(WorkItemSource itemSource)

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.JsonExtensions.ToJson(BoardConfiguration config, TeamFoundationRequestContext requestContext, IAgileSettings agileSettings)

      at Microsoft.TeamFoundation.Server.WebAccess.Agile.ApiBacklogController.GetBoard()

    Below is the error we get in the UI when attempting to view the Kanban board:

    TF400898: An Internal Error Occurred.

    Error: TF400898: An Internal Error Occurred.

       at Function.Error.create (http://tfs:8080/_static/3rdParty/_scripts/MicrosoftAjax-4.0.0.0.js:5:2736)

       at Function.Error.serverError (http://tfs:8080/_static/tfs/11/_scripts/TFS/TFS.min.js?__loc=en-US:4:377)

       at http://tfs:8080/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en-US:4:2406

       at m (http://tfs:8080/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en-US:4:1703)

       at Object.error (http://tfs:8080/_static/tfs/11/_scripts/TFS/TFS.Core.Ajax.min.js?__loc=en-US:4:2083)

       at Object.c.resolveWith [as rejectWith] (http://tfs:8080/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:28:8797)

       at p (http://tfs:8080/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:35:36195)

       at XMLHttpRequest.e (http://tfs:8080/_static/3rdParty/_scripts/jquery-1.6.2a.min.js:35:42692)

  • @Kevin and @Pete: sorry for this. We would like to investigate your situations further. Could you please reach out to me at ewald-dot-hofman-at-microsoft-dot-com

  • After following these steps I am still having an issue.  I did customize my task board previously to allow for bug work items and resolved tasks to appear on the current sprint board.  This was working well until I added a new iteration.  I did follow all the steps mentioned in this article and reverted my changes to the board but still get this error which is preventing my new iterations to appear and be applied to work items.

    Please advise.  Thank you.

  • @Angela, this blog post is talking about the Kanban board. That is the board view of you backlog. You are discussing the task board, which is a different board.

    Could you send me more details about your configuration and the errors you are seeing?

    You can send it to ewald dot hofman at microsoft dot com

  • after show the Kanbad board ,i can not undoing what my changing. i followed your steps , rename columns , then follow step1 to 14 again . i cant  have multiple complete state.

    this is my orginal state

         <State type="Proposed" value="New" />

         <State type="Proposed" value="Deferred" />

         <State type="Proposed" value="Approved" />

         <State type="InProgress" value="Committed" />

         <State type="InProgress" value="Waiting on Bug Fixes" />

         <State type="InProgress" value="In Progress" />

         <State type="Complete" value="Dev Complete" />

         <State type="Complete" value="UAT Deploy" />

         <State type="Complete" value="UAT Testing" />

         <State type="Complete" value="Done" />

         <State type="Complete" value="QA Testing" />

    then i changed the states like this

         <State type="Proposed" value="New" />

         <State type="Proposed" value="Deferred" />

         <State type="Proposed" value="Approved" />

         <State type="InProgress" value="Committed" />

         <State type="InProgress" value="Waiting on Bug Fixes" />

         <State type="InProgress" value="In Progress" />

         <State type="InProgress" value="Dev Complete" />

         <State type="InProgress" value="UAT Deploy" />

         <State type="InProgress" value="UAT Testing" />

         <State type="InProgress" value="Done" />

         <State type="Complete" value="QA Testing" />

    after show the board . i try to set states back , but still show the same error .

    and i tried to move the "QA Testing" sequence ,it should follow "Dev Complete",show the same error .

  • @butterfly626385: I would like to understand your situation better. Could you contact me directly so we can work with you to get it fixed (ewald dot hofman at microsoft dot com)

  • Guys, we had an issue after following all those steps, but found a solution, which I described here:

    il-adan.blogspot.no/.../backlog-board-tf400898-internal-error.html

    Hope it will help you.

Page 1 of 1 (8 items)