none
The workflow instance has been canceled. Cannot find ActivityLog.xml

    Question

  • We are using TFS 2012 Update 1 running on Windows Server 2012 and our builds randomly fail with the following error message:

     The workflow instance has been canceled. (Reason: Could not find a part of the path 'C:\Users\tfsservice\AppData\Local\Temp\BuildController\8\Logs\44431\ActivityLog.xml'.)
     An error occurred while copying diagnostic activity logs to the drop location. Details: Could not find file 'C:\Users\tfsservice\AppData\Local\Temp\BuildController\8\Logs\44431\ActivityLog.xml'.

    Typically if we just launch the build again then it will pass on the 2nd attempt.

    Looking through the build log I can see that it makes it almost all the way to the end of the build process before throwing this error; it occurs at the end of the "Run On Agent" AgentScope, and the only activity after it is to Check In Gated Changes.

    I've looked through the Application events in the Events Viewer on the Build Controller, but no warnings or errors were thrown during the build; just Information events.

    Any ideas what may be causing this or how to resolve it?  Thanks in advance.


    - Dan - "Can't never could do anything"

    Tuesday, July 23, 2013 8:41 PM

Answers

  • Ok, I figured out the problem and it wasn't anything that Microsoft was doing.  It turns out that our network team had setup a scheduled job to run every night at 8pm to cleanup old builds.  There was a problem with their script and it was inadvertently deleting the ActivityLog.xml.  So any builds that were still running when 8pm came around would have that file deleted on them.  Many of our builds take 3 or more hours to run, so when we would launch a build at the end of the day it would still be running at 8pm and would end up canceled.  This explains why launching a subsequent build later that night would pass.

    Sorry for wasting your time when this was caused by our own internal processes.  Hopefully somebody else finds this useful though in case they ever accidentally do the same thing.


    - Dan - "Can't never could do anything"

    • Marked as answer by deadlydog Wednesday, October 16, 2013 9:12 PM
    Wednesday, October 16, 2013 9:12 PM

All replies

  • Hi Dan,

    Thanks for your post.

    Which account is your TFS Build Service account?

    This issue happened in one specific build definition or happened in all build definitions randomly? 

    When this issue happened, please manually check that ActivityLog.xml in that path on your build agent machine, ensure it existed there.

    As you’re using TFS 2012 Update 1, please install the Hotfix for your TFS.

    And as the TFS 2012 Update 3 released, we suggest you upgrade your TFS to TFS 2012 Update 3.

    If you have any further research of this issue, please share your experience here.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 24, 2013 8:34 AM
    Moderator
  • Hi John, our TFS Builds run as the 'tfsservice' user.  Also, we only have one build definition that we use for all of our builds.  When I look for that file in the specified path I can confirm that it indeed is not there, which is what I expected since it is in a Temp folder.  I'm assuming the ActivityLog.xml normally gets deleted at the end of a build though, so maybe it's just getting cleaned up too soon for some reason?

    One thing I have noticed though is that it only seems to happen on builds that "Associate Changesets and Work Items".  When this problem does occur it seems to happen on the build that tags all of the work items; then we relaunch the build, and because the work items were already tagged they do not get tagged again, and the build passes the second time around.  So I'm not certain if the work item tagging is related, but it's something that seems to coincide.

    We don't currently have the resources to setup TFS in our lab environment to update it to Update 3 to make sure that the update doesn't break any of our customizations, but I'll see if we can get the Hotfix applied sooner than later and see if that helps.  Thanks for the link :)

    I'll keep you posted with anything else that I find.  Thanks.


    - Dan - "Can't never could do anything"

    Wednesday, July 24, 2013 5:51 PM
  • Hi Dan, 

    What about the progress for this issue? If this issue has been resolved, please share your experience here.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 30, 2013 2:14 PM
    Moderator
  • Hi John, we are still experiencing the issue.  I was able to reproduce the issue when running the build in Diagnostic mode and can confirm that it happens after all of the build activities have completed (including the gated checkin activity, since we don't use them so it gets skipped).  So according to the diagnostic logs it actually does get to the very end of the build process before throwing this error and cancelling the build.

    We aren't able to update to TFS Update 3 yet, but we did just install the Hotfix you recommended last night, so I'll let you know if it continues to happen or not.

    Thanks.


    - Dan - "Can't never could do anything"

    Tuesday, August 06, 2013 5:10 PM
  • We updated to TFS 2012 Update 3 on the weekend and are still experiencing this problem :(  As the problem does not happen EVERY time, but fairly often, I'll try and get a Diagnostic build log for you to inspect to see what is happening.

    What I can tell you is that when viewing the "logs" folder in the build drops for the canceled build, it does not contain the "ActivityLog.xml" and "ActivityLog.xsl" files that are present when the build succeeds; it still contains all of the other log files though (ActivityLog.AgentScope.XX.xml, a log file for each solution built, and logs for each of the database deployments).

    Any other suggestions?  Or is there any other information I can give you?

    Thanks


    - Dan - "Can't never could do anything"

    Wednesday, September 11, 2013 4:00 PM
  • In the meantime until I can get a diagnostic build log for you, here is our build template if you want to inspect it.  I'll warn you though, it's highly customized and very large.  I'm guessing one of the biggest ones you've seen.

    - Dan - "Can't never could do anything"

    Wednesday, September 11, 2013 9:35 PM
  • Ok, I figured out the problem and it wasn't anything that Microsoft was doing.  It turns out that our network team had setup a scheduled job to run every night at 8pm to cleanup old builds.  There was a problem with their script and it was inadvertently deleting the ActivityLog.xml.  So any builds that were still running when 8pm came around would have that file deleted on them.  Many of our builds take 3 or more hours to run, so when we would launch a build at the end of the day it would still be running at 8pm and would end up canceled.  This explains why launching a subsequent build later that night would pass.

    Sorry for wasting your time when this was caused by our own internal processes.  Hopefully somebody else finds this useful though in case they ever accidentally do the same thing.


    - Dan - "Can't never could do anything"

    • Marked as answer by deadlydog Wednesday, October 16, 2013 9:12 PM
    Wednesday, October 16, 2013 9:12 PM