Nugetgallery: NuGet.Server - 406 (Not Acceptable) Error

Created on 29 Nov 2017  路  33Comments  路  Source: NuGet/NuGetGallery

When pushing to a new deployment of NuGet.Server returns:

Pushing PackageName.2.0.6501.26693.nupkg to 'http://myserver.net/nuget'...
PUT http://myserver.net/nuget/
NotAcceptable http://myserver.net/nuget/ 614ms
Response status code does not indicate success: 406 (Not Acceptable).

Not sure what else you might want to see to diagnose this. I couldn't find anything online to indicate the cause.

NuGet.Server

Most helpful comment

Hello,

I Had the same issue and for me it was IIS apppool permission to write to package folder.
I solve the problem with changing packagesPath key in web.config

Hope this helps !

All 33 comments

Hey @BrianKrohn, could you help with the following questions?

  1. What version of NuGet.Server are you using?
  2. What version of the client are using to push the package?
  3. Could you provide a Fiddler trace of the push request?
  1. I was using the latest when I reported this, but the browser shows "v0.0.0.0". I cloned the master again and tried to use it, but you've moved to C# 7.0. My company won't upgrade to VS2017, so I am unable to build. I will attempt to get a version prior to the upgrade. I am not that familiar with Git, so any help here would be appreciated.
  2. Client is 4.4.1.4656
  3. If I could build and deploy it again, I'd get try and get a trace.

I was using the latest when I reported this, but the browser shows "v0.0.0.0". I cloned the master again and tried to use it, but you've moved to C# 7.0. My company won't upgrade to VS2017, so I am unable to build. I will attempt to get a version prior to the upgrade. I am not that familiar with Git, so any help here would be appreciated.

Ah, I didn't realize you were building NuGet.Server from source. Alternatively, you could use the NuGet package and install it to an empty web project (.NET Framwork 4.6).

You can use this command to get the last release prior to moving to C# 7.

git checkout a66eaf4fe4fb6dd2c1f5577b9000de10acd22b4e

OK, I created a new, empty web app, and got the NuGet.Server package. It built and deployed, but the site just returns HTTP 500. I've tried giving IUSR and the IIS_IUSRS group full control access. There's nothing logged about the error and Fiddler doesn't show anything that I can tell.

Got past the 500 error. Turns out there are 2 "" tags in the web config. One for 4.6.1 and one for 4.6. Removing either produces:

Server Error in '/' Application.

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: The compiler failed with error code -2146232576.

There is also a long message below the error mentioning "roslyn\csc.exe".

Could you provide the long error message? I will look into the duplicate <compilation targetFramework="..." /> tags.

c:\windows\system32\inetsrv>C:\inetpub\nuget_dev\bin\roslyn\csc.exe /t:library /utf8output /nostdlib+ /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\bc9dbc8e\00457d52_d93ad001\System.Web.Http.WebHost.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\df33f577\002494ff_7c6acd01\Microsoft.Web.Infrastructure.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\2d7ca689\0028aa6b_c8dbd001\System.Web.Http.OData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\6f599c93\008a42d2_4964cf01\Microsoft.Web.XmlTransform.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\7d1a4a7d\005993f7_5028d301\System.Spatial.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\baf2e7fe\00162ec7_5f6ad301\NuGet.Server.V2.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\23937e6d\56c82462_1c74d301\NuGetServer.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\b45a7313\00a5572c_d93ad001\System.Net.Http.Formatting.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\3d71b682\00162ec7_5f6ad301\NuGet.Server.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\eabeb5d0\004b6cf0_5028d301\Microsoft.Data.OData.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\8d69984b\00b4389d_aa46d301\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\98a2bb45\001f924e_5ce8d201\Newtonsoft.Json.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\75e200b3\00b37e33_d93ad001\System.Web.Http.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\56376065\006a76ea_5028d301\Microsoft.Data.Edm.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\c059d2c2\00897dcb_1909d201\NuGet.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\2bd774ae\00162ec7_5f6ad301\NuGet.Server.Core.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\assembly\dl3\34c6864b\003cc490_2b1fd201\WebActivatorEx.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\App_Web_default.aspx.cdcab7d2.my0isugq.dll" /D:DEBUG /debug+ /optimize- /win32res:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\b1qbk0zf.res" /warnaserror- /w:4 /nowarn:1659;1699;1701;612;618 /langversion:default /nowarn:1659;1699;1701 "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\App_Web_default.aspx.cdcab7d2.my0isugq.0.cs" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\3d3a155c\381f5009\App_Web_default.aspx.cdcab7d2.my0isugq.1.cs"

More info. I found this exception in the Windows application logs:

Exception information:
Exception type: MissingMethodException
Exception message: Method not found: '!!0[] System.Array.Empty()'.
at NuGet.Server.Infrastructure.ServerPackageRepository.AddPackage(IPackage package)
at NuGet.Server.Publishing.PackageService.CreatePackage(HttpContextBase context)
at nuget_server.NuGetRoutes.<>c.b__1_0(RequestContext context) in C:\Users\BrianKrohn\Downloads\Projects\nuget-server\nuget-server\DataServices\Routes.cs:line 24
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

It happens when I try to push a package to the server. I also get this error when clicking the "Click here to view your packages" link.

Hope it's cool I chime in here:

Not sure if this really helps debug the issue - but I had this issue this afternoon. Ultimately, I was test pushing a package that was already there and got 406'd.
All I had to do was change allowOverrideExistingPackageOnPush to true and voila!

Brian, I also had multiple duplicate web.config settings in the source I downloaded. After verifying there was only 1 <compilation> tag and the system.webServer/handlers/add tags were unique, the 500 error went away and I was able to publish to my local server.

Hope this helps!

Hello,

I Had the same issue and for me it was IIS apppool permission to write to package folder.
I solve the problem with changing packagesPath key in web.config

Hope this helps !

I have tried all of the above suggestions

  1. ensured the apppool user has write permissions to the Packages directory
  2. removed the duplicate tag
  3. set allowOverrideExistingPackageOnPush to true

But I am still receiving a 406 when I try to push. I am using NuGet.Server version 3.1.0.0 and NuGet CLI version 4.3.0.4406. Any suggestions?

Hey, @haughtm, could you add the following lines to your app startup, reproduce the issue, and then take a look at the log file? Modify the path as necessary.

```csharp
Trace.Listeners.Add(new TextWriterTraceListener(@"C:\some\path\to\NuGet.Server.log"));
Trace.AutoFlush = true;
````

Also, could you provide the console output (stdout) of NuGet CLI command you run, including the parameters to nuget.exe? (feel free to obfuscate secrets 馃槃).

Hi @joelverhagen, thank you for the quick reply. Here is the output..

Here is the CLI output
nuget push automation.services.logging/bin/Debug/automation.services.logging.1.0.0.nupkg myapikey -Source http://nuget.mydomain/nuget
Pushing automation.services.logging.1.0.0.nupkg to 'http://nuget.mydomain/nuget'...
PUT http://nuget.mydomain/nuget/
NotAcceptable http://nuget.mydomain/nuget/ 207ms
406 (Not Acceptable)

And the Nuget.Server.log file shows
Info: Start rebuilding package store...
Info: Start reading packages from disk...
Info: Finished reading packages from disk.
Info: Start adding packages from drop folder.
Info: Finished adding packages from drop folder.
Info: Finished rebuilding package store.
Verbose: Created FileSystemWatcher - monitoring D:\NuGet Packages.
Info: Registering background jobs...
Info: Finished registering background jobs.
Info: Start rebuilding package store...
Info: Start reading packages from disk...
Info: Finished reading packages from disk.
Info: Start adding packages from drop folder.
Info: Finished adding packages from drop folder.
Info: Finished rebuilding package store.
Verbose: File system changed. File: myservername.cache.bin - Change: Changed
Info: Cleared package cache.

Those last 2 lines are repeated 387 times.

update

The package i was trying to push was created with command 'dotnet pack' and not 'nuget pack'. I just tried to push an application packaged with 'nuget pack' and it worked fine. This may simply be an issue related to dotnet core packages. I'll continue troubleshooting on my side.

output
5cg4450h24:automation.billing.data mhaught$ nuget push automation.billing.data.1.0.6610.22791.nupkg myapikey -Source http://nuget.mydomain/nuget
Pushing automation.billing.data.1.0.6610.22791.nupkg to 'http://nuget.mydomain/nuget'...
PUT http://nuget.mydomain/nuget/
Created http://nuget.mydomain/nuget/ 161ms
Your package was pushed.

Could you provide your .nuspec and recursive directory listing of the .nupkg?

I didn't create a nuspec file, just used the csproj file. Here is the output of the pack command.

5cg4450h24:automation.services.logging mhaught$ dotnet pack
Microsoft (R) Build Engine version 15.6.22.57775 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 53.93 ms for /Users/mhaught/Projects/automation.services.logging/automation.services.logging/automation.services.logging.csproj.
automation.services.logging -> /Users/mhaught/Projects/automation.services.logging/automation.services.logging/bin/Debug/netstandard2.0/automation.services.logging.dll
Successfully created package '/Users/mhaught/Projects/automation.services.logging/automation.services.logging/bin/Debug/automation.services.logging.1.0.0.nupkg'.

You can unpack the produced .nupkg as a .zip file and find both the directory structure and the output .nuspec (these two pieces of information imply that package compatibility -- which I imagine may be the problem).

Sorry, I didn't realize that.

Here is the nuspec
<?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> <metadata> <id>automation.services.logging</id> <version>1.0.0</version> <authors>automation.services.logging</authors> <owners>automation.services.logging</owners> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>Package Description</description> <dependencies> <group targetFramework=".NETStandard2.0"> <dependency id="Newtonsoft.Json" version="10.0.3" exclude="Build,Analyzers" /> </group> </dependencies> </metadata> </package>

And the directory structure

  • _rels
  • [Content_Types].xml
  • automation.services.logging.nuspec
  • lib

    • netstandard2.0



      • automation.services.logging.dll



  • package

    • services



      • metadata





        • core-properties







          • 477a54281d484cabbca2b824c74878ea.psmdcp










Interesting, I tried producing a package targeting netstandard2.0 with .NET CLI and NuGet.Server accepted it just fine. Could you add a Trace exception logger to your application? I have a branch here with an example of how to do this:
https://github.com/NuGet/NuGet.Server/commit/a7fc19fe0217b6c1662f541cf59832a788542e29

(as a side note, I plan on adding this in a 3.2.0 release, if I have time)

After you add that exception logger, reproduce the issue then check the log file you instrumented above. I was, for example, able to reproduce the issue by manually changing the name of the .nuspec file and the package ID therein (thus breaking the OPC metadata which NuGet.Server requires).

Also, could you upload the package here so I can reproduce it locally? If you are concerned about sharing your package publicly, feel free to upload it to a file hosting site like OneDrive or Google Drive and sending a link to us at [email protected].

So, I ended up recreating this library from scratch and it's working fine now. Thank you so much for all your help.

Hi @joelverhagen I have tried the above to set permissions to iis_iusr & also everyone.

This is my web.config file:

<?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="requireApiKey" value="true" /> <add key="apiKey" value="123" /> <add key="packagesPath" value="C:\tmp" /> <add key="cacheFileName" value="" /> <add key="allowOverrideExistingPackageOnPush" value="false" /> <add key="ignoreSymbolsPackages" value="true" /> <add key="enableDelisting" value="false" /> <add key="enableFrameworkFiltering" value="false" /> <add key="enableFileSystemMonitoring" value="true" /> </appSettings> <connectionStrings /> <system.web> <httpRuntime maxRequestLength="30720" /> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule" /> </modules> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type" /> <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" /> </customHeaders> </httpProtocol> <handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> </system.serviceModel> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.8.3.0" newVersion="5.8.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.8.3.0" newVersion="5.8.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.8.3.0" newVersion="5.8.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Web.XmlTransform" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-15.0.0.0" newVersion="15.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>

My client is 4.5.1 and server packages are below:

<packages> <package id="Microsoft.AspNet.WebApi" version="5.2.4" targetFramework="net46" /> <package id="Microsoft.AspNet.WebApi.Client" version="5.2.4" targetFramework="net46" /> <package id="Microsoft.AspNet.WebApi.Core" version="5.2.4" targetFramework="net46" /> <package id="Microsoft.AspNet.WebApi.OData" version="5.7.0" targetFramework="net46" /> <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.4" targetFramework="net46" /> <package id="Microsoft.Data.Edm" version="5.8.3" targetFramework="net46" /> <package id="Microsoft.Data.OData" version="5.8.3" targetFramework="net46" /> <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" /> <package id="Microsoft.Web.Xdt" version="2.1.2" targetFramework="net46" /> <package id="Newtonsoft.Json" version="11.0.1" targetFramework="net46" /> <package id="NuGet.Core" version="2.14.0" targetFramework="net46" /> <package id="NuGet.Server" version="3.1.1" targetFramework="net46" /> <package id="NuGet.Server.Core" version="3.1.1" targetFramework="net46" /> <package id="NuGet.Server.V2" version="3.1.1" targetFramework="net46" /> <package id="System.Spatial" version="5.8.3" targetFramework="net46" /> <package id="WebActivatorEx" version="2.2.0" targetFramework="net46" /> </packages>

This setup did work in my local with localhost. When I push from build server to nuget server , I get Response status code does not indicate success: 500 (Internal Server Error).

cmd:> nuget push reflib.1.0.0.nupkg -source http://desktoptopname/ -apikey 123

Hey @ram1421, could you open a new issue please? This particular issue is getting really long (and therefore notifying a lot of people). Additionally, it seems like there are multiple root causes going on. This thread seems to be related to HTTP 406. You problem is an HTTP 500.

Thanks!

I have resolved this issue giving proper Full Control rights on ~/Packages directory to a user the application pool runs under.

Just as a note to anyone else who might be having this problem. I was getting a 500 when trying to list packages, and a 406 when trying to push. The solution for me was to give the app pool user in IIS full permissions to the /Packages directory, as mentioned above.

I have got the same error code...
I want to push nuget package to self-hosted nuget manager and it returns 406.

Failed to process request. 'Not Acceptable'.The remote server returned an error: (406) Not Acceptable..

I got 406 (Not Acceptable) because I got the same DLL twice in the .nupkg (in the same directory). Yes, it is possible if you misconfigure your .nuspec file. It took a while until I realized this caused the issue. Some more meaningful error message would be greatly appreciated...

I didn't receive 406 error after I changed package folder location.

I was receiving a 406 error with only a specific package.

It turns out the package was larger than the 30MB asp.net limit set in web.config of the nuget server. Increasing the value of maxRequestLength in the httpRuntime element fixed the issue for me.

In my case switching from the deprecated licenseUrl element to the license element in the .nuspec file seems to have fixed the issue.

I guess that'll teach me to not be lazy and read the warnings 馃檭

i received 406 because my nuget package had a src dir.

the nuget server handles packages with src dirs as symbol packages, so in the web.config you have to set "ignoreSymbolsPackages" to false.

I am still having the same issue.

This is the command I am using
nuget.exe push My.Packahe.Name.1.0.0.nupkg -Source http://myserverURL.com/nuget

I have the following setting set

<add key="requireApiKey" value="false" />
<add key="apiKey" value="" />
<add key="packagesPath" value="Packages" />

My packages folder is listed in the root "next to the Web.confg file.

I also tried to change <add key="ignoreSymbolsPackages" value="true" /> to <add key="ignoreSymbolsPackages" value="false" />

I tried with client version 4.9.3 and they upgraded to 5.3.0 with the same issue.

I gave IUSR full control over the Packages folder but that did not fix the issue. Any idea on how to resolve this issue?

I have the same problem
This is a piece of log information.
xsp4.exe Error: 0 : System.IO.IOException: Error reading MIME multipart body part. ---> System.IO.IOException: Unable to read data from the transport connection: Operation on non-blocking socket would block. ---> System.Net.Sockets.SocketException: Operation on non-blocking socket would block at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00010] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs:1771 at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:513 --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000c3] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:525 at Mono.WebServer.XSP.XSPWorker.Read (System.Byte[] buffer, System.Int32 position, System.Int32 size) [0x0000a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorker.cs:207 at Mono.WebServer.BaseRequestBroker.Read (System.Int32 requestId, System.Int32 size, System.Byte[]& buffer) [0x0007e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer/BaseRequestBroker.cs:222 at (wrapper remoting-invoke-with-check) Mono.WebServer.BaseRequestBroker.Read(int,int,byte[]&) at Mono.WebServer.XSPWorkerRequest.ReadInput (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x00071] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorkerRequest.cs:609 at Mono.WebServer.XSPWorkerRequest.ReadEntityBody (System.Byte[] buffer, System.Int32 size) [0x00042] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorkerRequest.cs:629 at System.Web.HttpRequest.MakeInputStream () [0x0028a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequest.cs:918 at System.Web.HttpRequest.get_InputStream () [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequest.cs:1149 at System.Web.HttpRequestWrapper.get_InputStream () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequestWrapper.cs:152 at System.Web.Http.WebHost.HttpControllerHandler+<>c__DisplayClass13.<GetStreamContent>b__f () [0x00027] in <b2d5f889b8d5408ca3d4aa24eb5e947e>:0 at System.Web.Http.WebHost.HttpControllerHandler+LazyStreamContent.get_StreamContent () [0x00008] in <b2d5f889b8d5408ca3d4aa24eb5e947e>:0 at System.Web.Http.WebHost.HttpControllerHandler+LazyStreamContent.CreateContentReadStreamAsync () [0x00000] in <b2d5f889b8d5408ca3d4aa24eb5e947e>:0 at System.Net.Http.HttpContent.ReadAsStreamAsync () [0x0000e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpContent.cs:258 at System.Net.Http.HttpContentMultipartExtensions.ReadAsMultipartAsync[T] (System.Net.Http.HttpContent content, T streamProvider, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) [0x00082] in <dd5d13035e4d4a2e812d07ec2f066876>:0 --- End of inner exception stack trace --- at System.Net.Http.HttpContentMultipartExtensions.ReadAsMultipartAsync[T] (System.Net.Http.HttpContent content, T streamProvider, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) [0x00107] in <dd5d13035e4d4a2e812d07ec2f066876>:0 at NuGet.Server.V2.Controllers.NuGetODataController.UploadPackage (System.Threading.CancellationToken token) [0x000ef] in <16a18da2c3bf4533b42683dcedfda582>:0 at System.Threading.Tasks.TaskHelpersExtensions.CastToObject[T] (System.Threading.Tasks.Task1[TResult] task) [0x00063] in :0
at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore (System.Web.Http.Controllers.HttpActionContext actionContext, System.Threading.CancellationToken cancellationToken) [0x000c7] in :0
at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00137] in :0
at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0018d] in :0
Info: Cleared package cache.
xsp4.exe Error: 0 : System.IO.IOException: Error reading MIME multipart body part. ---> System.IO.IOException: Unable to read data from the transport connection: Operation on non-blocking socket would block. ---> System.Net.Sockets.SocketException: Operation on non-blocking socket would block
at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00010] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs:1771
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:513
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000c3] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:525
at Mono.WebServer.XSP.XSPWorker.Read (System.Byte[] buffer, System.Int32 position, System.Int32 size) [0x0000a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorker.cs:207
at Mono.WebServer.BaseRequestBroker.Read (System.Int32 requestId, System.Int32 size, System.Byte[]& buffer) [0x0007e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer/BaseRequestBroker.cs:222
at (wrapper remoting-invoke-with-check) Mono.WebServer.BaseRequestBroker.Read(int,int,byte[]&)
at Mono.WebServer.XSPWorkerRequest.ReadInput (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x00071] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorkerRequest.cs:609
at Mono.WebServer.XSPWorkerRequest.ReadEntityBody (System.Byte[] buffer, System.Int32 size) [0x00042] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-xsp-c98e068/src/Mono.WebServer.XSP/XSPWorkerRequest.cs:629
at System.Web.HttpRequest.MakeInputStream () [0x0028a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequest.cs:918
at System.Web.HttpRequest.get_InputStream () [0x00008] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequest.cs:1149
at System.Web.HttpRequestWrapper.get_InputStream () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpRequestWrapper.cs:152
at System.Web.Http.WebHost.HttpControllerHandler+<>c__DisplayClass13.b__f () [0x00027] in :0
at System.Web.Http.WebHost.HttpControllerHandler+LazyStreamContent.get_StreamContent () [0x00008] in :0
at System.Web.Http.WebHost.HttpControllerHandler+LazyStreamContent.CreateContentReadStreamAsync () [0x00000] in :0
at System.Net.Http.HttpContent.ReadAsStreamAsync () [0x0000e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpContent.cs:258
at System.Net.Http.HttpContentMultipartExtensions.ReadAsMultipartAsync[T] (System.Net.Http.HttpContent content, T streamProvider, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) [0x00082] in :0
--- End of inner exception stack trace ---
at System.Net.Http.HttpContentMultipartExtensions.ReadAsMultipartAsync[T] (System.Net.Http.HttpContent content, T streamProvider, System.Int32 bufferSize, System.Threading.CancellationToken cancellationToken) [0x00107] in :0
at NuGet.Server.V2.Controllers.NuGetODataController.UploadPackage (System.Threading.CancellationToken token) [0x000ef] in <16a18da2c3bf4533b42683dcedfda582>:0
at System.Threading.Tasks.TaskHelpersExtensions.CastToObject[T] (System.Threading.Tasks.Task1[TResult] task) [0x00063] in <f99f496cb0d249c1a945c1fcabce1695>:0 at System.Web.Http.Controllers.ApiControllerActionInvoker.InvokeActionAsyncCore (System.Web.Http.Controllers.HttpActionContext actionContext, System.Threading.CancellationToken cancellationToken) [0x000c7] in <f99f496cb0d249c1a945c1fcabce1695>:0 at System.Web.Http.Controllers.ActionFilterResult.ExecuteAsync (System.Threading.CancellationToken cancellationToken) [0x00137] in <f99f496cb0d249c1a945c1fcabce1695>:0 at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0018d] in <f99f496cb0d249c1a945c1fcabce1695>:0

+1, same bug.
My issue was that particular packages were too large (60 MB). Glad I found it, it was copying DLL's to the /lib folder that should just have been references to other packages.

For future references, what would the default maximum allowed size be, and what web.config entries could allow for larger packages?

Thanks

J

Was this page helpful?
0 / 5 - 0 ratings