Skip to content

[C++][CI][ODBC] Resolve push to nuget timeout issue by adding timeout option #48606

Closed

Description

@alinaliBQ

Describe the enhancement requested

When uploading big sized binaries to nuget, we see timeout errors due to package taking more than default 300 seconds to upload. Suggest to make timeout settable inside ci/scripts/cpp_build.sh.

Log:

Uploading binaries for google-cloud-cpp[core,rest-common,storage]:x64-windows@2.36.0 to NuGet from GitHub
error: "C:\ProgramData\Chocolatey\bin\nuget.exe" push -ForceEnglishOutput -Verbosity detailed -NonInteractive "D:\a\arrow\arrow\vcpkg\buildtrees\google-cloud-cpp_x64-windows.2.36.0-vcpkg2cc2ca3336e27ccdce9fcbc7693bc6a1d934f231d1d0800ef4319f10e205b3a4.nupkg" -Timeout 100 -Source GitHub failed with exit code 1
NuGet Version: 7.0.1.1
Pushing google-cloud-cpp_x64-windows.2.36.0-vcpkg2cc2ca3336e27ccdce9fcbc7693bc6a1d934f231d1d0800ef4319f10e205b3a4.nupkg to 'https://nuget.pkg.github.com/apache'...
  PUT https://nuget.pkg.github.com/apache/
A task was canceled.
  Pushing took too long. You can change the default timeout of 300 seconds by using the -Timeout <seconds> option with the push command.
System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpRetryHandler.<>c__DisplayClass5_1.<<SendAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.TimeoutUtility.<StartWithTimeout>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at NuGet.Protocol.HttpRetryHandler.<SendAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpSource.<GetThrottledResponse>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   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.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageToServer>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageCore>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackagePath>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.ThrowForNonSuccess(Task task)
   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.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__40.MoveNext()
   --- End of inner exception stack trace ---
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__40.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)
---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpRetryHandler.<>c__DisplayClass5_1.<<SendAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.TimeoutUtility.<StartWithTimeout>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at NuGet.Protocol.HttpRetryHandler.<SendAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpSource.<GetThrottledResponse>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   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.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageToServer>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackageCore>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at NuGet.Protocol.Core.Types.PackageUpdateResource.<PushPackagePath>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   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.ThrowForNonSuccess(Task task)
   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.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__40.MoveNext()<---

---> (Inner Exception #1) System.Exception: Pushing took too long. You can change the default timeout of 300 seconds by using the -Timeout <seconds> option with the push command.<---


note: while pushing NuGet package

Component(s)

C++

Activity

  1. kou commented on Dec 23, 2025

    @kou
    Member

    Could you try this?

    https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching

    diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
    index 3545f1c16a..1e91f62487 100644
    --- a/.github/workflows/ruby.yml
    +++ b/.github/workflows/ruby.yml
    @@ -352,7 +352,7 @@ jobs:
           CMAKE_CXX_STANDARD: "20"
           CMAKE_GENERATOR: Ninja
           CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist"
    -      VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
    +      VCPKG_BINARY_SOURCES: 'clear;nugettimeout,600;nuget,GitHub,readwrite'
           VCPKG_DEFAULT_TRIPLET: x64-windows
         permissions:
           packages: write
  2. alinaliBQ commented on Dec 23, 2025

    @alinaliBQ
    CollaboratorAuthor

    @kou Thanks for the suggestion Kou, I have applied the change to cpp_extra.yml in 8260a0c as I currently don't have the capacity to make changes to ruby.yml. The C++ Extra CI job doesn't have new packages to push to nuget this time (likely because another CI job did it already), so I couldn't reproduce the timeout issue right away. I think the suggested fix should work though

  3. added a commit that references this issue on Dec 24, 2025
  4. kou commented on Dec 24, 2025

    @kou
    Member

    OK. I've opened #48638.

  5. added a commit that references this issue on Dec 30, 2025
  6. added this to the 23.0.0 milestone on Dec 30, 2025
  7. kou commented on Dec 30, 2025

    @kou
    Member

    Issue resolved by pull request 48638
    #48638

  8. alinaliBQ commented on Jan 2, 2026

    @alinaliBQ
    CollaboratorAuthor

    Thanks kou!

  9. changed the title [-][C++][CI] Resolve push to nuget timeout issue by adding timeout option[/-] [+][C++][CI][ODBC] Resolve push to nuget timeout issue by adding timeout option[/+] on Jan 28, 2026
  10. added a commit that references this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions