Nuget Server returning 403s and 404s

Sep 2, 2011 at 11:07 PM
Edited Sep 2, 2011 at 11:07 PM

I'm trying to host on my Amazon EC2 VPS, and I'm having issues.

  1. I've followed the instructions here ( Hosting your own NuGet Feeds )
  2. I've read this thread ( NuGet: remote server returned an Error(403) Forbidden ) along the same lines.
    1. I'm not running TFS
    2. It "could" be a proxy issue, but I'm not entirely sure how to check.

My NuGet feed is located at http://nuget.infinitas.ws. You'll notice that both http://nuget.infinitas.ws/nuget/Packages and http://nuget.infinitas.ws/Packages are throwing errors.

Any help with this will be greatly appreciated.

Sep 2, 2011 at 11:10 PM

We have a newer gallery in development, which is significantly easier to deploy than this one (you pretty much build and run!). You can get it from https://github.com/NuGet/NuGetGallery. It's not completely finished, but is getting close. It would be great if you could give it a try and give us feedback. Thanks!

Sep 2, 2011 at 11:13 PM

Actually, that new server is good replacement for this one. If you're just trying to set up a simpler server where you just drop packages in a folder, then the one you're using is still the right one (and I'm not sure about the issue). Sorry for the confusion.

Sep 3, 2011 at 2:23 PM

Is there any further information I can give in order to help resolve this issue?

Sep 3, 2011 at 4:40 PM

Does the same app work correctly on your local machine?

Sep 3, 2011 at 4:49 PM
Edited Sep 3, 2011 at 4:59 PM

Unfortnately no. I'm getting a different error when running it in Visual Studio

MapRoutes(RouteTable.Routes);

TypeLoadException: Could not load type 'NuGet.Server.DataServices.Packages' from assembly 'Nuget.Server

I didn't do anything special to the solution... Created an empty project, used Nuget to install Nuget.Server. Launched the app using Debugging.

Sep 3, 2011 at 6:21 PM

Strange. I just tried those two steps and it worked fine, both with the VS Web Server and with IIS Express. The type it complains about does exist in that assembly. Maybe it's somehow loading the wrong one? What's the full stack of the exception?

I would definitely focus on first getting it running locally before moving to EC2.

Sep 3, 2011 at 6:32 PM

[TypeLoadException: Could not load type 'NuGet.Server.DataServices.Packages' from assembly 'Nuget.Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   WebActivator.ActivationManager.RunActivationMethods() +420
   WebActivator.ActivationManager.RunPreStartMethods() +43
   WebActivator.ActivationManager.Run() +69

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'NuGet.Server.DataServices.Packages' from assembly 'Nuget.Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +591

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'NuGet.Server.DataServices.Packages' from assembly 'Nuget.Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9013676
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258

Sep 3, 2011 at 6:37 PM

I copied my working app to here. Can you try it to see if the problem is with your app or with other aspects of your machine?

Sep 3, 2011 at 6:37 PM

I just created a NEW project and ran `PM> Install-Package Nuget.Server` again.

Hit F5 and got the same result as above.

Sep 3, 2011 at 6:40 PM

So I dl'd your project and fired it up. I couldn't load the project.

 

C:\Development\Projects\Nuget\Nuget.Server\WebApplicationNuGetServer\WebApplicationNuGetServer.csproj : error  : The Web Application Project WebApplicationNuGetServer is configured to use IIS. To access local IIS Web sites, you must install the following IIS components:

      IIS 6 Metabase and IIS 6 Configuration Compatibility

In addition, you must run Visual Studio in the context of an administrator account.

For more information, press F1.


Loading C:\Development\Projects\Nuget\Nuget.Server\WebApplicationNuGetServer\WebApplicationNuGetServer.csproj ...
C:\Development\Projects\Nuget\Nuget.Server\WebApplicationNuGetServer\WebApplicationNuGetServer.csproj : error  : The Web Application Project WebApplicationNuGetServer is configured to use IIS. To access local IIS Web sites, you must install the following IIS components:

      IIS 6 Metabase and IIS 6 Configuration Compatibility

In addition, you must run Visual Studio in the context of an administrator account.

Sep 3, 2011 at 6:44 PM

What version of VS are you running? Do you have 2010 SP1? It seems you don't have IIS Express installed.

Sep 3, 2011 at 6:50 PM

VS 2010

Version 10.0.30319.1 RTMRel

No IIS Express

Sep 3, 2011 at 6:51 PM

grabbing SP1 now

Sep 3, 2011 at 6:58 PM

Any benefit to using IISExpress over the built in dev server in VS?

Sep 4, 2011 at 1:54 AM

It has much better fidelity with IIS, which avoids some deployment headaches caused by the differences. But regardless of the use of IIS Express, you'll definitely want to be running SP1. Let's see whether that helps with your original issue and take it from where.

Developer
Sep 4, 2011 at 2:22 AM

When I navigate directly to the svc file and I'm getting a 500:
http://nuget.infinitas.ws/DataServices/Packages.svc

 

Sep 4, 2011 at 4:15 AM

It's probably all the same root issue about it not being able to load NuGet.Server.

Sep 5, 2011 at 12:21 AM

Interesting, I looked at the error, and have no idea what it means.

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item

Sep 5, 2011 at 12:33 AM

I fixed the error on http://nuget.infinitas.ws/DataServices/Packages.svc by changing

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"  />
  </system.serviceModel>

to

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"  />
  </system.serviceModel>
But unfortunately it did NOT fix the 404 error.

Sep 5, 2011 at 1:59 AM

Before discussion the server, did upgrading to SP1 fix it on your dev machine?

Developer
Sep 5, 2011 at 3:38 AM

http://nuget.infinitas.ws/DataServices/Packages.svc/ is working again so I'm thinking it has something to do with extensionless urls,