-1

I am unable to push a nuget package to GitHub

The following question is nearly identical

Publishing and Consuming GitHub Package Repository with NuGet: Unable to load the service index error

The answer was very helpful as it indicated that the GitHub documentation was out of date. So I followed the revised instructions and still no joy.

I try to push with...

nuget push -source https://nuget.pkg.github.com/mycompany/index.json .\bin\Release\mynugetpackage.1.0.0.nupkg -apikey xxxaaabbb

and the error I get is...

Pushing mynugetpackage.1.0.0.nupkg to 'https://nuget.pkg.github.com/mycompany'...
  PUT https://nuget.pkg.github.com/mycompany/
  NotFound 
https://nuget.pkg.github.com/mycompany/ 471ms

which seems to indicate that the mycompany GitHub package repository does not exist. But the GitHub organization mycompany certainly exists. It seems as though I need to initialize the package repository for mycompany, but I can't find any documentation on how to do that.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
AQuirky
  • 4,691
  • 2
  • 32
  • 51

3 Answers3

1

The issue is apparently you cannot push packages to repositories that are private. As soon as I turned the visibility on my repository public, I could push a package.

This seems like a bug. Certainly nowhere in the documentation does this restriction appear.

You should be able to push packages to private repositories.

UPDATE

It turns out the real problem was the scope of my personal access token. The scope was set to read and write packages but repo scope also required to push a package to a private repo.

AQuirky
  • 4,691
  • 2
  • 32
  • 51
0

this may be an issue with github.com last week I was able to publish to ttps://nuget.pkg.github.com but today it gives the error described above

I have experienced a similar issue last month with pushing to the GitHub docker registry, it was intermittent failing about 8/10 times

Github actions log:
2021-01-21T21:34:45.3916558Z ##[section]Starting: Request a runner to run this job
2021-01-21T21:34:45.8756042Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest'
2021-01-21T21:34:46.0149753Z Can't find any online and idle self-hosted runner in current repository's organization/enterprise account that matches the required labels: 'ubuntu-latest'
2021-01-21T21:34:46.2004629Z Found online and idle hosted runner in current repository's enterprise account that matches the required labels: 'ubuntu-latest'
2021-01-21T21:34:46.3573580Z ##[section]Finishing: Request a runner to run this job
2021-01-21T21:34:54.3282662Z Current runner version: '2.276.0'
2021-01-21T21:34:54.3308509Z ##[group]Operating System
2021-01-21T21:34:54.3309244Z Ubuntu
2021-01-21T21:34:54.3309623Z 18.04.5
2021-01-21T21:34:54.3309934Z LTS
2021-01-21T21:34:54.3310385Z ##[endgroup]
2021-01-21T21:34:54.3310766Z ##[group]Virtual Environment
2021-01-21T21:34:54.3311214Z Environment: ubuntu-18.04
2021-01-21T21:34:54.3311652Z Version: 20201210.0
2021-01-21T21:34:54.3312271Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201210.0/images/linux/Ubuntu1804-README.md
2021-01-21T21:34:54.3312886Z ##[endgroup]
2021-01-21T21:34:54.3314036Z Prepare workflow directory
2021-01-21T21:34:54.3501965Z Prepare all required actions
2021-01-21T21:34:54.3511197Z Getting action download info
2021-01-21T21:34:54.6103985Z Download action repository 'actions/checkout@v2'
2021-01-21T21:34:56.5627897Z Download action repository 'booxmedialtd/ws-action-parse-semver@v1'
2021-01-21T21:34:58.3019389Z Download action repository 'roryprimrose/set-vs-sdk-project-version@v1'
2021-01-21T21:34:59.1877480Z Download action repository 'Rebel028/publish-nuget@v2.6.0'
2021-01-21T21:34:59.7995996Z ##[group]Run actions/checkout@v2
2021-01-21T21:34:59.7996438Z with:
2021-01-21T21:34:59.7996838Z   repository: SomeCompany/dotnetlib
2021-01-21T21:34:59.7997482Z   token: ***
2021-01-21T21:34:59.7997761Z   ssh-strict: true
2021-01-21T21:34:59.7998063Z   persist-credentials: true
2021-01-21T21:34:59.7998351Z   clean: true
2021-01-21T21:34:59.7998616Z   fetch-depth: 1
2021-01-21T21:34:59.7998881Z   lfs: false
2021-01-21T21:34:59.7999152Z   submodules: false
2021-01-21T21:34:59.7999421Z env:
2021-01-21T21:34:59.7999782Z   PACKAGE_ID: SomeCompany.DotNetLib
2021-01-21T21:34:59.8000168Z ##[endgroup]
2021-01-21T21:35:00.2300965Z Syncing repository: SomeCompany/dotnetlib
2021-01-21T21:35:00.2301730Z ##[group]Getting Git version info
2021-01-21T21:35:00.2302608Z Working directory is '/home/runner/work/dotnetlib/dotnetlib'
2021-01-21T21:35:00.2366579Z [command]/usr/bin/git version
2021-01-21T21:35:00.2518653Z git version 2.29.2
2021-01-21T21:35:00.2541336Z ##[endgroup]
2021-01-21T21:35:00.2549508Z Deleting the contents of '/home/runner/work/dotnetlib/dotnetlib'
2021-01-21T21:35:00.2557721Z ##[group]Initializing the repository
2021-01-21T21:35:00.2562551Z [command]/usr/bin/git init /home/runner/work/dotnetlib/dotnetlib
2021-01-21T21:35:00.2643082Z Initialized empty Git repository in /home/runner/work/dotnetlib/dotnetlib/.git/
2021-01-21T21:35:00.2655569Z [command]/usr/bin/git remote add origin https://github.com/SomeCompany/dotnetlib
2021-01-21T21:35:00.2699895Z ##[endgroup]
2021-01-21T21:35:00.2700600Z ##[group]Disabling automatic garbage collection
2021-01-21T21:35:00.2705024Z [command]/usr/bin/git config --local gc.auto 0
2021-01-21T21:35:00.2744609Z ##[endgroup]
2021-01-21T21:35:00.2749309Z ##[group]Setting up auth
2021-01-21T21:35:00.2757117Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-01-21T21:35:00.2796014Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-01-21T21:35:00.3303803Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-01-21T21:35:00.3319220Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-01-21T21:35:00.3590923Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2021-01-21T21:35:00.3639230Z ##[endgroup]
2021-01-21T21:35:00.3639608Z ##[group]Fetching the repository
2021-01-21T21:35:00.3652890Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +141b682a377522b2dee30e48768f71d2fcd61024:refs/tags/v1.0.0-rc.1
2021-01-21T21:35:00.7274685Z remote: Enumerating objects: 12, done.        
2021-01-21T21:35:00.7275111Z remote: Counting objects:   8% (1/12)        
2021-01-21T21:35:00.7275486Z remote: Counting objects:  16% (2/12)        
2021-01-21T21:35:00.7275832Z remote: Counting objects:  25% (3/12)        
2021-01-21T21:35:00.7276200Z remote: Counting objects:  33% (4/12)        
2021-01-21T21:35:00.7276548Z remote: Counting objects:  41% (5/12)        
2021-01-21T21:35:00.7276902Z remote: Counting objects:  50% (6/12)        
2021-01-21T21:35:00.7277241Z remote: Counting objects:  58% (7/12)        
2021-01-21T21:35:00.7277583Z remote: Counting objects:  66% (8/12)        
2021-01-21T21:35:00.7277945Z remote: Counting objects:  75% (9/12)        
2021-01-21T21:35:00.7278283Z remote: Counting objects:  83% (10/12)        
2021-01-21T21:35:00.7278985Z remote: Counting objects:  91% (11/12)        
2021-01-21T21:35:00.7279334Z remote: Counting objects: 100% (12/12)        
2021-01-21T21:35:00.7279698Z remote: Counting objects: 100% (12/12), done.        
2021-01-21T21:35:00.7280083Z remote: Compressing objects:  11% (1/9)        
2021-01-21T21:35:00.7280456Z remote: Compressing objects:  22% (2/9)        
2021-01-21T21:35:00.7280816Z remote: Compressing objects:  33% (3/9)        
2021-01-21T21:35:00.7281171Z remote: Compressing objects:  44% (4/9)        
2021-01-21T21:35:00.7281574Z remote: Compressing objects:  55% (5/9)        
2021-01-21T21:35:00.7281934Z remote: Compressing objects:  66% (6/9)        
2021-01-21T21:35:00.7282301Z remote: Compressing objects:  77% (7/9)        
2021-01-21T21:35:00.7282653Z remote: Compressing objects:  88% (8/9)        
2021-01-21T21:35:00.7283020Z remote: Compressing objects: 100% (9/9)        
2021-01-21T21:35:00.7283390Z remote: Compressing objects: 100% (9/9), done.        
2021-01-21T21:35:00.7329472Z remote: Total 12 (delta 0), reused 8 (delta 0), pack-reused 0
2021-01-21T21:35:00.7448310Z From https://github.com/SomeCompany/dotnetlib
2021-01-21T21:35:00.7460101Z  * [new ref]         141b682a377522b2dee30e48768f71d2fcd61024 -> v1.0.0-rc.1
2021-01-21T21:35:00.7479921Z ##[endgroup]
2021-01-21T21:35:00.7484449Z ##[group]Determining the checkout info
2021-01-21T21:35:00.7502460Z ##[endgroup]
2021-01-21T21:35:00.7503178Z ##[group]Checking out the ref
2021-01-21T21:35:00.7504309Z [command]/usr/bin/git checkout --progress --force refs/tags/v1.0.0-rc.1
2021-01-21T21:35:00.7638510Z Note: switching to 'refs/tags/v1.0.0-rc.1'.
2021-01-21T21:35:00.7639229Z 
2021-01-21T21:35:00.7639861Z You are in 'detached HEAD' state. You can look around, make experimental
2021-01-21T21:35:00.7640341Z changes and commit them, and you can discard any commits you make in this
2021-01-21T21:35:00.7640820Z state without impacting any branches by switching back to a branch.
2021-01-21T21:35:00.7641103Z 
2021-01-21T21:35:00.7641464Z If you want to create a new branch to retain commits you create, you may
2021-01-21T21:35:00.7642105Z do so (now or later) by using -c with the switch command. Example:
2021-01-21T21:35:00.7642360Z 
2021-01-21T21:35:00.7642804Z   git switch -c <new-branch-name>
2021-01-21T21:35:00.7643001Z 
2021-01-21T21:35:00.7643274Z Or undo this operation with:
2021-01-21T21:35:00.7643454Z 
2021-01-21T21:35:00.7643696Z   git switch -
2021-01-21T21:35:00.7643860Z 
2021-01-21T21:35:00.7644217Z Turn off this advice by setting config variable advice.detachedHead to false
2021-01-21T21:35:00.7644514Z 
2021-01-21T21:35:00.7644756Z HEAD is now at 141b682 ...
2021-01-21T21:35:00.7645185Z ##[endgroup]
2021-01-21T21:35:00.7685657Z [command]/usr/bin/git log -1 --format='%H'
2021-01-21T21:35:00.7727367Z '141b682a377522b2dee30e48768f71d2fcd61024'
2021-01-21T21:35:00.7894232Z ##[group]Run booxmedialtd/ws-action-parse-semver@v1
2021-01-21T21:35:00.7894594Z with:
2021-01-21T21:35:00.7895013Z   input_string: refs/tags/v1.0.0-rc.1
2021-01-21T21:35:00.7895356Z   version_extractor_regex: \/v(.*)$
2021-01-21T21:35:00.7895630Z env:
2021-01-21T21:35:00.7896004Z   PACKAGE_ID: SomeCompany.DotNetLib
2021-01-21T21:35:00.7896376Z ##[endgroup]
2021-01-21T21:35:00.8414806Z ##[group]Run roryprimrose/set-vs-sdk-project-version@v1
2021-01-21T21:35:00.8415184Z with:
2021-01-21T21:35:00.8415451Z   version: 1.0.0-rc.1
2021-01-21T21:35:00.8415737Z   projectFilter: **/*.*proj
2021-01-21T21:35:00.8416020Z env:
2021-01-21T21:35:00.8416382Z   PACKAGE_ID: SomeCompany.DotNetLib
2021-01-21T21:35:00.8416754Z ##[endgroup]
2021-01-21T21:35:00.8898305Z 
2021-01-21T21:35:00.8902954Z Finding projects matching **/*.*proj
2021-01-21T21:35:00.8903728Z 
2021-01-21T21:35:00.8904768Z Updating project files with the following version information
2021-01-21T21:35:00.8905926Z Version: 1.0.0-rc.1
2021-01-21T21:35:00.9147733Z 
2021-01-21T21:35:00.9148630Z 
2021-01-21T21:35:00.9150282Z Found project at /home/runner/work/dotnetlib/dotnetlib/SomeCompany.DotNetLib.csproj
2021-01-21T21:35:00.9214137Z Updating Version with the value 1.0.0-rc.1
2021-01-21T21:35:00.9338470Z ##[group]Run Rebel028/publish-nuget@v2.6.0
2021-01-21T21:35:00.9338809Z with:
2021-01-21T21:35:00.9339233Z   PROJECT_FILE_PATH: SomeCompany.DotNetLib.csproj
2021-01-21T21:35:00.9339802Z   PACKAGE_NAME: SomeCompany.DotNetLib
2021-01-21T21:35:00.9340196Z   VERSION_STATIC: 1.0.0-rc.1
2021-01-21T21:35:00.9340487Z   TAG_COMMIT: false
2021-01-21T21:35:00.9340998Z   NUGET_KEY: ***
2021-01-21T21:35:00.9341382Z   NUGET_SOURCE: https://nuget.pkg.github.com/SomeCompany
2021-01-21T21:35:00.9341752Z   INCLUDE_SYMBOLS: true
2021-01-21T21:35:00.9342089Z   VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$
2021-01-21T21:35:00.9342396Z   TAG_FORMAT: v*
2021-01-21T21:35:00.9342684Z   THOW_ERROR_IF_VERSION_EXISTS: false
2021-01-21T21:35:00.9342970Z env:
2021-01-21T21:35:00.9343339Z   PACKAGE_ID: SomeCompany.DotNetLib
2021-01-21T21:35:00.9343717Z ##[endgroup]
2021-01-21T21:35:00.9775191Z executing: [dotnet nuget add source https://nuget.pkg.github.com/SomeCompany/index.json --name=default --username=myusername --*** --store-password-in-clear-text]
2021-01-21T21:35:06.7366050Z 
2021-01-21T21:35:06.7367012Z Welcome to .NET 5.0!
2021-01-21T21:35:06.7368084Z ---------------------
2021-01-21T21:35:06.7368567Z SDK Version: 5.0.101
2021-01-21T21:35:06.7368847Z 
2021-01-21T21:35:06.7369182Z Telemetry
2021-01-21T21:35:06.7369688Z ---------
2021-01-21T21:35:06.7370951Z The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
2021-01-21T21:35:06.7371688Z 
2021-01-21T21:35:06.7372790Z Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
2021-01-21T21:35:06.7373918Z 
2021-01-21T21:35:06.7374511Z ----------------
2021-01-21T21:35:06.7376693Z Installed an ASP.NET Core HTTPS development certificate.
2021-01-21T21:35:06.7377623Z To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
2021-01-21T21:35:06.7378410Z Learn about HTTPS: https://aka.ms/dotnet-https
2021-01-21T21:35:06.7378989Z ----------------
2021-01-21T21:35:06.7379654Z Write your first app: https://aka.ms/dotnet-hello-world
2021-01-21T21:35:06.7380378Z Find out what's new: https://aka.ms/dotnet-whats-new
2021-01-21T21:35:06.7381101Z Explore documentation: https://aka.ms/dotnet-docs
2021-01-21T21:35:06.7381671Z Report issues and find source on GitHub: https://github.com/dotnet/core
2021-01-21T21:35:06.7382498Z Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
2021-01-21T21:35:06.7383338Z --------------------------------------------------------------------------------------
2021-01-21T21:35:06.7384192Z Package source with Name: default added successfully.
2021-01-21T21:35:06.7384535Z 
2021-01-21T21:35:06.7385018Z executing: [dotnet nuget list source]
2021-01-21T21:35:07.1692751Z executing: [dotnet nuget enable source default]
2021-01-21T21:35:07.5291185Z Registered Sources:
2021-01-21T21:35:07.5292077Z   1.  nuget.org [Enabled]
2021-01-21T21:35:07.5292659Z       https://api.nuget.org/v3/index.json
2021-01-21T21:35:07.5293185Z   2.  default [Enabled]
2021-01-21T21:35:07.5293747Z       https://nuget.pkg.github.com/SomeCompany/index.json
2021-01-21T21:35:07.5294201Z 
2021-01-21T21:35:07.5294807Z Package source with Name: default enabled successfully.
2021-01-21T21:35:07.5295227Z 
2021-01-21T21:35:07.5295832Z Project Filepath: SomeCompany.DotNetLib.csproj
2021-01-21T21:35:07.5297066Z Version: 1.0.0-rc.1
2021-01-21T21:35:07.5297721Z Package Name: SomeCompany.DotNetLib
2021-01-21T21:35:07.5298527Z This is GPR, changing url for versioning...
2021-01-21T21:35:07.5299334Z https://nuget.pkg.github.com/SomeCompany/download/SomeCompany.DotNetLib/index.json
2021-01-21T21:35:07.8163314Z Status code: 200: OK
2021-01-21T21:35:07.8185105Z This version is new, pushing...
2021-01-21T21:35:07.8191136Z ✨ found new version (1.0.0-rc.1) of SomeCompany.DotNetLib
2021-01-21T21:35:07.8191771Z NuGet Source: https://nuget.pkg.github.com/SomeCompany
2021-01-21T21:35:07.8196344Z executing: [dotnet build -c Release SomeCompany.DotNetLib.csproj]
2021-01-21T21:35:08.4553400Z Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
2021-01-21T21:35:08.4554845Z Copyright (C) Microsoft Corporation. All rights reserved.
2021-01-21T21:35:08.4556123Z 
2021-01-21T21:35:11.6713234Z   Determining projects to restore...
2021-01-21T21:35:26.7150347Z   Restored /home/runner/work/dotnetlib/dotnetlib/SomeCompany.DotNetLib.csproj (in 13.99 sec).
2021-01-21T21:35:34.6009835Z   SomeCompany.DotNetLib -> /home/runner/work/dotnetlib/dotnetlib/bin/Release/net5.0/SomeCompany.DotNetLib.dll
2021-01-21T21:35:34.6269565Z 
2021-01-21T21:35:34.6270770Z Build succeeded.
2021-01-21T21:35:34.6271286Z     0 Warning(s)
2021-01-21T21:35:34.6271770Z     0 Error(s)
2021-01-21T21:35:34.6272149Z 
2021-01-21T21:35:34.6272697Z Time Elapsed 00:00:25.92
2021-01-21T21:35:34.6481756Z executing: [dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release SomeCompany.DotNetLib.csproj -o .]
2021-01-21T21:35:34.9172951Z Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
2021-01-21T21:35:34.9173542Z Copyright (C) Microsoft Corporation. All rights reserved.
2021-01-21T21:35:34.9173794Z 
2021-01-21T21:35:36.4807333Z   Successfully created package '/home/runner/work/dotnetlib/dotnetlib/SomeCompany.DotNetLib.1.0.0-rc.1.nupkg'.
2021-01-21T21:35:36.4848834Z   Successfully created package '/home/runner/work/dotnetlib/dotnetlib/SomeCompany.DotNetLib.1.0.0-rc.1.snupkg'.
2021-01-21T21:35:36.5067101Z Generated Package(s): SomeCompany.DotNetLib.1.0.0-rc.1.nupkg, SomeCompany.DotNetLib.1.0.0-rc.1.snupkg
2021-01-21T21:35:36.5069263Z executing: [dotnet nuget push *.nupkg -s default -k *** --skip-duplicate ]
2021-01-21T21:35:37.3597726Z Pushing SomeCompany.DotNetLib.1.0.0-rc.1.nupkg to 'https://nuget.pkg.github.com/SomeCompany'...
2021-01-21T21:35:37.3598984Z   PUT https://nuget.pkg.github.com/SomeCompany/
2021-01-21T21:35:37.3599634Z   NotFound https://nuget.pkg.github.com/SomeCompany/ 338ms
2021-01-21T21:35:37.3600286Z error: Response status code does not indicate success: 404 (Not Found).
2021-01-21T21:35:37.3600703Z 
2021-01-21T21:35:37.3600985Z 
2021-01-21T21:35:37.3601498Z Usage: dotnet nuget push [arguments] [options]
2021-01-21T21:35:37.3601816Z 
2021-01-21T21:35:37.3602568Z Arguments:
2021-01-21T21:35:37.3603118Z   [root]  Specify the path to the package and your API key to push the package to the server.
2021-01-21T21:35:37.3603564Z 
2021-01-21T21:35:37.3603940Z Options:
2021-01-21T21:35:37.3604746Z   -h|--help                      Show help information
2021-01-21T21:35:37.3606487Z   --force-english-output         Forces the application to run using an invariant, English-based culture.
2021-01-21T21:35:37.3607832Z   -s|--source <source>           Package source (URL, UNC/folder path or package source name) to use. Defaults to DefaultPushSource if specified in NuGet.Config.
2021-01-21T21:35:37.3608849Z   -ss|--symbol-source <source>   Symbol server URL to use.
2021-01-21T21:35:37.3609757Z   -t|--timeout <timeout>         Timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).
2021-01-21T21:35:37.3610641Z   -k|--api-key <apiKey>          The API key for the server.
2021-01-21T21:35:37.3611427Z   -sk|--symbol-api-key <apiKey>  The API key for the symbol server.
2021-01-21T21:35:37.3612676Z   -d|--disable-buffering         Disable buffering when pushing to an HTTP(S) server to decrease memory usage.
2021-01-21T21:35:37.3613901Z   -n|--no-symbols                If a symbols package exists, it will not be pushed to a symbols server.
2021-01-21T21:35:37.3614890Z   --no-service-endpoint          Does not append "api/v2/package" to the source URL.
2021-01-21T21:35:37.3615882Z   --interactive                  Allow the command to block and require manual action for operations like authentication.
2021-01-21T21:35:37.3617012Z   --skip-duplicate               If a package and version already exists, skip it and continue with the next package in the push, if any.
2021-01-21T21:35:37.3617477Z 
2021-01-21T21:35:37.3619162Z /home/runner/work/_actions/Rebel028/publish-nuget/v2.6.0/index.js:44
2021-01-21T21:35:37.3621869Z ##[error] error: Response status code does not indicate success: 404 (Not Found).
2021-01-21T21:35:37.3625811Z         throw new Error(msg)
2021-01-21T21:35:37.3626167Z         ^
2021-01-21T21:35:37.3626367Z 
2021-01-21T21:35:37.3626876Z Error: error: Response status code does not indicate success: 404 (Not Found).
2021-01-21T21:35:37.3627925Z     at Action._printErrorAndExit (/home/runner/work/_actions/Rebel028/publish-nuget/v2.6.0/index.js:44:15)
2021-01-21T21:35:37.3628867Z     at Action._pushPackage (/home/runner/work/_actions/Rebel028/publish-nuget/v2.6.0/index.js:95:18)
2021-01-21T21:35:37.3629749Z     at IncomingMessage.<anonymous> (/home/runner/work/_actions/Rebel028/publish-nuget/v2.6.0/index.js:151:30)
2021-01-21T21:35:37.3630357Z     at IncomingMessage.emit (events.js:215:7)
2021-01-21T21:35:37.3630839Z     at endReadableNT (_stream_readable.js:1184:12)
2021-01-21T21:35:37.3631353Z     at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-01-21T21:35:37.3712765Z Post job cleanup.
2021-01-21T21:35:37.4744452Z [command]/usr/bin/git version
2021-01-21T21:35:37.4819055Z git version 2.29.2
2021-01-21T21:35:37.4865812Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-01-21T21:35:37.4915283Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-01-21T21:35:37.5248078Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-01-21T21:35:37.5274602Z http.https://github.com/.extraheader
2021-01-21T21:35:37.5286498Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2021-01-21T21:35:37.5335820Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-01-21T21:35:37.5770506Z Cleaning up orphan processes
2021-01-21T21:35:37.6317787Z Terminate orphan process: pid (2841) (dotnet)

