System.ObjectDisposedException: Cannot access a disposed object

Hey, I´m trying to set up a fresh instance of Service Control.

I created an empty database with no messages and connected it to a Service Control instance.

However, everytime I try to run it, it gives me a bunch of errors, like it is proccessing some old queue I´m not aware of. Then Service Control simply stops on its own.

Where is it getting these messages from? I have tried deleting old projects from my PC but I don´t get where these failed messages are coming from.

I get hundreds of errors like these, on a fresh, empty SQL database:

2021-09-28 07:09:44.2730|29|Error|NServiceBus.RecoverabilityExecutor|Moving message '23b3a8c7-fe46-4735-8845-8bb557ceff99' to the error queue 'Particular.Servicecontrol.Errors' because processing failed due to an exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'LoggerFactory'.
   at Microsoft.Extensions.Logging.LoggerFactory.CreateLogger(String categoryName)
   at NServiceBus.Extensions.Hosting.LoggerFactory.GetLogger(String name) in     /_/src/NServiceBus.Extensions.Hosting/Logging/LoggerFactory.cs:line 16
   at NServiceBus.CriticalError.Raise(String errorMessage, Exception exception) in /_/src/NServiceBus.Core/CriticalError/CriticalError.cs:line 46
   at NServiceBus.Transport.SqlServer.ReceiveStrategy.<HandleError>d__15.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/Receiving/ReceiveStrategy.cs:line 94
--- 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.ProcessWithNativeTransaction.<TryProcess>d__3.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/Receiving/ProcessWithNativeTransaction.cs:line 87
--- 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.ProcessWithNativeTransaction.<ReceiveMessage>d__1.MoveNext() in /_/src/NServiceBus.Transport.SqlServer/Receiving/ProcessWithNativeTransaction.cs:line 45

So ServiceControl fills my new Database with rows like this:
{"NServiceBus.EnclosedMessageTypes":"ServiceControl.Plugin.CustomChecks.Messages.ReportCustomCheckResult","NServiceBus.ContentType":"application\/json","NServiceBus.MessageIntent":"Send","NServiceBus.MessageId":"47f44b83-c334-4ad6-bea2-11e8367c5426","NServiceBus.ExceptionInfo.ExceptionType":"System.ObjectDisposedException","NServiceBus.ExceptionInfo.HelpLink":null,"NServiceBus.ExceptionInfo.Message":"Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.","NServiceBus.ExceptionInfo.Source":"Autofac"..............

Audit shows similar errors

2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.RavenBootstrapper|Loading Embedded RavenDB license
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Database initialization starting
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Database initialization complete
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Index creation started
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Index creation complete
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Data migrations starting
2021-09-28 14:05:47.5365|66|Info|ServiceControl.Audit.Infrastructure.RavenDB.EmbeddedRavenDbHostedService|Data migrations complete
2021-09-28 14:05:47.6847|67|Info|ServiceControl.Audit.Auditing.AuditIngestion|Ensure started. Infrastructure starting
2021-09-28 14:05:47.7698|28|Error|NServiceBus.CustomChecks.TimerBasedPeriodicCheck|'ServiceControl.Audit.Auditing.FailedAuditImportCustomCheck' implementation failed to run.
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Raven.Client.Connection.HttpJsonRequestFactory'.
   at Raven.Client.Connection.HttpJsonRequestFactory.CreateHttpJsonRequest(CreateHttpJsonRequestParams createHttpJsonRequestParams)
   at Raven.Client.Connection.Async.AsyncServerClient.<DirectStreamQuery>d__137.MoveNext()

Hi VictorMS,

It looks that you are using SqlTransport and it processes messages that are (most likely) in the error queue.

What is the version of ServiceControl that you are setting up?

Cheers,
Tomek