brandedoutcast / publish-nuget

📦 GitHub action to automate publishing NuGet packages when project version changes
https://github.com/marketplace/actions/publish-nuget
MIT License
197 stars 101 forks source link

[BUG] error: Value cannot be null. (Parameter 'path2') #58

Open uiahhh opened 3 years ago

uiahhh commented 3 years ago

Describe the bug My package was published successfully, but after the message "Your package was pushed." I get this error "Value cannot be null. (Parameter 'path2')"

Failed Action Log URL (Required) https://github.com/uiahhh/MongoDB.EntityFramework/runs/2170548370?check_suite_focus=true

To Reproduce https://github.com/uiahhh/MongoDB.EntityFramework/blob/master/.github/workflows/publish-nuget.yml

Expected Behavior No errors after the message "Your package was pushed."

Environment:

uiahhh commented 3 years ago

Log:

...

Your package was pushed. Pushing MongoDB.EntityFramework.0.0.8.snupkg to 'https://www.nuget.org/api/v2/symbolpackage'... PUT https://www.nuget.org/api/v2/symbolpackage/ Created https://www.nuget.org/api/v2/symbolpackage/ 507ms Your package was pushed. error: Value cannot be null. (Parameter 'path2')

....

Error: 😭 error: Value cannot be null. (Parameter 'path2') /home/runner/work/_actions/rohith/publish-nuget/v2/index.js:23 throw new Error(msg) ^

Error: error: Value cannot be null. (Parameter 'path2') at Action._printErrorAndExit (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:23:15) at Action._pushPackage (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:73:18) at IncomingMessage. (/home/runner/work/_actions/rohith/publish-nuget/v2/index.js:109:30) at IncomingMessage.emit (events.js:215:7) at endReadableNT (_stream_readable.js:1184:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)

mrnustik commented 3 years ago

The same thing happened to me.

Failed Action Log URL (Required) https://github.com/mrnustik/EventSourced/runs/2214020819?check_suite_focus=true

To Reproduce https://github.com/mrnustik/EventSourced/blob/main/.github/workflows/publish-packages.yml

Environment:

Deadpikle commented 3 years ago

I am also getting this bug.

https://github.com/NetSparkleUpdater/NetSparkle/runs/2376909443?check_suite_focus=true

https://github.com/NetSparkleUpdater/NetSparkle/blob/develop/.github/workflows/publish-nuget.yml

AndyLPK247 commented 3 years ago

Same: https://github.com/q2ebanking/boa-constrictor/runs/2412796599?check_suite_focus=true

IhnatKlimchuk commented 3 years ago

@AndyLPK247 seems like removing NUGET_SOURCE: https://api.nuget.org can unlock pipeline till proper fix will be introduced or it will be confirmed that it's nuget issue.

AndyLPK247 commented 3 years ago

@IhnatKlimchuk Unfortunately, removing NUGET_SOURCE didn't make the error message go away. :(

Action: https://github.com/q2ebanking/boa-constrictor/blob/main/.github/workflows/nuget-push.yml

Log: https://github.com/q2ebanking/boa-constrictor/runs/2414622347?check_suite_focus=true

IhnatKlimchuk commented 3 years ago

@AndyLPK247 you are right. Sorry, was under wrong impression. It do publish package, but fails right after that. Second run with same version do nothing.

IhnatKlimchuk commented 3 years ago

@AndyLPK247 can you please try INCLUDE_SYMBOLS: false?

thejamesdecker commented 3 years ago

@IhnatKlimchuk removing INCLUDE_SYMBOLS prevented the issue for me.

pl-aknight commented 3 years ago

@IhnatKlimchuk, if I set INCLUDE_SYMBOLS to false or remove it, then this GitHub Action won't generate the NuGet symbols package, right? I'd like to publish the symbols package.

beto-rodriguez commented 3 years ago

Same issue, it publishes the packages successfully. but I get this message all the time.

https://github.com/beto-rodriguez/LiveCharts2/runs/2647802166

waldosax commented 3 years ago

It's something right in here:

        const pushCmd = `dotnet nuget push *.nupkg -s ${this.nugetSource}/v3/index.json -k ${this.nugetKey} --skip-duplicate ${!this.includeSymbols ? "-n 1" : ""}`,
            pushOutput = this._executeCommand(pushCmd, { encoding: "utf-8" }).stdout

        console.log(pushOutput)

        if (/error/.test(pushOutput))
            this._printErrorAndExit(`${/error.*/.exec(pushOutput)[0]}`)

We just logged the entirety of the stdout buffer, but in the very next line, we do a regular expression test of that very same buffer and it finds something which isn't there. /error/ shouldn't match in pushOutput at all.

What's even crazier is the fact that it shouldn't have found that, but it finds a whole line of error information that didn't exist in pushOutput

How, Sway? Where?

is pushOutput a pointer to another buffer once it's been read? Is it a runaway? If so, its pretty consistent. Would it make more sense to push that buffer into a string, explicitly, and then log and regex test on that string, rather than implicitly converting the buffer into a string?

waldosax commented 3 years ago

OK y'all, I got it. Just need the author to merge this change in and it should solve this problem for everyone.

waldosax commented 3 years ago

@IhnatKlimchuk, if I set INCLUDE_SYMBOLS to false or remove it, then this GitHub Action won't generate the NuGet symbols package, right? I'd like to publish the symbols package.

The placement of the space after --skip-duplicate is why this works. And doesn't work when you have symbols to publish.

myblindy commented 3 years ago

Just need the author to merge this change

So, until then?

waldosax commented 3 years ago

It actually does publish the symbols. The build step just appears to fail.

An alternative would be to fork the code (or mine) and run THAT fixed action.

On Aug 24, 2021, at 12:34 PM, Marius Mitea @.***> wrote:

 Just need the author to merge this change

So, until then?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

tihomir-kit commented 2 years ago

So this is merged, but I assume not published as a new version of GitHub Action yet (the latest version is v2.5.5 which was published last year)? Does anyone have any idea when we might get the chance to use this fix? Does anyone besides the repo owner - brandedoutcast have privileges to deploy this fix? Is he willing to publish this fix? The project does seem kind of abandoned.

Thanks!

beto-rodriguez commented 2 years ago

@tihomir-kit it is not merged, after this issue, I realized that now it is super simple to use dotnet nuget command to publish your pack.

https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push

this is what I use:

dotnet nuget push *.nupkg --api-key {insert your key here} --source https://api.nuget.org/v3/index.json

tihomir-kit commented 2 years ago

Ah ok, it's merged in a fork of this repo.

@beto-rodriguez you're using that to deploy from your computer or did you turn it into an action? I want to have this automated so that when I merge into master, it gets published. As little manual work as possible.

Edit: Looks like what you did can be simply added to run inside a step, like this: https://github.com/brandedoutcast/publish-nuget/issues/21#issuecomment-801922295

Might as well switch to that. More flexibility, and one less dependency in the pipeline.

Edit 2: Made the switch, awesome stuff, thanks Beto.

alirezanet commented 2 years ago

until we find @brandedoutcast, you can use this one. I'll try to keep it updated for now

uses: alirezanet/publish-nuget@v3.0.0
gregsdennis commented 2 years ago

Just experienced this myself, so it's still happening. I'll update to use the fork.

(Hi @beto-rodriguez!)