英文:
Retrieve 502 errors during dotnet restore using gitlab package registry
问题
在运行 dotnet restore
过程中遇到了一些问题。我有一个GitLab私有包注册表,而在 dotnet restore
过程中,恢复期间出现了一堆502错误。看起来它试图从我的私有注册表获取外部依赖项。老实说,我不知道该怎么办。我感激任何帮助。谢谢!
日志片段:
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.objectmodel/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/messagepackanalyzer/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/microsoft.win32.systemevents/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/messagepack/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.io.pipes/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : 错误 NU1301: 无法从远程源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json' 检索有关 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' 的信息。 [/builds/rvn/reports/ServerFace/ServerFace.sln]
为源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/system.security.principal.windows/index.json' 重试 'FindPackagesByIdAsync'。
响应状态代码表明失败: 502 (Bad Gateway)。
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : 错误 NU1301: 无法从远程源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json' 检索有关 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' 的信息。 [/builds/rvn/reports/ServerFace/ServerFace.sln]
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : 错误 NU1301: 无法从远程源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json' 检索有关 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' 的信息。 [/builds/rvn/reports/ServerFace/ServerFace.sln]
/builds/rvn/reports/ServerFace/ServerFace/ServerFace.csproj : 错误 NU1301: 无法从远程源 'https://git.somedomain.com/api/v4/projects/22/packages/nuget/download/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json' 检索有关 'runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl' 的信息。 [/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>
英文:
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>
答案1
得分: 0
我已找到我的解决方案。关键是,NuGet 依次遍历所有包源。因此,NuGet 尝试从所有源中查找所有依赖项。老实说,我不知道为什么我只从我的 GitLab 包注册表中看到 502 错误,而不是从 Nexus。无论如何,我的解决方案是使用包源映射 - 适合我。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论