Hi Rob,
Thank you for the quick response. We have had retention policies enabled since initial install, though this is the first time this particular error has been encountered.
We have a pipeline in Go that deploys an Octopus project every hour that only creates a new Octopus release when changes have been pushed to Go, otherwise it uses the last release from Octopus. In this instance there hadn’t been changes pushed to Go in ~3 weeks so it was calling the same Octopus release which caused the huge deployment history. We are looking at forcing Go to create new releases at certain intervals to avoid this issue as an interim solution.
As for the raw task log, it looks like we only have the last 4 instances of the “Apply Retention Policies” task in Octopus’s task log so I am unable to find the full data there. I do have the error trace that was being thrown though, hopefully it contains enough info to be helpful:
14:00:23.613 Error from Octopus server (HTTP 500): Octopus Server returned an error: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request.
14:00:23.613 Server exception:
14:00:23.613 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.
14:00:23.613 at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
14:00:23.613 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
14:00:23.613 at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
14:00:23.613 at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
14:00:23.613 at System.Data.SqlClient.SqlDataReader.get_MetaData()
14:00:23.613 at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
14:00:23.613 at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
14:00:23.613 at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
14:00:23.613 at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
14:00:23.613 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
14:00:23.613 at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
14:00:23.613 at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
14:00:23.613 at Octopus.Core.RelationalStorage.TransientFaultHandling.IDbCommandExtensions.<>c__DisplayClass5_0.<ExecuteReaderWithRetry>b__0() in Y:\work\refs\tags\3.2.17\source\Octopus.Core\RelationalStorage\TransientFaultHandling\IDbCommandExtensions.cs:line 67
14:00:23.613 at Octopus.Shared.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func) in Y:\work\refs\tags\3.2.17\source\Octopus.Shared\TransientFaultHandling\RetryPolicy.cs:line 215
14:00:23.613 at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__24`1.MoveNext() in Y:\work\refs\tags\3.2.17\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 241
14:00:23.613 at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
14:00:23.613 at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
14:00:23.613 at Octopus.Core.RelationalStorage.QueryBuilder`1.ToDictionary(Func`2 keySelector) in Y:\work\refs\tags\3.2.17\source\Octopus.Core\RelationalStorage\QueryBuilder.cs:line 138
14:00:23.613 at Octopus.Server.Web.Api.Actions.DeploymentTemplateAction.Execute() in Y:\work\refs\tags\3.2.17\source\Octopus.Server\Web\Api\Actions\DeploymentTemplateAction.cs:line 58
14:00:23.613 at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Y:\work\refs\tags\3.2.17\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
14:00:23.613 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
14:00:23.613 at CallSite.Target(Closure , CallSite , Object , Object , NancyContext )
14:00:23.613 at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\work\refs\tags\3.2.17\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
14:00:23.613 at CallSite.Target(Closure , CallSite , Func`2 , Object )
14:00:23.613 at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)