Encountering a: An error was encountered when fetching 'PUT https://nuget.pkg.github.com/...' error

Hi,

I’m trying to push a package to my damageboy/yaap repo.

First of all, there is a conflict in the instructions, on my own page I see these instructions:

Please note that those instructions are contradicting the general instructions because they instruct me to use:

-Source "https://nuget.pkg.github.com/damageboy/yaap/index.json"

(note: damageboy/yaap).

Where the instructions on setting up a nuget package registry instruct me to use:

-Source "https://nuget.pkg.github.com/_OWNER_/index.json"

 (note: OWNER -> damageboy only)

At any rate, both methods seem to not work for me.

When I use the following in my nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="DamageboyGitHub" value="https://nuget.pkg.github.com/damageboy/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <DamageboyGitHub>
        <add key="Username" value="damageboy" />
        <add key="ClearTextPassword" value="PAT_GOES_HERE" />
      </DamageboyGitHub>
  </packageSourceCredentials>
</configuration>

(Where PAT_GOES_HERE contains a personal access token I’ve created for myself)

and I try to push from my own machine, I get this:

nuget push nupkg/Yaap.0.6.6-ci-ga553f47d65.nupkg -Source DamageboyGitHub
WARNING: No API Key was provided and no API Key could be found for 'https://nuget.pkg.github.com/damageboy'. To save an API Key for a source use the 'setApiKey' command.
Pushing Yaap.0.6.6-ci-ga553f47d65.nupkg to 'https://nuget.pkg.github.com/damageboy'...
  PUT https://nuget.pkg.github.com/damageboy/
An error was encountered when fetching 'PUT https://nuget.pkg.github.com/damageboy/'. The request will now be retried.
An error occurred while sending the request.
  The server returned an invalid or unrecognized response.
  PUT https://nuget.pkg.github.com/damageboy/
An error was encountered when fetching 'PUT https://nuget.pkg.github.com/damageboy/'. The request will now be retried.
An error occurred while sending the request.
  The server returned an invalid or unrecognized response.
  PUT https://nuget.pkg.github.com/damageboy/
An error occurred while sending the request.
  The server returned an invalid or unrecognized response.

Can anyone help me as to what I’m doing wrong?

I’ve contacted support and was instructed to follow the example I provided of only using the owner, but nothing seems to be working thus far.

5 Likes

Looks like I have the same problem with github package registry: https://github.com/linksplatform/Interfaces/commit/d72865c2aba6b009d4192dd97593471a1b4015d6/checks?check_suite_id=272165890

There is an issue at NuGet project about this: https://github.com/NuGet/Home/issues/8580 (at the moment it does not work on Linux).

Yes, have to push packages from Windows.

Are there any updates to this? It’s difficult to understand whether this is a GitHub Packages or ‘dotnet nuget’ CLI issue. I have raised the following issue on the NuGet repo:

Here is another issue discussing the same issue: