kubernetesterraformnugetnexusnexus3

Nexus: error NU1301: Failed to retrieve information about 'Microsoft.NET.Test.Sdk' from remote source


I have upgraded my Nexus from 3.29.0 to 3.58.1 via Terraform using Helm Kubernetes cluster and I am getting the following error now:

[2023-08-14T08:05:46.935Z] C:\Users\Deployer\workspace\MyApp\MyApp.View.Test.csproj : error NU1301: Failed to retrieve information about 'Microsoft.NET.Test.Sdk' from remote source 'https://mynexus.com/repository/nuget-group/FindPackagesById()?id='Microsoft.NET.Test.Sdk'&semVerLevel=2.0.0'. [C:\Users\Deployer\workspace\MyApp\myapp.sln]

I didn't change anything on any of the nuget-repository, nuget-group and nuget-proxy.

Why am I getting this error? How to fix it?


Solution

  • I fixed this by changing the Protocol Version for nuget-proxy to NuGet V2. It got set to NuGet V3 after the Nexus upgrade.

    Reference Screenshot below:

    enter image description here

    In your Terraform code, if you're using nexus_repository_nuget_proxy then change your code as follows:

    resource "nexus_repository_nuget_proxy" "nuget_proxy" {
    ...
      query_cache_item_max_age = 1440
      nuget_version            = "V2"
    ...
    }
    

    In your Terraform code, if you're using nexus_repository then change your code as follows:

    resource "nexus_repository" "nuget_proxy" {
    ...
      nuget_proxy {
        query_cache_item_max_age = 1440
        nuget_version            = "V2"
      }
    ...
    }