Freigeben über


Release Management–Releases failing with Error: (404) Not Found.

Recently one of the customer reported that the releases are failing with following stack trace. Essentially releases were failing while sending email notifications to the release step approvers.

Message: The remote server returned an error: (404) Not Found.: \r\n\r\n

at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at Microsoft.TeamFoundation.Release.Data.WebRequest.PlatformHttpClient.EndGetResponse(IAsyncResult asyncResult)

at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndGetAsyncMemoryStreamFromResponse(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)

at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClientResponseRetriever.EndDownloadString(IAsyncResult asyncResult, IPlatformHttpClient platformHttpClient)

at Microsoft.TeamFoundation.Release.Data.WebRequest.RestClient.EndPost(IAsyncResult asyncResult)

at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.HttpRequestor.<>c__DisplayClass1.<GetPostCaller>b__0(String url, String body)

at Microsoft.TeamFoundation.Release.Data.Proxy.RestProxy.BaseNotificationServiceProxy.SendNotification(Int32 releaseId, String releaseName, String applicationVersionName, String stageTypeName, String environmentName, Int32 releaseStepId, Int32 releaseStepTypeId, Boolean releaseStepIsAutomated)

at Microsoft.TeamFoundation.Release.Workflow.Services.ReleaseWorkflowService.CreateNextReleaseStep(Release release, Stage stage, StageStep stageStep, Int32 releaseStageRank, Int32 trialNumber)

at Microsoft.TeamFoundation.Release.Workflow.Services.ReleaseWorkflowService.Initiate(Release release)

at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.<StartRelease>b__85(Object sender, DoWorkEventArgs args)

at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.PerformActionAndRefresh(DoWorkEventHandler action, Boolean selectViewEditorBasedOnReleaseStatus)

at Microsoft.VisualStudio.Release.ViewModel.ViewModels.ReleaseViewModel.StartRelease()

 

It turned out to be the releases were failing because the release name contained special character ‘#’ due to which POST Call URL was getting truncated after ‘#’ char. By URL specifications, “#” is a reference to the start of the current document. Thus, the character "#" should be excluded in that are passed in the URL because it is used to delimit a URI from a fragment identifier in URI.

 

For Example, let say release name is “My Release #1”. While constructing SendNotification(Email notifications to the step approver) POST Call we expect below URL

POST  https://rmserver:1000/account/releaseManagementService/_apis/releaseManagement/NotificationService/SendNotification?releaseId=1&releaseName=My%20Release%20 # 1&applicationVersionName=ReleaseTemplate1&stageTypeName=Stage1&environmentName=Environment1&StepId=1&releaseStepTypeId=1&releaseStepIsAutomated=True

But due to special meaning of ‘#’ character, URL is truncated and below invalid POST call is made for SendNotification service.

POST  https://rmserver:1000/account/releaseManagementService/_apis/releaseManagement/NotificationService/SendNotification?releaseId=1&releaseName=My%20Release%20 

 

  • The above issue will occur if if any of the artifacts like ReleaseName, ReleaseTemplateName, StageTypeName or EnvironmentName contains special characters like ‘#’.
  • The workaround for now is please refrain from using special characters like ‘#’ in any of the artifacts like Release Name, Release Template Name, Stage Name, Environment name etc. till this gets fixed in the future release of the Release Management product.

 

Thank You.

Comments

  • Anonymous
    January 29, 2016
    I'm having this trouble, but I don't have any special characters (apart from .) in any of these things (ReleaseName, ReleaseTemplateName, StageTypeName or EnvironmentName ). Any suggestions on how to troubleshoot this?

  • Anonymous
    January 31, 2016
    I found the problem. I have TFS 2013, but I'm using Release Management 2015. I tried to add the Release Template 12, but for some reason it conflicts with 11. I resolved the issue by removing the release template 12 from the buildprocesstemplates.