0

Have some issue during running dotnet restore. I have GitLab private package registry, and during dotnet restore I have a bunch of 502 errors during restore. It seems that it tries to get external dependencies from my private registry. Honestly I do not know what to do. I appreciate any help. Thank you!

Piece of logs:

  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.objectmodel/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/messagepackanalyzer/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/microsoft.win32.systemevents/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/messagepack/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.io.pipes/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : error NU1301: Failed to retrieve information about 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' from remote source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json'. [/builds/rvn/reports/ServerFace/ServerFace.sln]
  Retrying 'FindPackagesByIdAsync' for source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.security.principal.windows/index.json'.
  Response status code does not indicate success: 502 (Bad Gateway).
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : error NU1301: Failed to retrieve information about 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' from remote source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json'. [/builds/rvn/reports/ServerFace/ServerFace.sln]
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : error NU1301: Failed to retrieve information about 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' from remote source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json'. [/builds/rvn/reports/ServerFace/ServerFace.sln]
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : error NU1301: Failed to retrieve information about 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' from remote source 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json'. [/builds/rvn/reports/ServerFace/ServerFace.sln]

Nuget.conf:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="NuGets Feed" value="https://nexus.somedomain.com/nexus/service/local/nuget/dotnet-packages/" />
    <add key="GitLab" value="https://git.somedomain.com/api/v4/projects/22/packages/nuget/index.json" />
  </packageSources>
  <packageSourceCredentials>
      <GitLab>
          <add key="Username" value="%GITLAB_PACKAGE_REGISTRY_USERNAME%" />
          <add key="ClearTextPassword" value="%GITLAB_PACKAGE_REGISTRY_PASSWORD%" />
      </GitLab>
  </packageSourceCredentials>
  <activePackageSource>
    <!-- this tells that all of them are active -->
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>
Roman R.
  • 29
  • 5
  • You are making a request and getting back in the response error 502. Which means you completed the connection. The error also says OpenSSL and debian (Linux). So most likely the error means the Authentication is failing when you are making the connection. there are many types of authentication. Recently most application have move towards OAUTH2 which will work on Windows, Linux, and Mac. Old sample code before 2022 probably will not work with OATH2. You need to verify the type of authentication the server is using and make sure the client is using same authentication method as server. – jdweng Jul 06 '23 at 12:34
  • But https://git.somedomain.com is a private registry, and there is no openssl packages. I wonder why it tries to find packages there – Roman R. Jul 06 '23 at 12:41
  • The OpenSSL is in Fedora. – jdweng Jul 06 '23 at 12:59

1 Answers1

0

Guess I have found my resolution. The point is, nuget goes through all package sources sequentially. So that nuget tries to find all dependencies from all sources. Honestly, I have no idea why I see 502 errors only from my gitlab package registry, but not from Nexus. Anyway, my solution is to use Package source mapping - fits to me.

Roman R.
  • 29
  • 5