Particular / ServiceControl

Backend for ServiceInsight and ServicePulse
https://docs.particular.net/servicecontrol/
Other
52 stars 47 forks source link

Upgrading shows Invalid object name 'xxxx.dbo.SubscriptionRouting'. in the log #3523

Open ramonsmits opened 1 year ago

ramonsmits commented 1 year ago

Describe the bug

Description

Upgrading resulted in the following error being shown in the ServiceControl log:

2023-05-16 16:50:33.4226|12|Error|ServiceControl.ExternalIntegrations.EventDispatcherHostedService|Failed dispatching external integration event. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'XXXX.dbo.SubscriptionRouting'.

Upgrading happened from version 3.8.4 to 4.30.0 using SQL Transport

Maybe has something to do with the previous version not yet using SQL Transport native pubsub which is causing this during the upgrade.

Expected behavior

For this log entry to now be shown.

Versions

Upgrading happened from version 3.8.4 to 4.30.0 using SQL Transport

Could be other versions affected too.

Steps to reproduce

  1. Create SC v3.8.4 instance using SQL Transport
  2. Upgrade to 4.30.0
  3. Inspect log file

Relevant log output

2023-05-16 16:50:33.4226|12|Error|ServiceControl.ExternalIntegrations.EventDispatcherHostedService|Failed dispatching external integration event.
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'XXXX.dbo.SubscriptionRouting'.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
   at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at Microsoft.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader(Boolean isInternal, Boolean forDescribeParameterEncryption)
   at Microsoft.Data.SqlClient.SqlCommand.InternalEndExecuteReader(IAsyncResult asyncResult, String endMethod, Boolean isInternal)
   at Microsoft.Data.SqlClient.SqlCommand.EndExecuteReaderInternal(IAsyncResult asyncResult)
   at Microsoft.Data.SqlClient.SqlCommand.EndExecuteReaderAsync(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.Transport.SqlServer.SubscriptionTable.<GetSubscribers>d__7.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/PubSub/SubscriptionTable.cs:line 79
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.Transport.SqlServer.MulticastToUnicastConverter.<Convert>d__2.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/PubSub/MulticastToUnicastConverter.cs:line 18
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.Transport.SqlServer.MessageDispatcher.<ConvertToUnicastOperations>d__2.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/Sending/MessageDispatcher.cs:line 49
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.Transport.SqlServer.MessageDispatcher.<Dispatch>d__1.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/Sending/MessageDispatcher.cs:line 33
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.SerializeMessageConnector.<Invoke>d__1.MoveNext() in /_/src/NServiceBus.Core/Pipeline/Outgoing/SerializeMessageConnector.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NServiceBus.MigrationModePublishConnector.<Invoke>d__1.MoveNext() in /_/src/NServiceBus.Core/Routing/SubscriptionMigrationMode/MigrationModePublishConnector.cs:line 40
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at ServiceControl.ExternalIntegrations.EventDispatcherHostedService.<TryDispatchEventBatch>d__6.MoveNext() in /_/src/ServiceControl/ExternalIntegrations/EventDispatcherHostedService.cs:line 152

ClientConnectionId:7c187dc5-1b50-4825-b4f3-b97a4ab8e744

Error Number:208,State:1,Class:16

Additional Information

When the instance is restarted the log entry is not logged anymore but it was suggested by @cquirosj that this might only happen during a migration and not during a regular start of SC.

ramonsmits commented 1 year ago