Error during 'Retention' task


I’ve noticed that the Retention task is running into an Error and I believe this is preventing packages in the built-in Nuget repo from being cleaned up.

Here is the 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.
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 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at Octopus.Core.RelationalStorage.TransientFaultHandling.IDbCommandExtensions.<>c__DisplayClass5_0.b__0() in Y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\TransientFaultHandling\IDbCommandExtensions.cs:line 67
at Microsoft.WindowsAzure.Common.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__231.MoveNext() in Y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 237
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer) at Octopus.Core.RelationalStorage.QueryBuilder1.ToDictionary(Func2 keySelector) in Y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\QueryBuilder.cs:line 123 at Octopus.Server.Orchestration.Retention.ApplyRetentionPoliciesTaskController.ApplyRetentionPolicy(Lifecycle lifecycle, IList1 projects, IList1 releases) in Y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Retention\ApplyRetentionPoliciesTaskController.cs:line 143 at Octopus.Server.Orchestration.Retention.ApplyRetentionPoliciesTaskController.ApplyRetentionPolicy(IGrouping2 policy) in Y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Retention\ApplyRetentionPoliciesTaskController.cs:line 124
at Octopus.Shared.Tasks.OctoThreadClosure`1.Execute() in Y:\work\refs\heads\master\source\Octopus.Shared\Tasks\OctoThreadClosure.cs:line 29
Error Number:8003,State:1,Class:16
Octopus.Server version (3.0.24+Branch.master.Sha.b1f228f5d4aee7be52d7c207516b5a5f2193ad52)

Any insight into how to fix this would be appreciated.

Octopus Version


You have stumbled onto a bug that we thought we had fixed in a previous release, but it seems that we haven’t quite got it fixed.

I have raised #2059 to have this fixed as soon as we can.

I am sorry for the inconvenience this issue may be causing you, but I hope we can get a fix for it out too you very soon.

Thank you and warm regards,

Will this be a fix in the New version of the Octopus server? Currently we do not run .NET 4.5.2 so updating past Octopus 3.0.x won’t be a quick solution.

Is there a work around we can do? With this Child Task failing, the Package Retention task is not executing and our Octopus server disk is filling up constantly.


This fix would be done in a 3.1.x release (or 3.2, depending on when someone picks it up to fix). There’s no hard dependency on .NET4.5.2, just .NET4.5. What server OS are you running your Octopus instance on?

Thank you and kind regards,

Just an update to this issue. A fix for this bug has been made and it should be included in the 3.2.1 in the next day or two.
Please keep an eye out and give it a try once available. Hopefully it solves your issue.