Nuget hosted repository wrong index.json for some packages

25 views
Skip to first unread message

Mariska

unread,
Mar 21, 2024, 6:49:09 AMMar 21
to Nexus Users
Hi,
We have a hosted nuget repository in our nxrm3 instance that is accessed via a reverse proxy.
In short:

The nexus-internal-url is not accessible directly, only from the reverse proxy.

For unknown reason, there is one nuget package (all package versions are affected) that shows the internal url in the package id instead of the external url. I can see that in the https://nexus-external-url/repository/nuget-hosted/v3/registration/5/package-x/index.json.
When teams try to download the package via 'nuget install', they get an error message:

```
PS C:\> nuget install PackageX -version 2.24.0 -source https://nexus-external-url/repository/nuget-hosted/index.json
Feeds used:
https://nexus-external-url/repository/nuget-hosted/index.json

Attempting to gather dependency information for package 'PackageX.2.24.0' with respect to project 'C:\', targeting 'Any,Version=v0.0'
Gathering dependency information took 423 ms
Attempting to resolve dependencies for package 'PackageX.2.24.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'PackageX.2.24.0'
Resolved actions to install package 'PackageX.2.24.0'
Retrieving package 'PackageX 2.24.0' from 'https://nexus-external-url/repository/nuget-hosted/index.json'.

GET http://nexus-internal-url/repository/nuget-hosted/v3/content/PackageX/2.24.0/PackageX.2.24.0.nupkg
BadGateway http://nexus-internal-url/repository/nuget-hosted/v3/content/PackageX/2.24.0/packagex.2.24.0.nupkg 3069ms
WARNING: Error downloading 'PackageX.2.24.0' from 'http://nexus-internal-url/repository/nuget-hosted/v3/content/packagex/2.24.0/packagex.2.24.0.nupkg'.
Response status code does not indicate success: 502 (Bad Gateway).
```
I've tried rebuilding the index, but the index.json doesn't change.
Anyone knows how to fix this? It doesn't seem right that those package id's are hardcoded in the index.
Strange thing is that for most packages the id does point to the external nexus url.

Any help is greatly appreciated. I came across this thread https://community.sonatype.com/t/nexus-nuget-v3-repo-behind-reverse-proxy/5263/10, but can't find a solution how to recreate the index.json.

Note: we are running Nexus OSS 3.65.0-02.

Kind regards,
Mariska.
Reply all
Reply to author
Forward
0 new messages