Hi,
there is an emulator for hosting a cosmosdb https://learn.microsoft.com/en-us/azure/cosmos-db/emulator
we are hosting our instances in azure.
best regards
email sent, thanks.
2024-06-19 10:29:34.423 +02:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AbpIdentity.Roles.Create
2024-06-19 10:29:34.423 +02:00 [DBG] Found in the cache: pn:R,pk:admin,n:AbpIdentity.Roles.Create
2024-06-19 10:29:34.593 +02:00 [ERR] An error occurred while deserializing the RoleId property of class <>f__AnonymousType0`2[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]: Cannot deserialize a 'Guid' from BsonType 'Null'.
System.FormatException: An error occurred while deserializing the RoleId property of class <>f__AnonymousType0`2[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]: Cannot deserialize a 'Guid' from BsonType 'Null'.
---> System.FormatException: Cannot deserialize a 'Guid' from BsonType 'Null'.
at MongoDB.Bson.Serialization.Serializers.GuidSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.DeserializeMemberValue(BsonDeserializationContext context, BsonMemberMap memberMap)
--- End of inner exception stack trace ---
at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.DeserializeMemberValue(BsonDeserializationContext context, BsonMemberMap memberMap)
at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.DeserializeClass(BsonDeserializationContext context)
at MongoDB.Bson.Serialization.BsonClassMapSerializer`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context)
at MongoDB.Bson.Serialization.Serializers.EnumerableSerializerBase`2.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context)
at MongoDB.Driver.Core.Operations.AggregateOperation`1.CursorDeserializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context)
at MongoDB.Driver.Core.Operations.AggregateOperation`1.AggregateResultDeserializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize[TValue](IBsonSerializer`1 serializer, BsonDeserializationContext context)
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage)
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocolAsync[TResult](IWireProtocol`1 protocol, ICoreSession session, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.RetryableReadOperationExecutor.ExecuteAsync[TResult](IRetryableReadOperation`1 operation, RetryableReadContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.ReadCommandOperation`1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AggregateOperation`1.ExecuteAsync(RetryableReadContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AggregateOperation`1.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperationAsync[TResult](IClientSessionHandle session, IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.AggregateAsync[TResult](IClientSessionHandle session, PipelineDefinition`2 pipeline, AggregateOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)
at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators.ExecutableQuery`3.ExecuteAsync(IClientSessionHandle session, CancellationToken cancellationToken)
at MongoDB.Driver.IAsyncCursorSourceExtensions.ToListAsync[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken)
at Volo.Abp.Identity.MongoDB.MongoIdentityRoleRepository.GetListWithUserCountAsync(String sorting, Int32 maxResultCount, Int32 skipCount, String filter, Boolean includeDetails, CancellationToken cancellationToken)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Volo.Abp.Identity.IdentityRoleAppService.GetListAsync(GetIdentityRoleListInput input)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper, IUnitOfWorkManager unitOfWorkManager)
at Volo.Abp.Auditing.AuditingInterceptor.ProcessWithNewAuditingScopeAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, ICurrentUser currentUser, IAuditingManager auditingManager, IAuditingHelper auditingHelper, IUnitOfWorkManager unitOfWorkManager)
at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Volo.Abp.BlazoriseUI.AbpCrudPageBase`10.GetEntitiesAsync()
2024-06-19 10:29:34.598 +02:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:8e3f9aa8-6ebd-82fb-ea62-3a1303d4c164,n:AbpIdentity.Roles.Create
2024-06-19 10:29:34.598 +02:00 [DBG] Found in the cache: pn:U,pk:8e3f9aa8-6ebd-82fb-ea62-3a1303d4c164,n:AbpIdentity.Roles.Create
I cannot navigate to 'roles' , an 'iternal error' appears
After searching the log i found an error relating to indexes, so i created an composition index using: db.AbpBackgroundJobs.createIndex({ Priority: -1, TryCount: 1, NextTryTime: 1})
But then this error appeared.
[
{
"_id": "yJXqnzSze3em2zoTA9TE+A==",
"ConcurrencyStamp": "de25f7b37ead43e28debf90554020aa8",
"TenantId": null,
"Name": "admin",
"NormalizedName": "ADMIN",
"Claims": [],
"IsDefault": false,
"IsStatic": true,
"IsPublic": true,
"EntityVersion": 0
}
]
the permission grants are this:
[
{
"_id": "KrPerQOJ4gDU3DoTA9TLQw==",
"TenantId": null,
"Name": "FeatureManagement.ManageHostFeatures",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "SUbPXz4xPl9dhjoTA9TLcw==",
"TenantId": null,
"Name": "AbpIdentity.Roles",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "mKFXoVcRjcZvnToTA9TLpg==",
"TenantId": null,
"Name": "AbpIdentity.Roles.Create",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "1jTtHtqPxPr8kjoTA9TL2g==",
"TenantId": null,
"Name": "AbpIdentity.Roles.Update",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "7+JmBmQviO6h/ToTA9TMDA==",
"TenantId": null,
"Name": "AbpIdentity.Roles.Delete",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "p9ckkHZkC9bnTToTA9TMOg==",
"TenantId": null,
"Name": "AbpIdentity.Roles.ManagePermissions",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "yLgkwH3xonwxjToTA9TMZw==",
"TenantId": null,
"Name": "AuditLogging.ViewChangeHistory:Volo.Abp.Identity.IdentityRole",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "xd8GDO/uLEfD3ToTA9TMmg==",
"TenantId": null,
"Name": "AbpIdentity.Users",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "8aPmwRPHofUdeToTA9TM3A==",
"TenantId": null,
"Name": "AbpIdentity.Users.Create",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "va1T0meKaKUPtDoTA9TNDg==",
"TenantId": null,
"Name": "AbpIdentity.Users.Update",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "oEr8Zcmbdt9tazoTA9TNTA==",
"TenantId": null,
"Name": "AbpIdentity.Users.Delete",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "8F93pNf1YQ7I+ToTA9TNeg==",
"TenantId": null,
"Name": "AbpIdentity.Users.ManagePermissions",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "KueF0MqjHMCdcjoTA9TNrA==",
"TenantId": null,
"Name": "AbpIdentity.Users.Update.ManageRoles",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "8gO5VwpDWb/XOzoTA9TN3A==",
"TenantId": null,
"Name": "AbpIdentity.Users.Update.ManageOU",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "pYlf+G1e7YnptzoTA9TODg==",
"TenantId": null,
"Name": "AuditLogging.ViewChangeHistory:Volo.Abp.Identity.IdentityUser",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "rc3JkV7SwsmjijoTA9TORg==",
"TenantId": null,
"Name": "AbpIdentity.Users.Impersonation",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "jQ4ZAFAAQP4p6ToTA9TOdA==",
"TenantId": null,
"Name": "AbpIdentity.Users.Import",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "m5j2sktuh+lG+ToTA9TOqA==",
"TenantId": null,
"Name": "AbpIdentity.Users.Export",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "Z745DXH0penk1ToTA9TO2A==",
"TenantId": null,
"Name": "AbpIdentity.Users.ViewDetails",
"ProviderName": "R",
"ProviderKey": "admin"
},
{
"_id": "WozWoKYScwjQ9DoTA9TPCg==",
"TenantId": null,
"Name": "AbpIdentity.OrganizationUnits",
"ProviderName": "R",
"ProviderKey": "admin"
}
]
Oh my bad, i didn't see that, thanks
I'm sorry but i can't find ConfigureIndexes() in my IMongoModelBuilder, is it an extension somewhere? Am i missing something?
my refs: using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB;
Thanks
Hi
CosmosDB does not fully implement the MongoDB API. Sorting is one of the limitations of using CosmosDB for MongoDB. For you to sort a collection you must index the field you are sorting with.
See: https://stackoverflow.com/questions/56988743/using-the-sort-cursor-method-without-the-default-indexing-policy-in-azure-cosm
You need to create the index manually
Thanks for the really quick answer and the provided link, how can i create that index? The migrator creates the databases and collections, is there any point within the code where i should create the wildcard index? I dont't know where the sort is beeing applied ...
ABP Framework version: v8.1.3
UI Type: Blazor Server
Database System: MongoDB
Tiered (for MVC) or Auth Server Separated (for Angular): no
Exception message and full stack trace:
MongoDB.Driver.MongoCommandException
HResult=0x80131500
Message=Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 9938fd57-cea7-4dca-ad52-633fa90d97b1; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 9938fd57-cea7-4dca-ad52-633fa90d97b1; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 9938fd57-cea7-4dca-ad52-633fa90d97b1; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}
ActivityId: 9938fd57-cea7-4dca-ad52-633fa90d97b1, Request URI: /apps/cb9a5e6a-26b3-40ae-83c4-f2e6137ce7ce/services/3e32c5c8-fe2d-448f-b431-cd09a5a1b374/partitions/8566e1b0-475f-445b-84b4-f842641e1b74/replicas/133622193936236157p/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.20348 cosmos-netstandard-sdk/3.18.0);););.
Source=MongoDB.Driver.Core
StackTrace:
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage) at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol
1.<ExecuteAsync>d__20.MoveNext()
at MongoDB.Driver.Core.Servers.Server.ServerChannel.<ExecuteProtocolAsync>d__201.MoveNext() at MongoDB.Driver.Core.Operations.RetryableReadOperationExecutor.<ExecuteAsync>d__3
1.MoveNext()
at MongoDB.Driver.Core.Operations.ReadCommandOperation1.<ExecuteAsync>d__8.MoveNext() at MongoDB.Driver.Core.Operations.AggregateOperation
1.<ExecuteAsync>d__65.MoveNext()
at MongoDB.Driver.Core.Operations.AggregateOperation1.<ExecuteAsync>d__64.MoveNext() at MongoDB.Driver.OperationExecutor.<ExecuteReadOperationAsync>d__3
1.MoveNext()
at MongoDB.Driver.MongoCollectionImpl1.<ExecuteReadOperationAsync>d__101
1.MoveNext()
at MongoDB.Driver.MongoCollectionImpl1.<AggregateAsync>d__25
1.MoveNext()
at MongoDB.Driver.MongoCollectionImpl1.<UsingImplicitSessionAsync>d__109
1.MoveNext()
at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators.ExecutableQuery3.<ExecuteAsync>d__14.MoveNext() at MongoDB.Driver.IAsyncCursorSourceExtensions.<ToListAsync>d__16
1.MoveNext()
at Volo.Abp.LanguageManagement.MongoDB.MongoLanguageRepository.<GetListAsync>d__2.MoveNext()
at Castle.DynamicProxy.AsyncInterceptorBase.<ProceedAsynchronous>d__141.MoveNext() at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.<ProceedAsync>d__7.MoveNext()
at Volo.Abp.Uow.UnitOfWorkInterceptor.<InterceptAsync>d__2.MoveNext()
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.<InterceptAsync>d__3
1.MoveNext()
at Volo.Abp.LanguageManagement.Data.LanguageManagementDataSeeder.<SeedAsync>d__16.MoveNext()
at Volo.Abp.LanguageManagement.Data.LanguageManagementDataSeedContributor.<SeedAsync>d__2.MoveNext()
at Volo.Abp.Data.DataSeeder.<SeedAsync>d__7.MoveNext()
at Castle.DynamicProxy.AsyncInterceptorBase.<ProceedAsynchronous>d__13.MoveNext()
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.<ProceedAsync>d__7.MoveNext()
at Volo.Abp.Uow.UnitOfWorkInterceptor.<InterceptAsync>d__2.MoveNext()
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.<InterceptAsync>d__2.MoveNext() at Tag3.Backend.Data.BackendDbMigrationService.<SeedDataAsync>d__11.MoveNext() in D:\1701apps.tag3.io.vNext\Backend\Tag3.Backend\src\Tag3.Backend.Domain\Data\BackendDbMigrationService.cs:line 97 at Tag3.Backend.Data.BackendDbMigrationService.<MigrateAsync>d__9.MoveNext() in D:\1701apps.tag3.io.vNext\Backend\Tag3.Backend\src\Tag3.Backend.Domain\Data\BackendDbMigrationService.cs:line 47 at Tag3.Backend.DbMigrator.DbMigratorHostedService.<StartAsync>d__3.MoveNext() in D:\1701apps.tag3.io.vNext\Backend\Tag3.Backend\src\Tag3.Backend.DbMigrator\DbMigratorHostedService.cs:line 36 at Microsoft.Extensions.Hosting.Internal.Host.<<StartAsync>b__15_1>d.MoveNext() at Microsoft.Extensions.Hosting.Internal.Host.<ForeachService>d__18
1.MoveNext()
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>g__LogAndRethrow|15_3(<>c__DisplayClass15_0& )
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__15.MoveNext()
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
at Tag3.Backend.DbMigrator.Program.<Main>d__0.MoveNext() in D:\1701apps.tag3.io.vNext\Backend\Tag3.Backend\src\Tag3.Backend.DbMigrator\Program.cs:line 28
Steps to reproduce the issue: Create a solution using the AbpSuit and run the DbMigrator
Hello,
i followed this guide: https://community.abp.io/posts/using-cosmosdb-with-the-abp-framework-via-mongodb-api-x47bjeik on using my cosmosdb within ABP, but i receive the given error on DbMigration. Within this guide the same error has been stated in the comments more than a year ago, can anyone help me out?
the mongodb transactions are disabled by default.
i tried to switch to the EF-Provider but wasn't able to achive this, are there any guides? I found this https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Other-DBMS but there is no clue on how to achive this using a cosmosDb.
Any help would be appriciated.
Thanks, Stefan