question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade from v2 -> v3, nuget push ends with "File does not exist (true)" and fails the action

See original GitHub issue

Description:

With v2, the following command succeeded:

run: dotnet nuget push .artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/MyOrg/index.json --skip-duplicaten --no-symbols true

From v3, it fails.

Task version:

v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted (on Github)
  • Self-hosted

Repro steps:

Have a step like the following:

deploy:
  name: deploy
  runs-on: ubuntu-latest
  steps:
    # checkout the code
    - name: checkout-code
      uses: actions/checkout@v3
      with:
        fetch-depth: 0
    # setup dotnet based on global.json
    - name: setup-dotnet
      uses: actions/setup-dotnet@v2
    - name: pack
      run: make pack
    # push it to nuget
    - name: deploy
      run: dotnet nuget push .artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/MyOrg/index.json --skip-duplicate --no-symbols true

Now, change setup-dotnet@v2 to setup-dotnet@v3. Observe that the step will now fail after it successfully pushes all NuGet packages. The error is:

File does not exist (true)

Expected behavior:

Before and after upgrade should behave the same.

Actual behavior:

After upgrade, error is raised. Full error looks something like this:

 Pushing MyComp.Extensions.Xunit.1.0.0-alpha.0.96.nupkg to 'https://nuget.pkg.github.com/MyOrg'...
  PUT https://nuget.pkg.github.com/MyOrg/
  OK https://nuget.pkg.github.com/MyOrg/ 1130ms
Your package was pushed.
error: File does not exist (true).

Usage: dotnet nuget push [arguments] [options]

Arguments:
  [root]  Specify the path to the package and your API key to push the package to the server.

More info

This seems to have been caused by this error in the NuGet client: https://github.com/NuGet/Home/issues/11601.

I don’t know if this can be fixed in the setup-dotnet package, but clearly this was working in v2, and now it isn’t anymore. I assume that this action has a dependency on the NuGet client, so the error may ultimately be external, but since it is caused by updating setup-dotnet, I feel like it should be a tracked bug here as well.

Workaround

Remove --no-symbols true from the commandline. This should be benign (if you don’t have symbols, it doesn’t do anything), but as shown, it causes the above error.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IvanZosimovcommented, Dec 6, 2022

Yes, I’m closing this issue 😉 Thank you!

1reaction
abelbraaksmacommented, Dec 6, 2022

Yes, as was explained in the referenced issue, in particular this comment: https://github.com/NuGet/Home/issues/11601#issuecomment-1042503383.

I wasn’t aware that --no-symbols without a parameter also works (the workaround I mentioned was removing that param completely). Also, I thought the error was caused by something else in the end (after all, the packages do get published).

Apparently NuGet changed the cmdline parsing and now treats an argument after --no-symbols as a file. Thanks for diving into this, I didn’t make the connect with global.json. It all makes sense now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reinstalling and Updating NuGet Packages - Microsoft Learn
Package update broke the project: If an update to a package breaks a project, the failure is generally caused by a dependency package...
Read more >
How to push nuget package in GitHub actions - Stack Overflow
For some reason this works consistently, but using basic auth (password in nuget. config file) fails randomly!
Read more >
CLI for JFrog Artifactory
In JFrog CLI v1, the default value of the --flat option is true. ... the command to return exit code 2 in case...
Read more >
Create packages with OctoPack - Octopus Deploy
After the build completes, you will find a NuGet package in the output ... If you don't provide a NuSpec file, OctoPack will...
Read more >
NuGet Restore fails with MSBuild version 16.9.0.16703
I upgraded all of the NuGet packages to the latest, I updated the project to use the 4.7.2 framework and many other things...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found