GitHub Package Registry - NuGet - 400 Bad Request

I am trying to upload a package for modders on my repository (console application) and I have set up nuget.exe using the GitHub Package Registry configuration for NuGet steps on Help.

When I tried to push my .nupkg file to GitHub, using nuget.exe, I got an error after uploading, saying 400 Bad Request.

I have set the API key to the source, because I think it is a root cause, but when I tried to upload it with new changes, the same 400 Bad Request error appears.

I used nuget push KS.0.0.6.13.symbols.nupkg -Source “GitHub - KS” for uploading to GitHub NuGet repo. I have set the site as “https://nuget.pkg.github.com/EoflaOE/index.json” and username as “EoflaOE”.

My repository is .NET Framework 4.7.x console application, and is found at “https://github.com/EoflaOE/Kernel-Simulator”, for future reference. It is a kernel simulator that can be an API for making modifications that compile and run inside an app.

2 Likes

Did you ever resole or figure this out @eoflaoe ?

As I have the same issue with my package by trying to use the new GitHub Actions CI YML Workflows

https://github.com/warrenbuckley/Take-Out-The-Trash/runs/196791261

No @warrenbuckley, nobody knew yet.

@warrenbuckley Did you get the notification saying that you’re accepted? I didn’t.

I contacted them and they said that I am on the list but not accepted yet.

Hmm I am pretty sure I got an email to say I was accepted for this.

I have a support ticket I am waiting to hear back from on how to use this in GitHub Actions, but they have not told me that I am NOT in the BETA, so I assume I am.

Still, I did not get an email. Can you please tell them to add me to the beta? If you do, I will let you be a member of my project.

@warrenbuckley See the above message

Just raised a support ticket for similar NuGet problems - I get “invalid response” from GH Package Repo every time I try to push, but NuGet works fine so I know the package is okay. On package repo and actions beta so I’ll let you know if I hear anything

@stoiveyp Thanks! The problem on my end is that GitHub didn’t accept my beta request, and I have to wait for months. What can I do to let them speed up?

@stoiveyp wrote:

Just raised a support ticket for similar NuGet problems - I get “invalid response” from GH Package Repo every time I try to push, but NuGet works fine so I know the package is okay. On package repo and actions beta so I’ll let you know if I hear anything

I have exactly the same problem - got granted access yesterday, but it fails whenever I try to push to the repository.

I have been accepted, pushed a package, and works fine. Did you put the GitHub username as the username, and the API key as a password? @tonyfonager 

1 Like

I got it working, but it actually relies on the content of the NuGet package.

I tried making a new “Hello World” package, and I could deploy that without issues to GPR.

But all other projects fails.

And I should maybe mention that whenever they fail, I try nuget push’ing them to my Azure Artifacts feed, and that works ecvery time without issues.

Well, I can upload NuGet packages with debugging symbols to GitHub Package Registry successfully. Do you, by chance, have put in unusual variables and values in your nuspec? You can send them a ticket by emailing GitHub with the title of “GitHub Package Registry”. @tonyfonager 

I have the same problem too. We are trying to push nuget packages to GitHub Package Registry via Azure DevOps pipeline.

@toanxyz Are you sure that you are authenticated correctly, and that you have used your API key as the password? You can e-mail GitHub.

I’m getting this error as well. I was able to upload a single version last Friday, but yesterday and today I get error 400 when trying to upload artifacts.

1 Like

@tonyfonager Can you elaborate on this? What content of the nuget package matters? I am having the same issue and am unable to determine what is causing it.

For those who can’t get this to work, we have come up with a workaround using curl here https://github.com/NuGet/Home/issues/8580#issuecomment-555696372, at least until GitHub fixes problem of not allowing the apiToken to work directly using the nuget push command. 

4 Likes

Thank you! The team did work with me for a while and ended up in a place where the suggested fix was using a NuSpec file. But your workaround does the trick and means I can keep my other processes as needed

For anyone who haven’t specified RepositoryUrl and RepositoryType, you might get this error. Check this link for more details.