
Please provide some logs.

It's here
MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1. ---> MongoDB.Driver.MongoCommandException: Command saslStart failed: Authentication failed..
at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply)
at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Authentication.SaslAuthenticator.AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.GetChannelAsync(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AggregateOperation1.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.AggregateAsync[TResult](IClientSessionHandle session, PipelineDefinition2 pipeline, AggregateOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl1.UsingImplicitSessionAsync[TResult](Func2 funcAsync, CancellationToken cancellationToken)
at MongoDB.Driver.AsyncCursorHelper.FirstOrDefaultAsyncT
at Nito.AsyncEx.AsyncContext.RunTResult in D:\githubabp\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\Builder\AbpApplicationBuilderExtensions.cs:line 56
at NguyenIT.ThanhNienThuDuc.Web.ThanhNienThuDucWebModule.OnApplicationInitialization(ApplicationInitializationContext context) in E:\Projects\ThanhNienThuDucweb\src\NguyenIT.ThanhNienThuDuc.Web\ThanhNienThuDucWebModule.cs:line 278
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) in D:\githubabp\framework\src\Volo.Abp.Core\Volo\Abp\Modularity\ModuleManager.cs:line 39
at Volo.Abp.AbpApplicationBase.InitializeModules() in D:\githubabp\framework\src\Volo.Abp.Core\Volo\Abp\AbpApplicationBase.cs:line 72
at NguyenIT.ThanhNienThuDuc.Web.Startup.Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) in E:\Projects\ThanhNienThuDucweb\src\NguyenIT.ThanhNienThuDuc.Web\Startup.cs:line 23
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Internal.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.
at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
2019-07-26 15:12:34.990 +07:00 [INF] Request starting HTTP/2.0 GET https://localhost:44326/ `
I can't reproduce using MongoDb 4. (docker: mongo:4)
MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.
It seems to be a problem with your database configuration.
"ConnectionStrings": {
"Default": "mongodb://mongoadmin:[email protected]:27018|BookStore"
}
how to fix it ?
I am not familiar with mongodb, abp uses the MongoDB.Driver component.
Maybe you can google it
I found a way
var connectionString = @"mongodb://usr:[email protected],srv2.acme.net,srv3.acme.net/dbName?replicaSet=rset";
var mongoUrl = new MongoUrl(connectionString);
var dbname = mongoUrl.DatabaseName;
var db = new MongoClient(mongoUrl).GetDatabase(dbname);
This seems more standard, @hikalkan why do we use | to split the database connection string and database name?
can you fix it in the next version ?
It will be fixed in the next version, as a breaking change.
try to specified parameters authSource=admin, like this
var connectionString = "mongodb://usr:pwd@host/dbName?authSource=admin";
Most helpful comment
try to specified parameters authSource=admin, like this
var connectionString = "mongodb://usr:pwd@host/dbName?authSource=admin";