Installing with Azure DocumentDB MongoDB

Tuesday, May 24, 2022 10:44:26 AM
  • Posted: Thursday, May 5, 2022 9:53 PM
  • 8
Regarding installing with Azure CosmosDB mongodb I get the following error. I have a serverless setup fixed to max 20GB but that should suffice.

Setup failed: Command create failed: Error=13, Details='Response status code does not indicate success: Forbidden (403); Substatus: 3090; ActivityId: af6dc2f4-8006-40a4-ba7c-c39e8c65337c; Reason: (Message: {"Errors":["Storage quota for 'Collection' exceeded."]} ActivityId: af6dc2f4-8006-40a4-ba7c-c39e8c65337c, Request URI: /apps/c0e280a7-7474-4a48-a873-2797e073325c/services/6172d88b-02f3-482e-a1e9-c5c41b454887/partitions/0ba22776-313b-4997-8efe-2bf7261d9b40/replicas/132962301019769311p, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, Windows/10.0.19041 cosmos-netstandard-sdk/3.18.0);.

0
  • Posted: Friday, May 6, 2022 11:01 AM
  • 8
Trying with the local Cosmos DB emulator I get the following error which doesnt give me much to work with either.
"System.FormatException: The size of the message is invalid." This looks interesting but not sure how to figure out more about it?

A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "8", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 8, EndPoint : "Unspecified/localhost:8081" }", EndPoint: "Unspecified/localhost:8081", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server. ---> System.FormatException: The size of the message is invalid. at MongoDB.Driver.Core.Connections.BinaryConnection.EnsureMessageSizeIsValid(Int32 messageSize) at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(CancellationToken cancellationToken) --- End of inner exception stack trace --- at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(Int32 responseTo, CancellationToken cancellationToken) --- End of stack trace from previous location --- at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(Int32 responseTo, CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessage(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken) at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.HelloHelper.GetResult(IConnection connection, CommandWireProtocol`1 helloProtocol, CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.ConnectionInitializer.SendHello(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken) --- End of inner exception stack trace --- at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken) at MongoDB.Driver.Core.Connections.BinaryConnection.Open(CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnection(CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.ServerMonitor.Heartbeat(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2022-05-06T10:57:47.7089287Z", LastUpdateTimestamp: "2022-05-06T10:57:47.7089290Z" }] }.
0
  • Posted: Friday, May 6, 2022 5:39 PM
  • 8
Ok, by some reason serverless doesnt work. Setting the Azure Cosmos Mongo DB to provisioned will work.
Next error is the sitemap can't be fetched due to
MongoCommandException: Command aggregate failed: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: f9f42b1f-e596-4fbc-a588-fd428b485ee9; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: f9f42b1f-e596-4fbc-a588-fd428b485ee9; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: f9f42b1f-e596-4fbc-a588-fd428b485ee9; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]} ActivityId: f9f42b1f-e596-4fbc-a588-fd428b485ee9, Request URI: /apps/1fd53e80-bf7d-4d45-8d9f-a6bb55f87347/services/fb1b35ae-8a9d-4090-ae85-a35363371e82/partitions/019aee3f-c6fc-44da-814a-b04cf3e2cdbd/replicas/132963177110751088s/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.19041 cosmos-netstandard-sdk/3.18.0);););.
0
  • Posted: Friday, May 6, 2022 7:08 PM
  • 8
Moving forward.

AsBsonDocument = {{ "aggregate" : "AdminSiteMap", "pipeline" : [{ "$sort" : { "DisplayOrder" : 1 } }], "cursor" : { } }}

Unable to cast object of type 'MongoDB.Bson.BsonDocument' to type 'MongoDB.Bson.BsonDateTime'.

Looking at the inner exception of e in the modified code here.

var siteMap = new SiteMap(adminSiteMapService, permissionService);
    try
    {
        await siteMap.Load();
    }
    catch (Exception e)
    {
        var test = e;
    }

Anyone have an idea of if this is me who should be fixing this or if GrandNode simply just isnt compatible with Azure CosnmosDB MongoDB?
0
  • Posted: Friday, May 6, 2022 7:21 PM
  • 8
Something about the OrderBy value missing or not being correct. Changed to this and it "works" now.

public virtual async Task<IList<AdminSiteMap>> GetSiteMap()
        {
            return await _cacheBase.GetAsync($"ADMIN_SITEMAP", async () =>
            {
                var query = from c in _adminSiteMapRepository.Table
                            select c;

                var list = query.ToList();
                if (list.Any())
                    return list;
                else
                    return await Task.FromResult(StandardAdminSiteMap.SiteMap.OrderBy(x=>x.DisplayOrder).ToList());
            });
        }
0
  • Posted: Sunday, May 8, 2022 12:14 PM
  • 8
Serverless didnt work because there is a restriction on 100 containers per db and GrandNode is using something like 140(?).
Is there a way some of these could be grouped? As of now a basic database for grandnode in Azure is 50euros per day with provisioned 400RU's.
0
back to top
Filters