Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during NuGet download when using v2 URL #378

Closed
Inirit opened this issue Sep 14, 2023 · 1 comment
Closed

Error during NuGet download when using v2 URL #378

Inirit opened this issue Sep 14, 2023 · 1 comment

Comments

@Inirit
Copy link

Inirit commented Sep 14, 2023

When using a v2 URL as the source for a NuGet package, the download of that package will fail with the following pattern of error:

ERROR: An error occurred during the fetch of repository 'nuget.amazon.lambda.serialization.systemtextjson.v2.3.1':
   Traceback (most recent call last):
        File "<bazel_path>/oeeul5lt/external/rules_dotnet/dotnet/private/rules/nuget/nuget_archive.bzl", line 324, column 29, in _nuget_archive_impl
                ctx.download_and_extract(urls, type = "zip", integrity = ctx.attr.sha512, auth = auth)
Error in download_and_extract: java.io.IOException: Error downloading [https://www.nuget.org/api/v2/amazon.lambda.serialization.systemtextjson/2.3.1] to <bazel_path>/oeeul5lt/external/nuget.amazon.lambda.serialization.systemtextjson.v2.3.1/temp2275121979138268792/2.3.1.zip: GET returned 404 Not Found

Looking at nuget_archive.bzl, it seems to be a bug with the string formatting for the URL. The comment claims the URL should be of the form "{source}/package/{id}/{version}", yet the actual URL that gets created is of the form "{source}/{package_id}/{package_version}". Using the URL from the above example error, reformatting it to match the comment will result in a successful package download (https://www.nuget.org/api/v2/package/amazon.lambda.serialization.systemtextjson/2.3.1)

@purkhusid
Copy link
Collaborator

Fixed in 6da67eb on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants