Trailing Slash in Teamcity Authenticated Nuget Feed Service URL prevents Octopus accessing Nuget Feed

Environment: TeamCity 8.0.4 (build 27616), Octopus Deploy Both installed and configured on the same machine.

Repro Steps:

  1. Enable TeamCity Nuget Server
  2. Copy Authenticated Feed URL. It is given as http://example/httpAuth/app/nuget/v1/FeedService.svc/
    Note trailing slash.
  3. Verify access works in browser. Will return XML details.
  4. Add Nuget Repository to Octopus, setting username and password.
  5. Test the newly added repo - search terms not required.
  6. Note the error: There was a problem processing your request: 400 Could not connect to the feed specified at ‘http://example/profile.html’ …

Associated Event Log entry

2013-11-01 11:17:00,631 [52] ERROR Octopus [(null)] - System.InvalidOperationException: Could not connect to the feed specified at ‘http://example/profile.html’. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity. —> System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. —> System.Data.Services.Client.DataServiceClientException: Apache Tomcat/7.0.37 - Error report

HTTP Status 404 - /profile.html/Packages()

type Status report

message /profile.html/Packages()

description The requested resource is not available.

Apache Tomcat/7.0.37

at System.Data.Services.Client.QueryResult.Execute()
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
— End of inner exception stack trace —
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
at System.Data.Services.Client.DataServiceQuery1.Execute() at System.Data.Services.Client.DataServiceQuery1.ExecuteInternal()
at NuGet.DataServiceQueryWrapper1.Execute[TResult](Func1 action)
— End of inner exception stack trace —
at NuGet.DataServiceQueryWrapper1.Execute[TResult](Func1 action)
at NuGet.DataServiceQueryWrapper1.<GetAll>d__7.MoveNext() at System.Collections.Generic.List1…ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Octopus.Portal.Areas.Api.Controllers.PackagesController.SearchForPackagesNamedLike(IPackageRepository repository, String packageId, Int32 take)
at Octopus.Portal.Areas.Api.Controllers.PackagesController.Index(String feedId, String packageId, Boolean partialMatch, Boolean includeMultipleVersions, Int32 take)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.b__49()

Work Around: Remove trailing slash from “…FeedService.svc/”, and re-test. Note that it works this way.

Contrast with the Unauthenticated feed, where the trailing slash IS accepted.

I can confirm this running Octopus and TeamCity 8.0.5. Not sure if this is an Octopus or TC issue.

Wowsers, nasty - thanks for letting us know. We use NuGet.Client to access the feed, so possibly an issue in there, but it can be hard to tell. We’ll keep an eye on this.