As you can see:

2021-01-21T21:35:07.5299334Z https://nuget.pkg.github.com/SomeCompany/download/SomeCompany.DotNetLib/index.json
2021-01-21T21:35:07.8163314Z Status code: 200: OK
2021-01-21T21:35:07.8185105Z This version is new, pushing...

the registry exists and a list of versions can be retrieved

2021-01-21T21:35:37.3597726Z Pushing SomeCompany.DotNetLib.1.0.0-rc.1.nupkg to 'https://nuget.pkg.github.com/SomeCompany'...
2021-01-21T21:35:37.3598984Z   PUT https://nuget.pkg.github.com/SomeCompany/
2021-01-21T21:35:37.3599634Z   NotFound https://nuget.pkg.github.com/SomeCompany/ 338ms
2021-01-21T21:35:37.3600286Z error: Response status code does not indicate success: 404 (Not Found).

but the push fails

Erd
  • 11
  • 1
  • 2
  • Just now figured out what the problem was (at least with my package)...the repository was private. As soon as I turned it public, I could push the package. – AQuirky Jan 22 '21 at 02:11
  • 10 days ago I was able to push with a private repo. Hopefully that gets fixed soon as I can't make my repos public – Erd Jan 22 '21 at 21:52
  • GitHub support just got back to me. My problem was the scope of the personal access token. Has to include both repo and read/write packages. – AQuirky Jan 23 '21 at 01:13
0

You many need to check that your Repository Url in your project is set correctly. Nuget Push always returning 404 (Not Found)

I had this error and was able to solve it by fixing my repo url.

jjnguy
  • 136,852
  • 53
  • 295
  • 323