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

502 Bad Gateway while running dotnet restore or dotnet build #4

Open
msschl opened this issue Oct 13, 2019 · 10 comments
Open

502 Bad Gateway while running dotnet restore or dotnet build #4

msschl opened this issue Oct 13, 2019 · 10 comments

Comments

@msschl
Copy link

msschl commented Oct 13, 2019

While running a dotnet restore or dotnet build some request to the private nuget server returns a 502 Bad Gateway. Here are the logs:

...
10.244.2.73 - - [13/Oct/2019:18:14:29 +0000] "GET /FindPackagesById()?id='System.Collections.Immutable'&semVerLevel=2.0.0 HTTP/1.1" 502 173 "-" "NuGet .NET Core MSBuild Task/5.3.0 (Linux 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019)" "10.244.2.1"
2019/10/13 18:14:29 [error] 49#49: *1885 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='System.Security.Principal.Windows'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
2019/10/13 18:14:29 [error] 49#49: *2125 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='System.Security.Permissions'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
2019/10/13 18:14:29 [error] 49#49: *2136 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='runtime.native.System.IO.Compression'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
2019/10/13 18:14:29 [error] 49#49: *2137 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='xunit.extensibility.core'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
2019/10/13 18:14:29 [error] 49#49: *2139 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='Microsoft.VisualStudio.Web.CodeGeneration'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
2019/10/13 18:14:29 [error] 49#49: *2141 connect() to unix:/var/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 10.244.2.73, server: nuget.kube-dev.local, request: "GET /FindPackagesById()?id='System.Collections.Immutable'&semVerLevel=2.0.0 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "nuget.kube-dev.local"
10.244.2.73 - - [13/Oct/2019:18:14:29 +0000] "GET /FindPackagesById()?id='Microsoft.Extensions.ApiDescription.Server'&semVerLevel=2.0.0 HTTP/1.1" 200 490 "-" "NuGet .NET Core MSBuild Task/5.3.0 (Linux 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019)" "10.244.2.1"
10.244.2.73 - - [13/Oct/2019:18:14:29 +0000] "GET /FindPackagesById()?id='Microsoft.Extensions.Diagnostics.HealthChecks'&semVerLevel=2.0.0 HTTP/1.1" 200 490 "-" "NuGet .NET Core MSBuild Task/5.3.0 (Linux 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019)" "10.244.2.1"
10.244.2.73 - - [13/Oct/2019:18:14:29 +0000] "GET /FindPackagesById()?id='System.Security.Permissions'&semVerLevel=2.0.0 HTTP/1.1" 502 173 "-" "NuGet .NET Core MSBuild Task/5.3.0 (Linux 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019)" "10.244.2.1"
...

I think that while a restore is running, there are to many request per seconds.

@rolfwessels
Copy link
Owner

I think you might want to check out the original author. https://github.com/Daniel15/simple-nuget-server.

This repo is just a wrapper to allow it to be run using docker.

@msschl
Copy link
Author

msschl commented Oct 14, 2019

But the nginx and php configuration files are created here and not in the original repo.

I think this issue is due to a configuration issue.

@rolfwessels
Copy link
Owner

Hmm, I see #3 said that there was an issue with absolute paths. Not sure if its related. Let me put it up on dockerhub and lets see.

@rolfwessels
Copy link
Owner

I really cant see enough info from your log to say why a 502 would happen.

@rolfwessels
Copy link
Owner

I found this https://stackoverflow.com/questions/39818999/php-fpm-and-nginx-resource-temporarily-unavailable-errors-in-proxy-error-log which seems related to your issue. But that stack overflow answer does not give me hope.

How many requests are you doing per second?
Do simple commands to restore work?
eg.

nuget.exe setApiKey -Source http://192.168.1.250:8083/  e46c582041db4cbe86a84b76a374383a
nuget.exe list -Source http://192.168.1.250:8083/ 
nuget.exe push Antlr.3.4.1.9004.nupkg -Source http://192.168.1.250:8083/ -ApiKey e46c582041db4cbe86a84b76a374383a
nuget.exe list -Source http://192.168.1.250:8083/
nuget.exe install -Source http://192.168.1.250:8083/ Antlr 

@rolfwessels
Copy link
Owner

Looking at NuGet/Home#4538 there is a settings in nuget.config maxHttpRequest that might help to rate limit the requests that are sent to your server.

@msschl
Copy link
Author

msschl commented Oct 17, 2019

I've testet setting maxHttpRequest in the nuget.config but it doesn't help.
Running the dotnet restore with --disable-parallel fixes the issue.

I found this online https://talk.plesk.com/threads/php-fpm-sock-failed-1000-users-online.341428/
Maybe this helps

@rolfwessels
Copy link
Owner

Thanks, I will have a look

@rolfwessels
Copy link
Owner

I've update the max children count to 400. Could you please test and let me know if its working for you
Tag:v1.1.23-develop

@msschl
Copy link
Author

msschl commented Oct 23, 2019

Still the same error

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

2 participants