Endpoint Does Not Receive Messages Under Windows Service

The gMSA does have access to SQL Server. The database that Particular’s software (and the SQL transport) resides in also has tables for my application logging and that logging works under the gMSA.

Earlier I had a SQL issue where gMSA ran afoul of NSB pre-startup checks:

Pre-Startup Checks Fail Prior to gMSA Context Being Established by Windows Service

As a result of that issue, I ended up using this configuration for the receiving endpoint (the one that does not receive messages under the Windows service/gMSA):

//Endpoint and database names have been changed
//Program.cs has no NSB configuration

//public static class NServiceBus_BaseConfiguration //configures all endpoints

public static (EndpointConfiguration endpointConfiguration, TransportExtensions<SqlServerTransport> sqlTransport) GetEndpointConfiguration(string endpointName, IConfiguration configuration)
{
    var endpointConfiguration = new EndpointConfiguration(endpointName);

    endpointConfiguration.AuditProcessedMessagesTo("NServiceBus.Audit");
    endpointConfiguration.SendFailedMessagesTo("NServiceBus.Errors");
    endpointConfiguration.UseSerialization<NewtonsoftJsonSerializer>(); // For Custom Events Error emails/logging
    endpointConfiguration.AddDeserializer<XmlSerializer>(); // For transmitting contacts
    //endpointConfiguration.PurgeOnStartup(true); //Very useful for testing

    // Wires up NServiceBus to SQL
    string connectionString = configuration.GetValue<string>("ConnectionStrings:AppDatabase");
    var transport = endpointConfiguration.UseTransport<SqlServerTransport>();
    transport.ConnectionString(connectionString);

    var subscriptions = transport.SubscriptionSettings();
    subscriptions.SubscriptionTableName(tableName: "NServiceBus.SubscriptionRouting");

    // Read settings and connect to NServiceBus ServiceControl, ServicePulse, and ServiceInsight
    #pragma warning disable CS8602 // Dereference of a possibly null reference.
    var NServiceBusConfigPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Configurations\\NServiceBus_MonitorConfiguration.json");
    #pragma warning restore CS8602 // Dereference of a possibly null reference.

    var NServiceBusConfiguration = File.ReadAllText(NServiceBusConfigPath);
    var platformConnection = ServicePlatformConnectionConfiguration.Parse(NServiceBusConfiguration);
    endpointConfiguration.ConnectToServicePlatform(platformConnection);

    // Wires up email notifications processed by NServiceBusCustomEventsHandler
    var conventions = endpointConfiguration.Conventions();
    conventions.DefiningEventsAs(
        type =>
        {
            return typeof(IEvent).IsAssignableFrom(type) ||
                   // include ServiceControl events
                   type.Namespace != null &&
                   type.Namespace.StartsWith("ServiceControl.Contracts");
        });

    endpointConfiguration.EnableInstallers();

    return (endpointConfiguration, transport);
}

//Endpoint2 Worker.cs
//public override async Task<Task> StartAsync(CancellationToken cancellationToken)

var bundledConfigurations = NServiceBus_BaseConfiguration.GetEndpointConfiguration("NServiceBus.Endpoint2", _configuration);
var endpointConfiguration = bundledConfigurations.endpointConfiguration;

endpointConfiguration.DefineCriticalErrorAction(OnCriticalError);

var startableEndpoint = await Endpoint.Create(endpointConfiguration)
    .ConfigureAwait(false);
var endpointInstance = await startableEndpoint.Start()
    .ConfigureAwait(false);
_activeDirectoryEndpointInstance = endpointInstance;

//protected override async Task ExecuteAsync(CancellationToken cancellationToken)

//logging code
await _activeDirectoryEndpointInstance.Stop()
   .ConfigureAwait(false);

I was uncertain as to what logs you want to look at. If these samples are not what you need, please let me know.

Particular.Monitoring (no exceptions, entire contents below)
ServiceControl Monitoring Version: 4.22.0
Selected Transport: ServiceControl.Transports.SqlServer.SqlServerTransportCustomization, ServiceControl.Transports.SqlServer

2023-01-30 04:00:55.3090|5|Warn|NServiceBus.Transport.SqlServer.SqlConnectionFactory|Maximum connection pooling value (Max Pool Size=N) is not configured on the provided connection string. The default value (100) will be used.

Particular.ServiceControl.Audit (only exception below, rest is info level, and warn on 19% disk space remaining)
System.ComponentModel.Win32Exception (0x80004005): The interface is unknown
at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values)
at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values)
at Microsoft.Extensions.Logging.EventLog.WindowsEventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category)
at Microsoft.Extensions.Logging.EventLog.EventLogLogger.WriteMessage(String message, EventLogEntryType eventLogEntryType, Int32 eventId)
at Microsoft.Extensions.Logging.EventLog.EventLogLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func3 formatter) at Microsoft.Extensions.Logging.Logger.<Log>g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func3 formatter, List`1& exceptions, TState& state)

Particular.ServiceControl
Only Info level messages “no batch found to stage” and “No batch found to forward”

Please let me know if you need anything else. Thank you!