Hosting Own NuGet Feed, Unable to reach it with NuGet.exe

Topics: General
May 23, 2013 at 7:53 AM
I have set up a NuGet feed following all of the directions here:
http://docs.nuget.org/docs/creating-packages/hosting-your-own-nuget-feeds

I am able to reach the server on all but one machine, but of course the only machine I HAVE to be able to reach it from, I can't.

I consistently receive a 404 error when I use the feed as directed in the tutorial. When I change the feed to use dataservices/packages.svc, I receive a 503 error.

I thought it would help to debug by installing the NuGet Package Explorer. When I install that on the machine, it can reach the NuGet feed I've set up and download packages without any issues.

I also installed Wireshark on the machine. When using Visual Studio, or the NuGet.exe for command-line utilities, I never see any packets trying to reach the NuGet server I set up. When using the NuGet Package Explorer, I see packets showing up in Wireshark contacting my NuGet server.

I briefly tried using Fiddler, but I never saw anything showing up in there when I was using NuGet.exe. I didn't try to see what it looked like when running the NuGet Package Explorer.

So basically, my question is what can I do to either solve this issue, or further debug it?

Thanks for any assistance that can be offered.
May 30, 2013 at 4:29 PM
We are also having this issue. I'll continue researching in the meantime, but if someone knows the fix - it would be appreciated!
May 30, 2013 at 6:43 PM
Yes, if anyone with more knowledge can point me in the right direction to do some debugging, I would be more than willing to do diagnostics, provide logs, packet sniff, etc.
May 31, 2013 at 8:02 PM
Edited May 31, 2013 at 8:03 PM
This is the exception I receive when turning the Verbosity level to detailed. Nuget acts as if the server is not there, but I can view the packages in a web browser.
System.InvalidOperationException: Failed to process request. 'Not Found'. 
The remote server returned an error: (404) Not Found.. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.GetResponse()
   at NuGet.RequestHelper.GetResponse(Func`1 createRequest, Action`1 prepareRequest, IProxyCache proxyCache, ICredentialCache credentialCache, ICredentialProvider credentialProvider)
   at NuGet.HttpClient.GetResponse()
   at NuGet.PackageServer.EnsureSuccessfulResponse(HttpClient client, Nullable`1 expectedStatusCode)
   --- End of inner exception stack trace ---
   at NuGet.PackageServer.EnsureSuccessfulResponse(HttpClient client, Nullable`1 expectedStatusCode)
   at NuGet.PackageServer.PushPackageToServer(String apiKey, Func`1 packageStreamFactory, Int32 timeout)
   at NuGet.PackageServer.PushPackage(String apiKey, IPackage package, Int32 timeout)
   at NuGet.Commands.PushCommand.PushPackageCore(String source, String apiKey, PackageServer packageServer, String packageToPush, TimeSpan timeout)
   at NuGet.Commands.PushCommand.PushPackage(String packagePath, String source, String apiKey, TimeSpan timeout)
   at NuGet.Commands.PushCommand.ExecuteCommand()
   at NuGet.Commands.Command.Execute()
   at NuGet.Program.Main(String[] args)
Jun 27, 2013 at 7:35 PM
Edited Jun 27, 2013 at 7:35 PM
I've simply created a work around for this issue by using a machine that can access the NuGet packages and having Jenkins (our Continuous Integration server) pass the NuGet packages to the machine that needs them.

This is frustrating, but the advantages to using NuGet outweigh the inconvenience of having to do this.
Sep 17, 2013 at 9:54 PM
I've upgraded to 2.7 and I still run into the same issue....the exception is slightly different but appears to be mostly the same:
System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.GetResponse()
   at NuGet.RequestHelper.GetResponse(Func`1 createRequest, Action`1 prepareRequ
est, IProxyCache proxyCache, ICredentialCache credentialCache, ICredentialProvid
er credentialProvider)
   at NuGet.HttpClient.GetResponse()
   at NuGet.RedirectedHttpClient.GetResponseUri(HttpClient client)
   at NuGet.RedirectedHttpClient.EnsureClient()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at NuGet.MemoryCache.GetOrAdd[T](Object cacheKey, Func`1 factory, TimeSpan ex
piration, Boolean absoluteExpiration)
   at NuGet.RedirectedHttpClient.get_CachedClient()
   at NuGet.RedirectedHttpClient.get_Uri()
   at NuGet.DataServicePackageRepository.get_Context()
   at NuGet.DataServicePackageRepository.Search(String searchTerm, IEnumerable`1
 targetFrameworks, Boolean allowPrereleaseVersions)
   at NuGet.PackageRepositoryExtensions.Search(IPackageRepository repository, St
ring searchTerm, IEnumerable`1 targetFrameworks, Boolean allowPrereleaseVersions
)
   at NuGet.AggregateRepository.<>c__DisplayClass2f.<Search>b__2e(IPackageReposi
tory r)
   at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSour
ce x)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NuGet.AggregateQuery`1.GetSubQueries(Expression expression)
   at NuGet.AggregateQuery`1..ctor(IEnumerable`1 queryables, IEqualityComparer`1
 equalityComparer, ILogger logger, Boolean ignoreFailures)
   at NuGet.AggregateRepository.CreateAggregateQuery(IEnumerable`1 queries)
   at NuGet.AggregateRepository.Search(String searchTerm, IEnumerable`1 targetFr
ameworks, Boolean allowPrereleaseVersions)
   at NuGet.PackageRepositoryExtensions.Search(IPackageRepository repository, St
ring searchTerm, IEnumerable`1 targetFrameworks, Boolean allowPrereleaseVersions
)
   at NuGet.Commands.ListCommand.GetPackages()
   at NuGet.Commands.ListCommand.ExecuteCommand()
   at NuGet.Commands.Command.Execute()
   at NuGet.Program.Main(String[] args)
Oct 28, 2013 at 12:23 PM
Hi guys,

I am not sure if you have already solved this issue, neither if mine is 100% the same as yours, but I think it is similar and so I will post here anyway.

I was receiving the damn 503 error when trying to browse our company internal/custom nuget repository via the "Manage Nuget Packages" dialog.

After weeks of strugling with this situation, what I did to fix it is:
  • Close Visual Studio
  • Delete the file NuGet.Config located in %appdata%\nuget\ (before deleting, make sure you have saved somewhere the address of your nuget repositories of interest)
  • Open Visual Studio and add your nuget repository again ("Manage Nuget Packages" dialog)
  • Browse the packages for your project.
At least for me this worked. Hope it works for you as well.
Good luck!
Jun 19, 2014 at 7:31 PM
I am still experiencing this issue, except now it's appearing on more than 1 machine like I had stated initially.

Has anyone else experienced this issue and/or is able to help?

Thanks.