locked
Error Publishing Test Result RRS feed

  • Question

  • Hello,

    I have Team Build installed and the builds are working fine.  However, when ever we try to publish a test result to the build we always get the following error:

    Status: Failed
    Error Message: Publish operation failed.

    What does that mean?  How can I fix it?  I can't seem to locate any logs or items in the event log.

    Thanks,
    Cindy
    Tuesday, October 25, 2005 5:18 PM

Answers

  • The root cause of the failure you were seeing is the fact that the build service and application tier accounts are different. This is a known issue that will be fixed for RTM.

    The failure occurs when we try to set the permissions on the test results directory back to read-only. This fails unless the build directory was created using the application tier account. Making the application tier account an administrator or using the same account as the build service should resolve the problem.

    Cheers,
    Tom

    Monday, October 31, 2005 9:40 PM

All replies

  • http://blogs.msdn.com/nagarajp/archive/2005/10/19/482885.aspx should be a good article to start with. If your still getting the error after checking those items, follow up here and we'll try some other things.
    Tuesday, October 25, 2005 5:46 PM
  • Hello,

    That is a great article.  However, I have gone to the extreme and given everyone full control over the share, and the file system.  I'm not sure if I can open up the permissions anymore!

    At first I was getting access permission denied.  But when I opened up the permissions I started getting a generic "Publish operaion failed" with no other information.

    Thanks again for your help!
    Tuesday, October 25, 2005 7:12 PM
  • If it helps, when I try to publish that same result set after the "Publish operation failed" message, I get the following error:

    Status: Failed
    Error Message: The specified test run has already been published.

    Tuesday, October 25, 2005 7:29 PM
  • One more tidbit.  I tried another build type that runs the tests as part of the build, instead of trying to publish the results against a build after the build is completed.  The BuildLog.txt file also contained the same error, but maybe the web service that it has listed might provider some clues?

    Publishing results of test run teambuilderaccount@buildmachinename 2005-10-25 15:55:03_Any CPU_Release to http://teamfoundationserver:8080/Build/v1.0/PublishTestResultsBuildService.asmx...
    Publish operation failed.

    Interestingly enough a few lines up it says that the test run was completed and successful.
    Test Run Completed.
    Passed  2
    ---------
    Total   2

    The build machine and the team foundation server are different machines.
    Tuesday, October 25, 2005 8:03 PM
  • Are the big build service and the application tier running under the same account?
    Tuesday, October 25, 2005 9:56 PM
  • Could you also let us know if code coverage has been enabled on the tests whose results you are trying to publish?
    Wednesday, October 26, 2005 6:24 AM
  • Hello,

    Code coverage is not enabled.  And the build service and application tier are running with two separate accounts.

    Thanks!
    Cindy
    Wednesday, October 26, 2005 11:29 AM
  • Have some more information.  I enabled tracing in the web.config on the application server and tried another publish.  Got the "Publish operation failed" in the VS IDE.  However, the resulting log has the following information (to paraphrase the log):

    • GetProjectUriFromBuildId [1 row returned].  Found the project URI
    • Looking for the run id (select RunId from dbo.TestRun where RunId = @runId).  [0 rows returned] is this the problem area?   What is weird is that a few lines down in the log, it states that it is publishing a run and lists a value (Publishing run ... to build ... with results file ....trx).  So did it find the run id or not?
    • Looking for the DropLocation.  [1 row returned] Found.
    • Some items about initializing the web service, located the connection string.
    • Retrieves the TeamProject from dbo.Builds using the buildId found earlier [1 row returned] Found.

    Now this is where it fails.
    [TB] [I, 11708, 5, 2005/10/27 10:43:28.754 4268390413997] w3wp.exe: SQL: select DropLocation from dbo.Builds where BuildUri = @buildUri

    [TB] [I, 11708, 5, 2005/10/27 10:43:28.754 4268390418938] w3wp.exe: SQL: 1 rows returned

    [TB] [V, 11708, 5, 2005/10/27 10:43:28.832 4268390731380] w3wp.exe:
    PublishRun: Failed to publish the run. Attempting to clean up.


    Why did the run fail to publish?  What can I do to get it to publish?

    It would seem that the clean up operation fails with the following error.  Which would make sense out of why the system tells me that the results are already published when I try to publish the same result set again after a failed attempt.


    [TB] [E, 11708, 5, 2005/10/27 10:43:28.926 4268391018150] w3wp.exe: Remove Run Data: Exception: Microsoft.VisualStudio.TestTools.Common.Warehouse.RunDoesNotExistException: Run is not in the Publish database.
       at Microsoft.VisualStudio.TestTools.TeamSystem.Server.SqlAccess.RemoveRunData(Guid runId)

    [TB] [W, 11708, 5, 2005/10/27 10:43:28.926 4268391032939] w3wp.exe: Caught exception removing run data. There is already an open DataReader associated with this Command which must be closed first.

    Thanks again for your help.

    Thursday, October 27, 2005 3:01 PM
  • Ok, got something.  I added the user that the application tier is running as to the local Administrators group, and the test result publish succeeded.  Woohooo!

    Not sure what permission it needs that it didn't previously have.  I gave that account full control over the drop directory (file system and share permissions).

    But at least I have established that it is a permissions issue.  If I figure out what permission it needs that I was missing, I'll post.  If anybody has any ideas, I'm open to suggestions.

    Thank you!
    Cindy
    Thursday, October 27, 2005 4:06 PM
  • Hi Cindy - We had a similar symptom bug due to an SQL timeout issue some time back. Would you please tell me one last thing? When you open the build report after the failed publish, does it show up the test run data after a refresh?

    Thanks,
    Anu
    Thursday, October 27, 2005 4:06 PM
  • Hi Anu,

    I'm not sure what you mean.  Does what show up on the test run data after a refresh?  What should I refresh?

    Thanks,
    Cindy
    Friday, October 28, 2005 12:55 PM
  • The root cause of the failure you were seeing is the fact that the build service and application tier accounts are different. This is a known issue that will be fixed for RTM.

    The failure occurs when we try to set the permissions on the test results directory back to read-only. This fails unless the build directory was created using the application tier account. Making the application tier account an administrator or using the same account as the build service should resolve the problem.

    Cheers,
    Tom

    Monday, October 31, 2005 9:40 PM
  • Thanks for the update Tom!
    Tuesday, November 1, 2005 1:11 PM
  • What is application tier account?
    Friday, January 13, 2006 3:23 PM
  • The application tier account to which I referred is the account used to run the web services and the Coverage Analysis service. The account can be seen in inetmgr under the Identity tab for the Team Foundation application pool.
    Thursday, January 19, 2006 7:29 PM