Skip to content

[Bug]: when delivering nuget packages to github packages, some nugets missing #4064

@SteveKrisjanovsD365

Description

@SteveKrisjanovsD365

BCContainerhelper version

6.1.10

Describe the issue

We're looking to leverage private nugets of our PTE apps with our third party developers to consume (full apps, not symbols-only). We figured out the al-go side of it but we need to manually create nugets (outside al-go) for the most recent of our PTEs release since it appears that nuget push functionality in al-go only fires off on CI/CD workflows and the release version of our PTEs are already created.

it appears that not all nugets are uploading. in my case, one nuget is uploading and one nuget doesn't (I even queried the github API to prove the missing nuget doesn't exist at all). I also tried navigating to the missing package via github (full URL to package) and I get a 404.

subsequent attempts to push the missing nuget from CLI results in a "package exists" and nothing is uploaded.

The missing package was never soft deleted to cause this "package exists" behaviour

Copilot theorizes that the nuget created for this one app may be faulty (a bug in bccontainerhelper's New-BcNuGetPackage?) preventing github from indexing the package for visibility and preventing us from pushing the same version of this new nuget package up to github.

I'd be happy to securely share the affected app to reproduce.

We've seen this behaviour with some other PTEs we're trying to push to our private nuget repo (about 25% of the apps never make it to nuget)

how trustworthy is nuget + github? I was under the impression its experimental.

Command or script used to produce the issue

I created a classic PAT for my github developer account with permissions repo, packages:read, packages:write. the same token is used to create and upload both nugets.

the github packages registry is org-scoped.

we have two apps to upload so I ran the following two commands for each app:

$packageFullName = New-BcNuGetPackage -appfile "full path to app file"
Push-BcNuGetPackage -nuGetServerUrl $feedUrl -nuGetToken $pat -bcNuGetPackage $packageFullName

one nuget uploads but the other nuget does not

Full output of the command or script

below is the console out when creating the nuget and pushing it.

New-BcNuGetPackage -appfile 'C:\D365\extensions\365V-Cannabis-PTE release 2600.202511.0\365Vertical_365 Cannabis Base PTE (SaaS)_2600.202511.0.52.app'
Create NuGet package
AppFile:
C:\D365\extensions\365V-Cannabis-PTE release 2600.202511.0\365Vertical_365 Cannabis Base PTE (SaaS)_2600.202511.0.52.app
NUSPEC file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <metadata>
        <id>365Vertical.365CannabisBasePTESaaS.546ca09b-a854-44df-b2bb-214e2aac9abf</id>
        <version>2600.202511.0.52</version>
        <title>365 Cannabis Base PTE (SaaS)</title>
        <description>365 Cannabis Base PTE (SaaS)</description>
        <authors>365Vertical</authors>
        <dependencies>
            REDACTED
            <dependency id="Microsoft.Application" version="26.0.0.0" />
            <dependency id="Microsoft.Platform" version="1.0.0.0" />
        </dependencies>
    </metadata>
    <files>
        <file src="365Vertical_365 Cannabis Base PTE (SaaS)_2600.202511.0.52.app" target="365Vertical_365 Cannabis Base PTE (SaaS)_2600.202511.0.52.app" />
    </files>
</package>
Successfully created NuGet package (Size: 149Kb)

Push-BcNuGetPackage -nuGetServerUrl 'REDACTED' -nuGetToken 'REDACTED' -bcNuGetPackage 'C:\Users\Steve Krisjanovs\AppData\Local\Temp\365Vertical.365CannabisBasePTESaaS.546ca09b-a854-44df-b2bb-214e2aac9abf-2600.202511.0.52.nupkg'
Preparing NuGet Package for submission
Submitting NuGet package
NuGet package already exists

I also attempted pushing up the nuget via nuget CLI and this is the console output - note the http 409 conflict response, wven though the package is "missing" from github packages:

nuget push "C:\Users\Steve Krisjanovs\AppData\Local\Temp\365Vertical.365CannabisBasePTESaaS.546ca09b-a854-44df-b2bb-214e2aac9abf-2600.202511.0.52.nupkg" `
>>   -Source "REDACTED" `
>>   -ApiKey "REDACTED" `
>>   -ForceEnglishOutput -verbosity detailed
NuGet Version: 6.14.0.116
Pushing 365Vertical.365CannabisBasePTESaaS.546ca09b-a854-44df-b2bb-214e2aac9abf-2600.202511.0.52.nupkg to 'https://nuget.pkg.github.com/365Vertical'...
  PUT https://nuget.pkg.github.com/365Vertical/
WARNING: Error: Version 2600.202511.0.52 of "365Vertical.365CannabisBasePTESaaS.546ca09b-a854-44df-b2bb-214e2aac9abf" has already been pushed.
  Conflict https://nuget.pkg.github.com/365Vertical/ 474ms
To skip already published packages, use the option -SkipDuplicate
Response status code does not indicate success: 409 (Conflict).
System.Net.Http.HttpRequestException: Response status code does not indicate success: 409 (Conflict).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at NuGet.Protocol.Core.Types.PackageUpdateResource.EnsureSuccessStatusCode(HttpResponseMessage response, Nullable`1 codeNotToThrow, ILogger logger)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<>c__DisplayClass27_0.<PushPackageToServer>b__0(HttpResponseMessage response)
   at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageToServer>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageCore>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackagePath>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Commands.PushRunner.<Run>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args, IEnvironmentVariableReader environmentVariableReader)

Additional information

No response

Does this happen every time?

Yes

Did this used to work?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions