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

[Bug]: dotnet nuget push not working after GitHub packages changes (10/10/22) #12161

Closed
Sergio0694 opened this issue Oct 14, 2022 · 5 comments
Closed

Comments

@Sergio0694
Copy link

Sergio0694 commented Oct 14, 2022

NuGet Product Used

dotnet.exe

Product Version

Using 6.0.402 .NET SDK, but don't think it's version specific

Worked before?

Yes, been working fine for months

Impact

I'm unable to use this version (I can't push to GitHub packages at all)

Repro Steps & Context

This is a new issue after dotnet/sdk#28545 was closed and redirected here.


Describe the bug

It seems the new "Consolidated owner and admin role" changes in GitHub packages are causing CI steps pushing to GitHub packages to fail, and I couldn't find a clear explanation on how to fix this through dotnet nuget push. See: Sergio0694/ComputeSharp#403. I'm currently using this command:

dotnet nuget push "artifacts\*.nupkg" --source "https://nuget.pkg.github.com/ComputeSharp/index.json" --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate

Which so far has always worked just fine. This broke a few days ago following those changes. Is there guidance on how to update scripts using dotnet nuget push to account for these recent GitHub changes? Not sure what additional params I should pass, if any.

To Reproduce

See this CI run: https://github.com/Sergio0694/ComputeSharp/actions/runs/3242075036/jobs/5315478395.

Exception

Pushing ComputeSharp.Pix.2.0.0-alpha.3242075036+6131b7f9b0d2ee95c98e5e76a5f5bafe62ef74ae.nupkg to 'https://nuget.pkg.github.com/ComputeSharp'...
  PUT https://nuget.pkg.github.com/ComputeSharp/
warn : Source owner 'ComputeSharp' does not match repo owner 'Sergio0694' in repository element.
  BadRequest https://nuget.pkg.github.com/ComputeSharp/ 380ms
error: Response status code does not indicate success: 400 (Bad Request).

Further technical details

  • Using the 6.0.402 .NET SDK
@dominoFire
Copy link
Contributor

@ghost
Copy link

ghost commented Oct 14, 2022

Issue is missing Type label, remember to add a Type label

@ghost ghost added the missing-required-type The required type label is missing. label Oct 14, 2022
@ghost ghost removed the missing-required-type The required type label is missing. label Oct 14, 2022
@Sergio0694
Copy link
Author

Hi @dominoFire, I'm not sure this issue was closed correctly:

  • I had previously opened an issue at dotnet nuget push not working after GitHub packages changes (10/10/22) dotnet/sdk#28545, as I figured it might be related to dotnet CLI itself. That was closed and I was told to open an issue here. Now this is closed too and I'm told once again to open an issue somewhere else. This is very frustrating, and if this is actually the case we should tell the folks in the dotnet CLI repo to update their rules so that others won't be bounced back and forth like this again if they find issues with dotnet push.
  • I did follow the steps in the troubleshooting list you mention. And I should clarify: my CI script to push to GitHub packages has been working fine for months. It just started failing a few days ago. I didn't make any changes to my scripts or package identities, that's why I don't really understand what is going on here.

I'll post in that community link you shared. I will say though I'm quite confused as to how it's possible that GitHub, of all things, doesn't just use GitHub issues like everyone else, and instead redirects people to something completely different 🤷

@zivkan
Copy link
Member

zivkan commented Oct 15, 2022

@Sergio0694 The error message you copied here says:

Source owner 'ComputeSharp' does not match repo owner 'Sergio0694' in repository element.

This message is coming from the "server" (GitHub Package Repository), not from NuGet itself. Perhaps NuGet needs to make this more explicit. But in any case, since it's the server that's rejecting the package, it's not a NuGet or .NET SDK issue. A different server implementation would accept the package, so I don't see anything actionable from the NuGet team (except maybe making it more explicit that GitHub/the remote server, is trying to get your attention with a specific message).

@DPatrickBoyd
Copy link

in case anyone is scratching their head trying to fix this, I tracked down @Sergio0694 's github, and saw that he changed the source to the org or user level index, instead of the index for the repo itself

in their case it was changing
https://nuget.pkg.github.com/ComputeSharp/index.json

to

https://nuget.pkg.github.com/${{github.repository_owner}}/index.json

this also works for organizational level builds as well (at least for me), so if you replace repository_owner with your org name, it should work

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

No branches or pull requests

4 participants