We originally noticed this problem (and reported it) as cannot create Octo release from command line (http://help.octopusdeploy.com/discussions/problems/46613-octopus-command-line-failing-to-create-release-since-upgrade-to-3322) but the problem is much more severe. It turns out that we cannot manually create releases or deploy them using the server GUI either.
I’ve attached server information and a log from an attempt to create a release using the command line tool during a TeamCity build. Below is the error from an attempt to deploy an existing release from the server.
Error while executing SQL command: The correlation name ‘ALIAS_AAAAA’ is specified multiple times in a FROM clause.
The command being executed was:
SELECT COUNT() FROM (SELECT * FROM dbo.[Deployment] WHERE (ProjectId in (@projectIds_0)) AND (EnvironmentId in (@environments_0))) ALIAS_AAAAA INNER JOIN (SELECT * FROM dbo.[ServerTask] WHERE (State = @taskState)) ALIAS_AAAAA ON ALIAS_AAAAA.TaskId = ALIAS_AAAAA.Id
System.Exception: Error while executing SQL command: The correlation name ‘ALIAS_AAAAA’ is specified multiple times in a FROM clause.
The command being executed was:
SELECT COUNT() FROM (SELECT * FROM dbo.[Deployment] WHERE (ProjectId in (@projectIds_0)) AND (EnvironmentId in (@environments_0))) ALIAS_AAAAA INNER JOIN (SELECT * FROM dbo.[ServerTask] WHERE (State = @taskState)) ALIAS_AAAAA ON ALIAS_AAAAA.TaskId = ALIAS_AAAAA.Id —> System.Data.SqlClient.SqlException: The correlation name ‘ALIAS_AAAAA’ is specified multiple times in a FROM clause.
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, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 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.ExecuteScalar()
at Octopus.Core.RelationalStorage.TransientFaultHandling.IDbCommandExtensions.<>c__DisplayClass11_0.b__0() in Y:\Work\refs\tags\3.3.22\source\Octopus.Core\RelationalStorage\TransientFaultHandling\IDbCommandExtensions.cs:line 119
at Octopus.Shared.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) in Y:\Work\refs\tags\3.3.22\source\Octopus.Shared\TransientFaultHandling\RetryPolicy.cs:line 213 at Octopus.Core.RelationalStorage.RelationalTransaction.ExecuteScalar[T](String query, CommandParameters args) in Y:\Work\refs\tags\3.3.22\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 392 --- End of inner exception stack trace --- at Octopus.Core.RelationalStorage.RelationalTransaction.ExecuteScalar[T](String query, CommandParameters args) in Y:\Work\refs\tags\3.3.22\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 400 at Octopus.Core.RelationalStorage.QueryBuilder
1.ToList(Int32 skip, Int32 take, Int32& totalResults) in Y:\Work\refs\tags\3.3.22\source\Octopus.Core\RelationalStorage\QueryBuilder.cs:line 121
at Octopus.Server.Web.Api.Actions.DeploymentsQueryResponder.Execute() in Y:\Work\refs\tags\3.3.22\source\Octopus.Server\Web\Api\Actions\DeploymentsQueryResponder.cs:line 64
at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Y:\Work\refs\tags\3.3.22\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\Work\refs\tags\3.3.22\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
OctopusDeploy-636044382025384218.zip (163 KB)
Server_Side_Octopus_Release_8.9.18105.2217_1831_.log.zip (4 KB)