I also try to mount the ca and use it like
mongodb://acc:pwd@mongodb-cms.co.com:27017,mongodb-cms.co.com:27018,mongodb-cms.co.com:27019/admin?maxPoolSize=5000&replicaSet=mongodb-cms&authSource=admin&tls=true&tlsCAFile=%2Fapp%2Fcert-ca%2FrootCA.pem
and it still doesn’t work. I can use this with the same ca.pem to connect to the DB from my local machine.
I am pretty sure it is related to the connection string, because if I use a connection that is used inside the k8s, it works fine. However, I can’t do that since my database is on a different cluster.
Error logs is like this
Unhandled exception. System.ArgumentOutOfRangeException: Value is not between 0 and 1024: 5000. (Parameter 'initialCount')
at MongoDB.Driver.Core.Misc.Ensure.IsBetween[T](T value, T min, T max, String paramName)
at MongoDB.Driver.Core.Misc.SemaphoreSlimSignalable..ctor(Int32 initialCount)
at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool..ctor(ServerId serverId, EndPoint endPoint, ConnectionPoolSettings settings, IConnectionFactory connectionFactory, IEventSubscriber eventSubscriber, IConnectionExceptionHandler connectionExceptionHandler)
at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPoolFactory.CreateConnectionPool(ServerId serverId, EndPoint endPoint, IConnectionExceptionHandler connectionExceptionHandler)
at MongoDB.Driver.Core.Servers.Server..ctor(ClusterId clusterId, IClusterClock clusterClock, ClusterConnectionMode clusterConnectionMode, ConnectionModeSwitch connectionModeSwitch, Nullable`1 directConnection, ServerSettings settings, EndPoint endPoint, IConnectionPoolFactory connectionPoolFactory, IEventSubscriber eventSubscriber, ServerApi serverApi)
at MongoDB.Driver.Core.Servers.DefaultServer..ctor(ClusterId clusterId, IClusterClock clusterClock, ClusterConnectionMode clusterConnectionMode, ConnectionModeSwitch connectionModeSwitch, Nullable`1 directConnection, ServerSettings settings, EndPoint endPoint, IConnectionPoolFactory connectionPoolFactory, IServerMonitorFactory monitorFactory, IEventSubscriber eventSubscriber, ServerApi serverApi)
at MongoDB.Driver.Core.Servers.ServerFactory.CreateServer(ClusterType clusterType, ClusterId clusterId, IClusterClock clusterClock, EndPoint endPoint)
at MongoDB.Driver.Core.Clusters.Cluster.CreateServer(EndPoint endPoint)
at MongoDB.Driver.Core.Clusters.MultiServerCluster.EnsureServer(ClusterDescription clusterDescription, EndPoint endPoint, List`1 newServers)
at MongoDB.Driver.Core.Clusters.MultiServerCluster.Initialize()
at MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings)
at MongoDB.Driver.MongoClient..ctor(String connectionString)
at Squidex.Config.Domain.EventSourcingServices.<>c.<AddSquidexEventSourcing>b__0_4(String s) in /src/src/Squidex/Config/Domain/EventSourcingServices.cs:line 32
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Squidex.Infrastructure.Singletons`1.GetOrAdd(String key, Func`2 factory) in /src/src/Squidex.Infrastructure/Singletons.cs:line 18
at Squidex.Config.Domain.EventSourcingServices.<>c__DisplayClass0_1.<AddSquidexEventSourcing>b__3(IServiceProvider c) in /src/src/Squidex/Config/Domain/EventSourcingServices.cs:line 32
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.DependencyInjectionExtensions.InterfaceRegistrator`1.<>c.<.ctor>b__2_0(IServiceProvider c)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Squidex.Program.Main(String[] args) in /src/src/Squidex/Program.cs:line 18