Release Stuck in Pending State

Recently, I have come across an interesting behavior in TFS Release Management. When you kick off new release, the release gets stuck in Pending state on certain custom components. And, it stays in that state "forever". Obviously, the first thing that comes to mind is that deployment agent is not responding (even though it does not really make sense since if the agent became unresponsive the component deployment task would time out eventually), but you go ahead and try to restart the deployment service running on the target server anyways. It does not help, of course. So, you start taking other "desperate" measures like re-configuring deployment agent or restarting the target server, but nothing works. I'm calling those measures "desperate" because, deep down in your heart, you know that there is nothing wrong with the target server and that the problem lies somewhere else. You just don't know where, so you resort to the old "Have you tried turning it off and on" approach. We all do it...

Anyways, after a bunch of digging around, I have finally discovered a pattern when this problem occurs. Imagine the following scenario:

  1. You create a custom component and add it to your release template
  2. You kick off your release template
  3. You then realize that you need to tweak your custom component, so you go ahead and tweak your custom component, then kick off your release template again with your recent changes to the component.

This is a very typical continuous improvement approach. You make a change to your custom component, save it and the next time release has been triggered your changes to component will take effect. It works every time in Release Management. Well, almost every time. Apparently, if you change one of the configuration variables in your components from Standard type to Encrypted type (and vice versa), save your component and trigger release, then the release will get stuck in Pending state on that component. Not sure why this is happening. Perhaps, the hash of the component changes or something. Anyways, to fix the issue, you need to:

  1. Remove the component in question completely from your release template, including a link to the component. Then, save the release template
  2. Reopen release template and re-link the component in question
  3. Re-add the component in question, and re-enter the values for your configuration variables.
  4. Save the release template
  5. Trigger a new release. Release should now successfully deploy the component in question

To me, this looks like a bug to me and, hopefully, Microsoft will address this in the next update(s) of the Release Management Server. I am sure they will.

P.S.: This is my first blog post as a Microsoft MVP in Visual Studio ALM. Looking forward to writing a lot more… Hurray!!!