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

octopus package nuget create generates invalid NuGet packages #477

Open
dionrhys opened this issue Jan 29, 2025 · 0 comments
Open

octopus package nuget create generates invalid NuGet packages #477

dionrhys opened this issue Jan 29, 2025 · 0 comments

Comments

@dionrhys
Copy link

The bug

The octopus package nuget create command generates nupkg files without metadata required by certain NuGet external feed providers supported by Octopus Deploy (e.g. Cloudsmith) to treat them as valid. When pushing these NuGet packages to the external feed, the request is rejected.

The old dotnet.octopus.cli tool (dotnet octo) created valid NuGet packages that could be pushed to feeds like Cloudsmith. This tool appears to be deprecated.

There also exists a NuGet CLI tool (nuget.exe), however this no longer works on Ubuntu 24.04 as it relies on Mono, which is no longer supported.

The newer dotnet pack tooling does not support creating NuGet packages out of plain files as is expected by Octopus Deploy's feeds. (It relies on a .csproj project being passed in to generate a .NET library package)

Command to reproduce

mkdir -p input
touch input/test.txt
octopus package nuget create --id test --version 0.1 --author "Required to generate nuspec" --base-path input --out-folder . --verbose --no-prompt
dotnet nuget push -s "https://<Cloudsmith feed url>/v3/index.json" -k "<Cloudsmith API key>" test.0.1.nupkg

Outcome

Here's the console output that happens right now:

Pushing test.0.1.nupkg to 'https://<Cloudsmith feed url>/v2/package'...
  PUT https://<Cloudsmith feed url>/v2/package/
  BadRequest https://<Cloudsmith feed url>/v2/package/ 867ms
error: Response status code does not indicate success: 400 (Bad Request).

Using Fiddler, I caught the HTTP response body to be the following:

{"ok": false, "error": "Could not upload artifact: Failed to get .rels XML from NuGet package and find .nuspec XML"}

When using the older tool dotnet octo pack instead, valid NuGet packages are created and these can be pushed to NuGet external feeds like Cloudsmith.

Versions

cli: 2.14.2

Octopus Server: N/A

Links

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

1 participant