-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: dotnet nuget push symbols not working as expected #11871
Comments
@jmecosta I was able to reproduce the issue using the same command line you used (changing the URLs to the localhost server I was testing with). I found that by not specifying the But we should not be silently ignoring the symbols package or silently failing, so that needs to be fixed. |
@zivkan thanks for confirming the problem |
@zivkan maybe related but: dotnet nuget push TeklaFusion.4.0.4.snupkg --source http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget/v3/index.json also doest do anything. i supose the SymbolPackagePublish is also missing from that source |
@jmecosta I just remembered that there have been some changes to push over the last 2 years:
If you're on Windows, it would be great if you could try downloading NuGet.exe versions 5.8 and 6.1 from https://nuget.org/downloads, and try them out (perhaps with the |
6.2.1.2 not working |
Just tested this with the current dev branch (6.5) and it is not working either. @zivkan This loop here expects a path for every package, one for .nupkg and one for .snupkg. But the command handler calling this method only allows for a single argument to pass through. But given that .snupkg should be handled automatically without the user explicitly specifying it as an argument, there probably should be some code in between those methods that handles looking for .snupkg next to the supplied .nupkg. Could you give an update about this issue? |
@jwfx we prioritize work based on a number of factors, one of which is upvotes. This issue doesn't have any upvotes yet, so might not have caught the eye of people triaging issues during sprint planning. This issue was created when it was my turn on the support rotation, and I just validated that the issue can be reproduced but support doesn't have enough time to bugfix. |
Thank you for the update and for linking that document. Hitting this issue directly from a search engine, that policy totally went past me. |
Just for information for anyone else hitting this from search engine: To clarify - the follwoing would not work but instead only publish the package on <add key="Artifactory" value="https://......./api/nuget/v3/xyz-local" />
<add key="ArtifactorySymbols" value="https://....../api/nuget/v3/xyz-local/symbols" /> However, changing the source definition to following: <add key="Artifactory" value="https://......./api/nuget/v3/xyz-local" protocolVersion="3" />
<add key="ArtifactorySymbols" value="https://....../api/nuget/v3/xyz-local/symbols" /> Magically makes everything work as expected - i.e. a simple ❗ However - due to #9170 still being open, we now have to manually fix the config file as part of our CI pipeline 😞 |
@jmecosta The unexpected behavior of the |
can confirm for local pushes
does
Leaving out the symbol-source parameter, will lead to havinig the snupkg being silently ignored.
|
Same issue with nuget |
Just noticed that I'm getting |
Looking here: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/Utility/CommandRunnerUtility.cs#L107-L110 I found when stepping through with a debugger: if (packageSource == null)
{
packageSource = new PackageSource(source);
} Should probably be: if (packageSource == null)
{
packageSource = new PackageSource(source)
{
ProtocolVersion = 3
};
} This seems to cause the |
I also cannot find an execution path that sets: if (string.IsNullOrEmpty(symbolSource)
&& !noSymbols
&& !sourceUri.IsFile
&& sourceUri.IsAbsoluteUri)
{
symbolPackageUpdateResource = await CommandRunnerUtility.GetSymbolPackageUpdateResource(sourceProvider, source);
if (symbolPackageUpdateResource != null)
{
symbolSource = symbolPackageUpdateResource.SourceUri.AbsoluteUri;
}
} After this point Which causes: bool isSymbolEndpointSnupkgCapable = symbolPackageUpdateResource != null; To always be false. I suspect somewhere in here: // Precedence for symbol package API key: -SymbolApiKey param, config, package API key (Only for symbol source from SymbolPackagePublish service)
if (!string.IsNullOrEmpty(symbolSource))
{
symbolApiKey ??= CommandRunnerUtility.GetApiKey(settings, symbolSource, symbolSource);
// Only allow falling back to API key when the symbol source was obtained from SymbolPackagePublish service
if (symbolPackageUpdateResource != null)
{
symbolApiKey ??= apiKey;
}
} The |
What worked for me:
<add key="Artifactory" value="https://......./api/nuget/v3/xyz-local" protocolVersion="3" />
dotnet nuget push "A.nupkg" -s https://......./api/nuget/v3/xyz-local -k <YOUR API KEY> |
More than 2 years and still open? 😒 |
This doesn't upload the .snupkg. |
So we are at the end of 2024 and using NET 8 this is still an issue which is shameful. I was trying to move from symbols.nupkg to snupkgs but after a day testing different things I was not able to upload it to JFrog Artifactory. Doing something like this: Will upload only the nupkg and do nothing with its snupkg. And if I try to upload the snupkg doing something like: Then the command ends without any error or any log, but of course it didn't upload anything. So now I will go back to symbols.nupkg... |
I have the same issue. I was able to push the .snupkg, but only if I don't define a sub-directory directory (which is not an option in my company). So I would like to run this command line (but it doesn't take the .snupkg): dotnet nuget push ./packages/MyLib.*.nupkg \
--source "https://artifactory.tld/artifactory/api/nuget/v3/nuget/MyLib" \
--api-key "~~APIKEY~~"
# Only pushes the .nupkg.
# Notice the "/MyLib" at the end of the URL, that allows me to push the package. But this command line worked, but I can't push to a sub-dir: dotnet nuget push ./packages/MyLib.*.nupkg \
--source "https://artifactory.tld/artifactory/api/nuget/v3/nuget/index.json" \
--api-key "~~APIKEY~~"
# This pushed both the .nupkg and .snupkg, but the problem is that this command line pushes
# the packages at the root of the repository, and I need to push them under "MyLib/" I really don't see how to fix this issue 🤨 |
we are using this to publish symbols, in fact ive already given up on snpkg format, pretty much that package is just a package with pdbs that need to be index in artifactory... so this works
In artifactory as far as i know you need to specify /symbols which is something non standard, so i wouldnt be blaming nuget tooling beucase of how Artifactory implemented this |
I think I found a solution.. though don't know yet if it's a workaround or the expected behavior. My main issue was that I needed to push the .nupkg into a sub-directory in our Artifactory (and not at the root). But apparently, symbols can't be stored at the same place as your .nupkg. They seem to be stored at the root, under a # GitLab CI:
publish-nuget-packages:
variables:
ARTIFACTORY: 'https://artifactory.tld/artifactory/api/nuget/v3/nuget'
ARTIFACTORY_SYMBOL: 'https://artifactory.tld/artifactory/api/nuget/v3/nuget/index.json'
script:
# Push the packages first, and then the symbols. This is necessary because we push the .nupkg
# under MyLib/, but it's not possible to push symbols under a directory.
- dotnet nuget push ./packages/MyLib.*.nupkg
--source "${ARTIFACTORY}/MyLib" --api-key "${ARTIFACTORY_API_KEY}"
- dotnet nuget push ./packages/MyLib.*.snupkg
--source "${ARTIFACTORY_SYMBOL}" --api-key "${ARTIFACTORY_API_KEY}"
Edit 2: nope.. we do need 2 different URLs. |
NuGet Product Used
dotnet.exe
Product Version
6.0.300
Worked before?
No response
Impact
No response
Repro Steps & Context
Hi,
Ive raised a ticket on our nuget server provider (proget) and they said that "dotnet nuget push" is a "bit" buggy with when using "*" argument... Wanted to report this buggy behaviour here so can help them also clarify a bit the behaviour:
dotnet nuget push --source http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget/v3/index.json *.nupkg --symbol-source http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget-symbols/v3/index.json --api-key KEY --symbol-api-key OTHERKEY --skip-duplicate
this pushes only the .nupkg
Pushing TeklaFusion.4.0.4.nupkg to 'http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget/package'...
PUT http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget/package/
Created http://ts-nuget.teklaad.tekla.com/nuget/ts-nuget/package/ 263ms
Your package was pushed.
The TeklaFusion.4.0.4.snupkg is never published or even detect looks like it by the CLI tooling....
thanks in advance for the clarification
jorge costa
Ive originally raise ticket on dotnet side, dotnet/sdk#25958 but they closed it .
Verbose Logs
No response
The text was updated successfully, but these errors were encountered: