Open Closed

MongoDB.Driver.MongoCommandException: Command aggregate failed: Error=2 After deployment on Azure using CosmosDB #473


User avatar
0
suraj.kumbhar created
  • ABP Framework version: v3.1.2

  • UI type: MVC

  • Tiered (MVC): / no

  • Exception message and stack trace: 2020-10-07 04:23:16.969 +00:00 [ERR] Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason:** (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]} ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4, Request URI: /apps/c56d70d4-0fbb-44da-8f3b-6ce6087ccf9b/services/3c16649d-2bb2-4531-abb0-09d4bd1a927c/partitions/192defda-7d84-4fba-b645-a2632c45d63c/replicas/132463302254650749s/, RequestStats: Please see CosmosDiagnostics, SDK: Windows/10.0.14393 cosmos-netstandard-sdk/3.3.2);););););. MongoDB.Driver.MongoCommandException: Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}** ActivityId: 87a43de8-654b-4acb-9b41-80d5c01291b4, Request URI: /apps/c56d70d4-0fbb-44da-8f3b-6ce6087ccf9b/services/3c16649d-2bb2-4531-abb0-09d4bd1a927c/partitions/192defda-7d84-4fba-b645-a2632c45d63c/replicas/132463302254650749s/, RequestStats: Please see CosmosDiagnostics, SDK: Windows/10.0.14393 cosmos-netstandard-sdk/3.3.2);););););. at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage) at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocolAsync[TResult](IWireProtocol1 protocol, ICoreSession session, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.RetryableReadOperationExecutor.ExecuteAsync[TResult](IRetryableReadOperation1 operation, RetryableReadContext context, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.ReadCommandOperation1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.AggregateOperation1.ExecuteAsync(RetryableReadContext context, 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.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken) at Volo.Abp.Identity.MongoDB.MongoIdentityUserRepository.GetListAsync(String sorting, Int32 maxResultCount, Int32 skipCount, String filter, Boolean includeDetails, CancellationToken cancellationToken)

  • Steps to reproduce the issue: We have Host the Application on Azure and for database we have used Azure Cosmos Db with MongoDB API Version 3.6 application launch successfully but after login its not showing in LIST DATA for Users, Tenants everything wherever we used GetListAsync Method all got failed due to above exception. We also referred this link https://docs.microsoft.com/nl-nl/azure/cosmos-db/mongodb-troubleshoot but dont know how to solve this in ABPIO. this is our sample CosmosDB Connection String(its dummy for showing purpose) : "Default": "mongodb://ops-ai:ASDFeeZbaeQJMmhGujdWD6ZofiiChCmlR1TYHUkdp89QIAifHYTG8RaRsBthxpZ85mj8tWA9n6T8RuEIBeX4a45==@demo.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&maxIdleTimeMS=120000&appName=@demo@",

Any solution on High Priority will help us to move forward.


7 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Maybe you can try use EF Core provider: https://docs.microsoft.com/en-us/ef/core/providers/cosmos/?tabs=dotnet-core-cli

  • User Avatar
    0
    suraj.kumbhar created

    Hello, We cannot use EF CORE as we are strictly developing the app using MongoDB.

  • User Avatar
    0
    alper created
    Support Team Director

    you canuse MongoDB with the EF Core provider.

  • User Avatar
    0
    suraj.kumbhar created

    @Alper Could you please provide the necessary steps like should i download latest commecial project or As i am using ABP Commecrial Version v3.1.2 in that where i need to make changes. Please provide the link that will guide us.

  • User Avatar
    0
    alper created
    Support Team Director

    1- see this document https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Other-DBMS 2- also I advice you to update your project to v3.2.1

  • User Avatar
    0
    suraj.kumbhar created

    @Alper Above issue remains same after migrating app to 3.2.1 with MonogDb

  • User Avatar
    1
    alper created
    Support Team Director

    disable MongoDB transactions to see if that works. do it in the ConfigureServices method of your Module class

    Configure<AbpUnitOfWorkDefaultOptions>(options =>
    {
      options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
    });
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09