sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.84k stars 557 forks source link

Proxy Error when downloading package from group repository #338

Open NickRafRGA opened 4 months ago

NickRafRGA commented 4 months ago

I have a group repo called “chocolatey-all” which contains 2 members a hosted repository called “chocolatey-hosted” and a proxy repo called “chocolatey-proxy” which is a proxy for https://community.chocolatey.org/api/v2/.

When I attempt to download the latest vmware-tools package from the chocolatey-all group repository using the following url

http://my-nexus-instance.net/repository/chocolatey-all/Packages()?$filter=(tolower(Id)%20eq%20%27vmware-tools%27)%20and%20IsLatestVersion&semVerLevel=2.0.0

I get the error below 90% of the time and the cpu on the server I’m hosting nexus on spikes

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request [GET /repository/chocolatey-all/Packages()](https://nexus.rgare.net/repository/chocolatey-all/Packages()).

Reason: Error reading from remote server

However when I run the same command against the proxy repository it works as expected.

http://my-nexus-instance.net/repository/chocolatey-proxy/Packages()?$filter=(tolower(Id)%20eq%20%27vmware-tools%27)%20and%20IsLatestVersion&semVerLevel=2.0.0

I’ve tried invalidating the cache on the group repo with no luck.

Version: nexus OSS 3.64.0-04 OS: RHEL7 Database: OrientDB

steviecoaster commented 4 months ago

I can't reproduce your error, but as a very stupid suggestion, could you drop the trailing / off of https://community.chocolatey.org/api/v2 and try your test again please? I'm wondering if it's cloudflare doing weird things with the traffic because of the trailing slash.

mtaul-RGA commented 4 months ago

@steviecoaster Thanks for the suggestion. We just had a chance to try and saw the same issue. Worked fine when we ran the query against the proxy repo, but failed on on the grouped nuget repo.

mtaul-RGA commented 4 months ago

I will add as well that when I remove our hosted Nuget repo from the group, the queries succeed with no problem. It only seems to occur when the Chocolatey proxy repo and hosted repo are in the same group.

mtaul-RGA commented 4 months ago

@nblair @mrprescott does NEXUS-39665 pertain to this issue?

nblair commented 1 month ago

@mtaul-RGA NEXUS-39665 was marked as being fixed in release 3.65.0; can you try an upgrade to latest to see if it's resolved for you?

rgajason commented 4 weeks ago

Jumping in here for @mtaul-RGA and @NickRafRGA...

We have Apache httpd sitting in front of our NXRM install. The HTTP 502 error is being returned by Apache httpd, not by NXRM. If you bypass Apache and hit NXRM directly the error goes away.

Short term it seems the fix is to increase the timeout in Apache httpd. We've not yet migrated to Postgres for our NXRM DB which I'm assuming would help speed up these transactions.

I think it is fair to close this issue at this time. If we update our NXRM architecture and continue to have performance issues we'll open a new issue / support case.