baseclass / nuserv

Nuget server with multi repository capabilities.
MIT License
1 stars 0 forks source link

Can't get Chocolatey to see/use the feed #4

Open cwb124 opened 10 years ago

cwb124 commented 10 years ago

Got the site working in IIS 8.0. Populated the web.config. Created a new repository. I just can't get the chocolatey client to list any packages. I dropped a few .NUPKG files in the packages path I specified in the web.config. But I'm coming up blank.

Chocolatey client throws this error: The remote server returned an error: (400) Bad Request. That happens when I do a 'choco list' to view available packages.

cwb124 commented 10 years ago

To elaborate, when I create a repository it provides me two paths. API URL and FEED URL. Neither of those work (400 and 404 errors respectively). I tried pointing chocolatey to the feed url. I also tried pushing a nupkg via the api url with just nuget.exe. Am I doing something wrong? Is there some other file(s) I need to customize or configure to make this work? VERY interested in making this work for our environment. Would appreciate any direction.

romerod commented 10 years ago

Did you try with Nuget Package Explorer, can you add and list packages? Currently there is an issue when trying to download a prerelease package

cwb124 commented 10 years ago

I did not. Will try today.

Are either of the paths provided when creating a repository supposed to be browsable? Specifically the feed URL? They are not currently browsable. The feed URL throws 400 errors.

Do you have any additional docs you could provide for this tool?

On Apr 25, 2014, at 2:09 AM, romerod notifications@github.com wrote:

Did you try with Nuget Package Explorer, can you add and list packages? Currently there is an issue when trying to download a prerelease package

— Reply to this email directly or view it on GitHub.

romerod commented 10 years ago

400 or 404? Currently there is no doc, but i'm sure we will find a solution. Can you post your web.config?

cwb124 commented 10 years ago

Just so we are on the same page. I setup nuserv on a box with IP of 10.21.85.62. Nuserv is it's own web site, not a virtual app. When I create a new repository named 'first', it says: feed url: repository/first/api/v2. In chocolatey, I set the package source to http://10.21.85.62/Repository/first/api/v2. When I do a choco list to get a list of packages from the source, I get a (400) Bad Request error. If i try and browse to that same URL, fiddler shows me a 400 error as well, and the page returns a 'Request Error, The server encountered an error processing the request. See server logs for more details'.

The IIS log shows the following when attempting to hit that URL from Chocolatey, and a very similar entry when attempting to browse: 2014-04-25 14:15:28 10.21.85.62 GET /NuGet.Lucene.Web.DataServices.PackageDataService-25edba93-1c71-4944-bbe9-6e9f6ea28351/ - 80 AnonymousPackageManager 10.21.85.56 NuGet/2.1.31022.9038+(Microsoft+Windows+NT+6.2.9200.0) - 400 0 0 1110

Web.config as follows:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <!--
      Optional remote package repository to mirror packages from.
    -->
    <add key="NuGet.Lucene.Web:packageMirrorTargetUrl" value="false" />
    <!--
      Determines if an Api Key is required to push/delete packages from the server.
    -->
    <add key="NuGet.Lucene.Web:allowAnonymousPackageChanges" value="false" />
    <!--
      Determines if requests on a local address (::1, 127.0.0.1) are automatically
      granted adminstrative roles. Enabling this flag allows a local user to create
      accounts on a freshly installed system where there is not already an admin account.
    -->
    <add key="NuGet.Lucene.Web:handleLocalRequestsAsAdmin" value="false" />
    <!--
      When true, Access-Control-Allow-Origin and related headers will be added to
      requests handled by Web Api allowing web applications to invoke Api methods
      and access content in the response.
    -->
    <add key="NuGet.Lucene.Web:EnableCrossDomainRequests" value="true" />
    <!--
      Change the path to the packages folder. Default is ~/App_Data/Packages.
      This can be a virtual or physical path.
    -->
    <add key="NuGet.Lucene.Web:PackagesPath" value="D:\Nuserv\Packages" />
    <!--
      Change the path to where the lucene index is stored. Default is ~/App_Data/Lucene.

      For best performance, the index should be stored on a local disk outside
      of the document root. Storing the index outside of IIS prevents asp.net from
      being sent file change notifications whenever the index is modified.

      This can be a virtual or physical path.
    -->
    <add key="NuGet.Lucene.Web:LucenePath" value="D:\Nuserv\Index" />
    <!--
      When true, enables a FileSystemWatcher that monitors the packagesPath
      and automatically updates the Lucene index when packages are created,
      modified, renamed or deleted.
    -->
    <add key="NuGet.Lucene.Web:EnablePackageFileWatcher" value="true" />
    <!--
      When true, scans the packagesPath and compares nupkg files with
      the Lucene index and updates the Lucene index to match the file
      system. This setting enables the Lucene index to be kept in sync
      when package files change while this web app isn't running.
    -->
    <add key="NuGet.Lucene.Web:SynchronizeOnStart" value="true" />
    <!--
      When true, packages that are pushed will be stored in subdirectories
      such as ${packagesPath}\${packageId}\${packageId}.{packageVersion}.nupkg,
      and when false, all packages will be stored in the top level packagesPath
      directory.
    -->
    <add key="NuGet.Lucene.Web:GroupPackageFilesById" value="false" />
    <!--
      Controls whether or not to show stack trace information and other details
      to clients when unhandled exceptions occur. Enabling this flag may
      disclose potentially sensitive information to clients.
    -->
    <add key="NuGet.Lucene.Web:ShowExceptionDetails" value="false" />
    <add key="RouteDebugger:Enabled" value="false" /></appSettings>
  <system.web>
    <authentication mode="None" />
    <customErrors mode="Off" />
    <compilation targetFramework="4.5.1" />
    <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" />
  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules>
      <remove name="FormsAuthenticationModule" />
    </modules>

    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483648" maxQueryString="524288" />
      </requestFiltering>
    </security>
    <rewrite>
      <rules>
        <rule name="Add trailing slash for some URLs" stopProcessing="true">
            <match url="^(.*\.(\d)+)$" />
            <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
            <action type="Redirect" url="{R:1}/" />
        </rule>
      </rules>
    </rewrite>
  <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers></system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Remotion.Linq" publicKeyToken="fee00910d6e5f53b" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.15.9.0" newVersion="1.15.9.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
    <dependentAssembly><assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /></dependentAssembly><dependentAssembly><assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /><bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" /></dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
cwb124 commented 10 years ago

Nuget Package Explorer gives me the same 400 error.

cwb124 commented 10 years ago

Was this tested/working on IIS 8 or IIS 7/7.5?

romerod commented 10 years ago

It's working on w8 iis8 and on a server with iis 7.5


From: cwb124mailto:notifications@github.com Sent: ý29.ý04.ý2014 17:07 To: baseclass/nuservmailto:nuserv@noreply.github.com Cc: Daniel Romeromailto:daniel.romero@baseclass.ch Subject: Re: [nuserv] Can't get Chocolatey to see/use the feed (#4)

Was this tested/working on IIS 8 or IIS 7/7.5?

— Reply to this email directly or view it on GitHubhttps://github.com/baseclass/nuserv/issues/4#issuecomment-41688167.

romerod commented 10 years ago

Did you get it to work? (Had Holidays)

cwb124 commented 10 years ago

No I never could get it working past what I last posted in here. Not sure if it's an IIS thing or not. I would like to use it as I believe our in-house nuget repo using the nuget.server will be overwhelmed in the next few months. I'm going to revisit next week.

cwb124 commented 10 years ago

Before I begin another attempt, is there any special IIS configuration required to make this work?

romerod commented 10 years ago

No, you need to have the rewrite module installed.

I've fixed some issues yesterday take the newest version


From: cwb124mailto:notifications@github.com Sent: ý27.ý05.ý2014 15:44 To: baseclass/nuservmailto:nuserv@noreply.github.com Cc: Daniel Romeromailto:daniel.romero@baseclass.ch Subject: Re: [nuserv] Can't get Chocolatey to see/use the feed (#4)

Before I begin another attempt, is there any special IIS configuration required to make this work?

— Reply to this email directly or view it on GitHubhttps://github.com/baseclass/nuserv/issues/4#issuecomment-44277687.