Upgrade 3 -> 3.1.1 issue

Hi

Currently trying to upgrade from 3.0.3 to 3.1.1.

It’s failing to update the database on script 16 with the error ‘Invalid object name ‘EventRelatedDocument’.’

Logs:
2015-09-22 16:22:58.4931 6 INFO The Octopus server is starting: Initializing database and performing migrations…
2015-09-22 16:22:59.3041 6 INFO Beginning database upgrade
2015-09-22 16:22:59.3151 6 INFO Fetching list of already executed scripts.
2015-09-22 16:22:59.3491 6 INFO Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0013 - Fix Release_WithDeploymentProcess view.sql’
2015-09-22 16:23:00.1711 6 INFO Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0014 - Drop ActivityLog.sql’
2015-09-22 16:23:00.2021 6 INFO Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0015 - Dashboard View.sql’
2015-09-22 16:23:00.3521 6 INFO Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0016 - Add DeployedBy column.sql’
2015-09-22 16:23:00.4851 6 INFO Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0016 - Event join table.sql’
2015-09-22 16:23:00.5721 6 INFO Creating join records for all events, this may take a few minutes depending on the number of events
2015-09-22 16:23:00.5721 6 INFO SQL exception has occured in script: 'Octopus.Core.UpgradeScripts.Script0016 - Event join table.sql’
2015-09-22 16:23:00.5721 6 ERROR Script block number: 4; Block line 6; Message: EventInsertUpdateTrigger
2015-09-22 16:23:00.5911 6 ERROR System.Data.SqlClient.SqlException (0x80131904): Invalid object name ‘EventRelatedDocument’.
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, 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 DbUp.Support.SqlServer.SqlScriptExecutor.<>c__DisplayClass7.b__4(Func1 dbCommandFactory) at DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary2 variables)
ClientConnectionId:9c8b7229-5a07-498d-9ec1-26543b5af018
Error Number:208,State:1,Class:16

Any idea on how to resolve or roll back the server version?

Managed to fix this, the AD user had the wrong schema associated with it. It had db_owner and not dbo.

Chester