OctopusDeploy / Issues

| Public | Bug reports and known issues for Octopus Deploy and all related tools
https://octopus.com
162 stars 20 forks source link

Auto-deploy with large numbers of machines throws "too many parameters" exception #2860

Closed MarkSiedle closed 7 years ago

MarkSiedle commented 8 years ago

If you have a project trigger setup that fires for a large number of machines, one of the MachineFinder queries maxes out on parameters and throws an exception.

System.Data.SqlClient.SqlException (0x80131904): The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
...
   at Octopus.Server.Schedules.AutoDeployments.MachineFinder.GetMachinesThatHaveTriggered(Nullable`1 fromDate, DateTimeOffset toDate) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Schedules\AutoDeployments\MachineFinder.cs:line 52

Important Note This is occurring because of a long-running deployment completing (e.g. a deploy that ran for weeks, possibly due to waiting on manual interventions etc). Auto-deploy then triggers and looks for all events that have occurred since the deployment began, which results in thousands of events, which then explodes the query with too many parameters.

Two things need to be fixed:

Steps to reproduce

Note to dev reviewing: It may help to temporarily disable the auto-deploy scheduler while you create the >2100 machines locally, then re-launch with the schedule enabled again, so it processes all these machines at one time. Otherwise the schedule may start running before you have > 2100 machines to process at once.

^ This should force all machines to be included in the auto-deploy trigger and throw the exception

Source: http://help.octopusdeploy.com/discussions/problems/47932

octoreleasebot commented 7 years ago

Release Note: Auto-deploy performance improvements to better handle long-running deployments (you can also deploy to more than 2100 machines now)

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.