Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“500 internal server” problem instead of return the “No Packages found” message in NuGet server hosted application. #6681

Closed
karthikanandan opened this issue Mar 15, 2018 · 11 comments
Assignees

Comments

@karthikanandan
Copy link

Hi Team,

We are configured our own NuGet feed using NuGet Server.
We have hosted nearly 20 sub-applications in our server. each application is induvial NuGet feed.

Issue:
While installing the package it returns 500 internal servers” problem instead of return the “No Packages found” message in NuGet server-hosted application.

Issue reproduce case:

We have configured multiple feeds below order.

Nuget.Org - https://api.nuget.org/v3/index.json
Aspnet - http://testdoamin.com/nuget_aspnet/nuget/getpackages/aspnet
MVC - http://testdoamin.com/nuget_aspnetmvc/nuget/getpackages/mvc

We have install (mvc5) package using MVC feed. But this package not available in Aspnet feed. In this case, it returns “500 internal servers” error.

Package name Feed Availability
mvc5 aspnet No
mvc5 MVC Yes

For the same case:

We have to change the feed configuration in below order (Available package 1st). Now install properly.

Nuget.Org - https://api.nuget.org/v3/index.json
MVC - http://testdoamin.com/nuget_aspnetmvc/nuget/getpackages/mvc
Aspnet - http://testdoamin.com/nuget_aspnet/nuget/getpackages/aspnet

Machine Details:
Windows 10 OS
VS2017 Professional - 15.4.3
NuGet Package Manager – 4.4.0

image

Install NuGet.Server version 3.0.3-jver-big-tmp-21027 from the following package source:
https://dotnet.myget.org/F/nuget-build/api/v3/index.json
NuGet/NuGetGallery#5230

  1. It’s working fine in VS2013 and VS2015.
  2. Also, we have high CPU problem.
    High CPU usage (99%) by NuGet.Server NuGetGallery#5536

Please provide the solution for this ASAP.

Thanks in Advance.

@karthikanandan
Copy link
Author

Hi Team,

Any update on this?

Thanks,

@NagarajMasub
Copy link

@joelverhagen we are also facing the same issue, can you please update on this?
waiting for your reply...

@joelverhagen
Copy link
Member

Install NuGet.Server version 3.0.3-jver-big-tmp-21027 from the following package source:

As a side note, you don't need to use this private build any more. This fix is merged into NuGet.Server 3.1.0.

It’s working fine in VS2013 and VS2015.

Could you provide a Fiddler trace of the VS2013, VS2015, and VS2017 repro? If one client version is working and one client version is broken, the HTTP requests and responses should be enough to diagnose the issue.

Also, we have high CPU problem.
NuGet/NuGetGallery#5536

As mentioned on that issue, could you provide a capture produced by PerfView? That may help us diagnose the problem.

500 internal server

This indicates an exception being thrown on the server side. You can enable Trace exception logging by updating to NuGet.Server 3.1.1 or newer and adding the following lines to your startup code (by default this is NuGetODataConfig.cs):

Trace.Listeners.Add(new TextWriterTraceListener(HostingEnvironment.MapPath("~/NuGet.Server.log")));
Trace.AutoFlush = true;

You can change the file path to whatever you want. After you reproduce the HTTP 500, the log file should have some helpful information (such as the exception message and stack trace).

Could you provide this log file?

@joelverhagen joelverhagen self-assigned this Mar 22, 2018
@karthikanandan
Copy link
Author

karthikanandan commented Mar 28, 2018

Hi @joelverhagen

Thanks for the update.

Query:
Could you provide this log file?

Response:
I will provide the log file details ASAP.

Question:
Can you please share the Release notes for NuGet.Server 3.1.0

Thanks,

@joelverhagen
Copy link
Member

Can you please share the Release notes for NuGet.Server 3.1.0

All (recent-ish) release notes are available on GitHub releases:
https://github.com/NuGet/NuGet.Server/releases

3.1.0 release notes are:

This release fixes the one issue and introduces a new configuration option.

  1. Don't extract the entire package to the %TMP% directory (NuGet.PackageManagement: Rollback on mid-install failure such as IO or COMExceptions #48) (issues NuGet Server creates temp files in C:\Windows\Temp\nuget in server NuGetGallery#3275 and NuGet Server creates temp files in C:\Windows\Temp\NuGetScratch in server NuGetGallery#5230)
  2. Add the cache file name configurable (NuGet.PackageManagement: Support roll backs when execution of .ps1 files fail by throwing exceptions from PS layer #49). Thanks @apeneve!

The package is available on NuGet.org here:
https://www.nuget.org/packages/NuGet.Server/3.1.0

@karthikanandan
Copy link
Author

karthikanandan commented Apr 4, 2018

Hi @joelverhagen,

Thanks for the details.

This problem did not resolve after upgrade latest version (Nuger.Server v3.1.2).

Could you provide this log file?

I have upgrade latest version (Nuger.Server v3.1.2) and I got two different log files.

Case 01:
Our NuGet package folder structure like below.
image

This is the case we have face error (NuGet.Server.Log) while load (configure) and install our feed URL in Visual Studio.

image

Case2:

I have removed .nupkg files from root folder (AspNet). Please find our package folder structure.

image

In this case, we have face below details in NuGet.Server.Log while load (configure) and install packages using our feed URL in Visual Studio.

image

Note: This (500 internal server) problem not resolved.

Query:
Could you provide a Fiddler trace of the VS2013, VS2015, and VS2017 repro?

Response:
I have changed our company name (TestCompany) in this log file.
Machine Details:
Windows 10 OS
VS2017 Professional - 15.4.3
NuGet Package Manager – 4.4.0
Log.zip

Thanks in Advance.

@joelverhagen
Copy link
Member

Could you provide a Fiddler trace of the VS2013, VS2015, and VS2017 repro?

If the HTTP 500 is not resulting in a logged exception, perhaps another component (before or after NuGet.Server application code) is causing a problem.

Also, for the "AspNet" root folder, why are ReportViewer or Converter? Do they need to be there? Ideally they should be ignored by NuGet.Server, but it's odd to have random files or directories in a folder dedicated to NuGet.Server.

@karthikanandan
Copy link
Author

karthikanandan commented Apr 9, 2018

Hi @joelverhagen,

Thanks for the update.

We got solution to resolve 500 internal server.

Workaround:

Changing the NuGet Package options for Default Package Management format dropdown to: Package Reference instead of the old style packages.config
This seemed to work
image

Our Packages.config file like below.
image

Question:

  1. For this problem, whether we need to change anything in NuGet.Server ? or is this behavior in VS 2017?

Regarding 99% CPU usage:

Packages are assembled in the folder structure. Root folder package will not remove from the folder structure.
Our NuGet Package folder structure.
image

After configured the feed in visual studio, folder automatically created like below and CPU get 99%

image

If we have removed .nupkg file from root folder (aspnet). All the packages properly display in visual studio ( from sub folder).

Questions:

  1. Why NuGet file not removed from root folder? After creating folder structure.
  2. Is above case create high CPU usage(99%) problem?
  3. Whether we need to remove NuGet file from root folder manually?
  4. Which folder the packages will refer in VS? Root folder (aspnet) or Sub folder ?

Thanks,

@joelverhagen
Copy link
Member

Why NuGet file not removed from root folder? After creating folder structure.

It's possible it's a duplicate or the package has some corruption. In happy path cases the .nupkg is moved to the subfolder.

Is above case create high CPU usage(99%) problem?

I'm not sure what you mean, but this is tracked by issue NuGet/NuGetGallery#5536.

I have changed our company name (TestCompany) in this log file.

I looked through the log and saw not HTTP 500s... not sure what you are seeing.

Whether we need to remove NuGet file from root folder manually?

You can remove it. If a .nupkg is in the root of the NuGet.Server packages folder is will not be available in the feed. To be clear, I am not at all talking about the user packages folder that NuGet client usages to store restored packages (e.g. `%USERPROFILE%.nuget\packages). This user packages folder is unrelated to NuGet.Server and is a client package consumption concern, not a server concern.

We got solution to resolve 500 internal server.

Great! It seems like the remaining issue is the 99% CPU problem, tracked separately. I'll close this one. Please open any issues related to NuGet.Server here:
https://github.com/NuGet/NuGetGallery/issues

@karthikanandan
Copy link
Author

karthikanandan commented Aug 6, 2018

Hi @joelverhagen

We have face this 500 internal server error problem again in Visual Studio 2017 version 15.7.3 and above. Same packages installed properly in below versions.
15.3
15.4.3.
15.5.
15.6.1

Machine Details:
Windows 10 OS
VS2017 Professional - 15.7.3
NuGet Package Manager – 4.4.0
NuGet.Server - 3.1.2

Workaround not work for this version:
Changing the NuGet Package options for Default Package Management format drop-down to: Package Reference instead of the old style packages.config

For this problem, whether we need to change anything in NuGet.Server ? or is this behavior in VS 2017?

@karthikanandan
Copy link
Author

I am trying to install NuGet packages to Windows Forms App (.Net Framework) application in Microsoft Visual Studio Professional 2017, Version 15.7.3. It’s return 500 internal server error. I am using our own private NuGet feed. Cleared Nuget cache before install.

I have install that package using same feed URL to ASP.NET Web Application (.Net Framework) application or other applications. It’s installed properly without any problem. Cleared Nuget cache before install.

This problem not happen for both Windows Forms App (.Net Framework) and ASP.NET Web Application (.Net Framework) or other applications in Visual Studio Professional 2017, Version 15.3 - Cleared Nuget cache before install.

Issue reproduce machine details:

Microsoft Visual Studio Professional 2017

Version 15.7.3

Application : Windows Forms App (.Net Framework)

Issue not reproduce machine details:

Microsoft Visual Studio Professional 2017

Version 15.3 and 15.4

Install properly in all applications.

whether we need to change anything in NuGet.Server ?

I have selected package management format: Packages.config

Thanks for help in advance.

Karthik A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants