Migration for optimized self hosting results in MongoDB error

I have…

  • Read the following guideline: Troubleshooting and Support | Squidex. I understand that my support request might get deleted if I do not follow the guideline.
  • Used code blocks with ``` to format my code examples like JSON or logs properly.

I’m submitting a…

  • Regression (a behavior that stopped working in a new release)
  • Bug report
  • Performance issue
  • Documentation issue or request

Current behavior

When spinning up the migration node with the settings described in the blog post here within the section Dedicated collections for content schemas while setting MODE__ISREADONLY=True on the production node produces a MongoDB error while trying to create indexes in the new database.

we_migration  |   "exception": {
we_migration  |     "type": "MongoDB.Driver.MongoCommandException",
we_migration  |     "message": "Command createIndexes failed: Invalid namespace specified \u0027content-new_bbfc490e-596e-4966-9e54-4bb2627f6299.States_Contents_Published3_4862df23-be4f-46c2-8ff7-2f523f3c8282\u0027.",
we_migration  |     "stackTrace": "   at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol\u00601.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage)\n   at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol\u00601.SendMessageAndProcessResponseAsync(CommandRequestMessage message, Int32 responseTo, IConnection connection, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol\u00601.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocolAsync[TResult](IWireProtocol\u00601 protocol, ICoreSession session, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Operations.CommandOperationBase\u00601.ExecuteProtocolAsync(IChannelSource channelSource, ICoreSessionHandle session, ReadPreference readPreference, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Operations.WriteCommandOperation\u00601.ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)\n   at MongoDB.Driver.Core.Operations.CreateIndexesOperation.ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)\n   at MongoDB.Driver.OperationExecutor.ExecuteWriteOperationAsync[TResult](IWriteBinding binding, IWriteOperation\u00601 operation, CancellationToken cancellationToken)\n   at MongoDB.Driver.MongoCollectionImpl\u00601.ExecuteWriteOperationAsync[TResult](IClientSessionHandle session, IWriteOperation\u00601 operation, CancellationToken cancellationToken)\n   at MongoDB.Driver.MongoCollectionImpl\u00601.MongoIndexManager.CreateManyAsync(IClientSessionHandle session, IEnumerable\u00601 models, CreateManyIndexesOptions options, CancellationToken cancellationToken)\n   at MongoDB.Driver.MongoCollectionImpl\u00601.UsingImplicitSessionAsync[TResult](Func\u00602 funcAsync, CancellationToken cancellationToken)\n   at Squidex.Domain.Apps.Entities.Contents.Operations.QueryInDedicatedCollection.\u003CGetCollectionAsync\u003Eb__5_0(ValueTuple\u00602 key) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/Operations/QueryInDedicatedCollection.cs:line 34\n   at Squidex.Domain.Apps.Entities.Contents.MongoContentCollection.AddCollectionsAsync(MongoContentEntity entity, Action\u00602 add, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/MongoContentCollection.cs:line 331\n   at Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentRepository.Squidex.Infrastructure.States.ISnapshotStore\u003CSquidex.Domain.Apps.Core.Contents.WriteContent\u003E.WriteManyAsync(IEnumerable\u00601 jobs, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/MongoContentRepository_SnapshotStore.cs:line 135\n   at Squidex.Domain.Apps.Entities.ShardedSnapshotStore\u00602.WriteManyAsync(IEnumerable\u00601 jobs, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/ShardedSnapshotStore.cs:line 76\n   at Squidex.Infrastructure.States.BatchContext\u00601.DisposeAsync() in /src/src/Squidex.Infrastructure/States/BatchContext.cs:line 85\n   at Squidex.Infrastructure.Commands.Rebuilder.\u003C\u003Ec__DisplayClass11_0\u00602.\u003C\u003CInsertManyAsync\u003Eb__0\u003Ed.MoveNext() in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 94\n--- End of stack trace from previous location ---\n   at System.Threading.Tasks.Parallel.\u003C\u003Ec__57\u00601.\u003C\u003CForEachAsync\u003Eb__57_0\u003Ed.MoveNext()\n--- End of stack trace from previous location ---\n   at Squidex.Infrastructure.Commands.Rebuilder.InsertManyAsync[T,TState](IAsyncEnumerable\u00601 source, Int32 batchSize, Double errorThreshold, CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 88\n   at Squidex.Infrastructure.Commands.Rebuilder.RebuildAsync[T,TState](StreamFilter filter, Int32 batchSize, Double errorThreshold, CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/Rebuilder.cs:line 53\n   at Migrations.RebuildRunner.RunAsync(CancellationToken ct) in /src/src/Migrations/RebuildRunner.cs:line 54\n   at Microsoft.Extensions.Hosting.Internal.Host.\u003CStartAsync\u003Eb__15_1(IHostedService service, CancellationToken token)\n   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable\u00601 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List\u00601 exceptions, Func\u00603 operation)"
we_migration  |   }

Expected behavior

The migration to CONTENTS_OPTIMIZEFORSELFHOSTING=True works without MongoDB errors while creating the new database for contents.

Minimal reproduction of the problem

Simply following the instructions from the corresponding blog post here:

Environment

App Name:

  • Self hosted with docker
  • Self hosted with IIS
  • Self hosted with other version
  • Cloud version

Version: 7.17

Browser:

  • Chrome (desktop)
  • Chrome (Android)
  • Chrome (iOS)
  • Firefox
  • Safari (desktop)
  • Safari (iOS)
  • IE
  • Edge

Others:

For better context and maybe to detect a conflicting setting, here’s the full environment for Squidex used by the current production node (running locally at the moment, but it has the same settings in production except hosted MonogDB on Atlas and GCS for assets):

we_app  |   "environment": {
we_app  |     "applicationname": "Squidex",
we_app  |     "apps:deletepermanent": "true",
we_app  |     "app_uid": "1654",
we_app  |     "aspnetcore_http_ports": "80",
we_app  |     "aspnetcore_urls": "http://\u002B:5000",
we_app  |     "aspnet_version": "8.0.12",
we_app  |     "assets:allowavifauto": "False",
we_app  |     "assets:allowwebpauto": "True",
we_app  |     "assets:cancache": "True",
we_app  |     "assets:defaultpagesize": "200",
we_app  |     "assets:deletepermanent": "true",
we_app  |     "assets:deleterecursive": "True",
we_app  |     "assets:folderperapp": "False",
we_app  |     "assets:maxresults": "200",
we_app  |     "assets:maxsize": "5242880",
we_app  |     "assets:resizerurl": "",
we_app  |     "assets:timeoutfind": "00:00:01",
we_app  |     "assets:timeoutquery": "00:00:05",
we_app  |     "assetstore:amazons3:accesskey": "\u003CMY_KEY\u003E",
we_app  |     "assetstore:amazons3:bucket": "squidex-test",
we_app  |     "assetstore:amazons3:bucketfolder": "squidex-assets",
we_app  |     "assetstore:amazons3:disablepayloadsigning": "False",
we_app  |     "assetstore:amazons3:forcepathstyle": "False",
we_app  |     "assetstore:amazons3:regionname": "eu-central-1",
we_app  |     "assetstore:amazons3:secretkey": "\u003CMY_SECRET\u003E",
we_app  |     "assetstore:amazons3:serviceurl": "",
we_app  |     "assetstore:azureblob:connectionstring": "UseDevelopmentStorage=true",
we_app  |     "assetstore:azureblob:containername": "squidex-assets",
we_app  |     "assetstore:exposesourceurl": "False",
we_app  |     "assetstore:folder:path": "Assets",
we_app  |     "assetstore:ftp:password": "",
we_app  |     "assetstore:ftp:path": "Assets",
we_app  |     "assetstore:ftp:serverhost": "",
we_app  |     "assetstore:ftp:serverport": "21",
we_app  |     "assetstore:ftp:username": "",
we_app  |     "assetstore:googlecloud:bucket": "",
we_app  |     "assetstore:mongodb:bucket": "fs",
we_app  |     "assetstore:mongodb:configuration": "mongodb://localhost",
we_app  |     "assetstore:mongodb:database": "SquidexAssets",
we_app  |     "assetstore:type": "Folder",
we_app  |     "caching:apps:cacheduration": "00:00:00",
we_app  |     "caching:domainobjects:cacheduration": "00:10:00",
we_app  |     "caching:maxsurrogatekeyssize": "0",
we_app  |     "caching:replicated:enable": "True",
we_app  |     "caching:schemas:cacheduration": "00:00:00",
we_app  |     "caching:strongetag": "False",
we_app  |     "chatbot:configurations:image:systemmessages:0": "You are a bot to generate images.",
we_app  |     "chatbot:configurations:image:systemmessages:1": "Say hello to the user and explain him the user about your capabilities in a single, short sentence.",
we_app  |     "chatbot:configurations:image:tools:0": "dall-e",
we_app  |     "chatbot:configurations:text:systemmessages:0": "You are a bot to generate text content.",
we_app  |     "chatbot:configurations:text:systemmessages:1": "Say hello to the user and explain him about your capabilities in a single, short sentence.",
we_app  |     "chatbot:configurations:text:systemmessages:2": "When you are asked to generate content such as articles, add placeholders for image, describe and use the following pattern: \u003CIMG\u003E{description}\u003C/IMG\u003E. {description} is the generated image description.",
we_app  |     "chatbot:configurations:text:tools:0": "none",
we_app  |     "chatbot:defaults:systemmessages:0": "You are a bot to help with all support requests related to Squidex.",
we_app  |     "chatbot:defaults:systemmessages:1": "Say hello to the user and explain him about your capabilities in a single, short sentence.",
we_app  |     "chatbot:openai:apikey": "",
we_app  |     "chatbot:openai:model": "gpt-3.5-turbo-0125",
we_app  |     "clustering:worker": "True",
we_app  |     "contentroot": "/app",
we_app  |     "contents:cancache": "True",
we_app  |     "contents:defaultpagesize": "200",
we_app  |     "contents:maxresults": "999",
we_app  |     "contents:optimizeforselfhosting": "false",
we_app  |     "contents:timeoutfind": "00:00:01",
we_app  |     "contents:timeoutquery": "00:00:05",
we_app  |     "contents:usetransactions": "False",
we_app  |     "deepdetect:url": "",
we_app  |     "diagnostics:counterstool": "/tools/dotnet-counters",
we_app  |     "diagnostics:dumptool": "/tools/dotnet-dump",
we_app  |     "diagnostics:dumptriggerinmb": "0",
we_app  |     "diagnostics:gc:threshold": "8192",
we_app  |     "diagnostics:gcdumptool": "/tools/dotnet-gcdump",
we_app  |     "diagnostics:gcumptriggerinmb": "0",
we_app  |     "diagnostics:tracetool": "/tools/dotnet-trace",
we_app  |     "dotnet_running_in_container": "true",
we_app  |     "dotnet_version": "8.0.12",
we_app  |     "email:notifications:existingteamuserbody": "Dear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join Team $TEAM_NAME at Squidex Headless CMS.\r\n\r\nLogin or reload the Management UI to see the Team.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n\u003C\u003CStart now!\u003E\u003E [$UI_URL]",
we_app  |     "email:notifications:existingteamusersubject": "[Squidex CMS] You have been invited to join Team $TEAM_NAME",
we_app  |     "email:notifications:existinguserbody": "Dear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join App $APP_NAME at Squidex Headless CMS.\r\n\r\nLogin or reload the Management UI to see the App.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n\u003C\u003CStart now!\u003E\u003E [$UI_URL]",
we_app  |     "email:notifications:existingusersubject": "[Squidex CMS] You have been invited to join App $APP_NAME",
we_app  |     "email:notifications:newuserbody": "Welcome to Squidex\r\nDear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join Project (also called an App) $APP_NAME at Squidex Headless CMS. Login with your GitHub, Google or Microsoft credentials to create a new user account and start editing content now.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n\u003C\u003CStart now!\u003E\u003E [$UI_URL]",
we_app  |     "email:notifications:newusersubject": "You have been invited to join Project $APP_NAME at Squidex CMS",
we_app  |     "email:notifications:newuserteambody": "Welcome to Squidex\r\nDear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join Team $TEAM_NAME at Squidex Headless CMS. Login with your GitHub, Google or Microsoft credentials to create a new user account and start managing the Team now.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n\u003C\u003CStart now!\u003E\u003E [$UI_URL]",
we_app  |     "email:notifications:newuserteamsubject": "You have been invited to join Team $TEAM_NAME at Squidex CMS",
we_app  |     "email:notifications:usagebody": "Dear User,\r\n\r\nYou are about to reach your usage limit for App $APP_NAME at Squidex Headless CMS.\r\n\r\nYou have already used $API_CALLS of your monthly limit of $API_CALLS_LIMIT API calls.\r\n\r\nPlease check your clients or upgrade your plan!\r\n\r\n\u003C\u003CGo to Squidex!\u003E\u003E [$UI_URL]",
we_app  |     "email:notifications:usagesubject": "[Squidex CMS] You are about to reach your usage limit for App $APP_NAME",
we_app  |     "email:smtp:enablessl": "True",
we_app  |     "email:smtp:password": "",
we_app  |     "email:smtp:port": "587",
we_app  |     "email:smtp:sender": "hello@squidex.io",
we_app  |     "email:smtp:server": "",
we_app  |     "email:smtp:username": "",
we_app  |     "eventstore:mongodb:configuration": "mongodb://root:pass@squidex_mongo",
we_app  |     "eventstore:mongodb:database": "db",
we_app  |     "eventstore:type": "MongoDB",
we_app  |     "exposedconfiguration:version": "7.0.0",
we_app  |     "fulltext:azure:apikey": "",
we_app  |     "fulltext:azure:indexname": "squidex",
we_app  |     "fulltext:azure:serviceendpoint": "https://\u003Cname\u003E.search.windows.net",
we_app  |     "fulltext:elastic:configuration": "http://localhost:9200",
we_app  |     "fulltext:elastic:indexname": "squidex",
we_app  |     "fulltext:elastic:opensearch": "False",
we_app  |     "fulltext:type": "default",
we_app  |     "graphql:cacheduration": "00:10:00",
we_app  |     "graphql:dataloaderbatchsize": "1000",
we_app  |     "graphql:enablesubscriptions": "True",
we_app  |     "home": "/root",
we_app  |     "hostname": "9139e55732ef",
we_app  |     "http_ports": "80",
we_app  |     "identity:adminclientid": "",
we_app  |     "identity:adminclientsecret": "",
we_app  |     "identity:adminemail": "armin.pfurtscheller@gmail.com",
we_app  |     "identity:adminpassword": "bt\u0026s\\*B^\u003C5*K:;x{",
we_app  |     "identity:adminrecreate": "True",
we_app  |     "identity:allowcustomdomains": "True",
we_app  |     "identity:allowpasswordauth": "True",
we_app  |     "identity:githubclient": "",
we_app  |     "identity:githubsecret": "",
we_app  |     "identity:googleclient": "",
we_app  |     "identity:googlesecret": "",
we_app  |     "identity:lockautomatically": "False",
we_app  |     "identity:microsoftclient": "",
we_app  |     "identity:microsoftsecret": "",
we_app  |     "identity:microsofttenant": "",
we_app  |     "identity:oidcauthority": "",
we_app  |     "identity:oidcclient": "",
we_app  |     "identity:oidcerrormap": "",
we_app  |     "identity:oidcgetclaimsfromuserinfoendpoint": "False",
we_app  |     "identity:oidcmetadataaddress": "",
we_app  |     "identity:oidcname": "OIDC",
we_app  |     "identity:oidconsignoutredirecturl": "",
we_app  |     "identity:oidcoverridepermissionswithcustomclaimsonlogin": "False",
we_app  |     "identity:oidcprompt": "",
we_app  |     "identity:oidcresponsetype": "id_token",
we_app  |     "identity:oidcscopes:0": "email",
we_app  |     "identity:oidcsecret": "",
we_app  |     "identity:privacyurl": "https://squidex.io/privacy",
we_app  |     "identity:showpii": "True",
we_app  |     "identity:suppressxframeoptionsheader": "False",
we_app  |     "kafka:bootstrapservers": "",
we_app  |     "languages:custom": "",
we_app  |     "logging:applicationinsights:connectionstring": "InstrumentationKey=[key];IngestionEndpoint=https://[datacenter].in.applicationinsights.azure.com/",
we_app  |     "logging:applicationinsights:enabled": "False",
we_app  |     "logging:colors": "True",
we_app  |     "logging:human": "True",
we_app  |     "logging:level": "Information",
we_app  |     "logging:loglevel:default": "Information",
we_app  |     "logging:loglevel:microsoft.aspnetcore": "Warning",
we_app  |     "logging:loglevel:microsoft.identity": "Warning",
we_app  |     "logging:loglevel:openiddict": "Warning",
we_app  |     "logging:loglevel:runtime": "Warning",
we_app  |     "logging:logrequests": "True",
we_app  |     "logging:name": "Squidex",
we_app  |     "logging:otlp:enabled": "False",
we_app  |     "logging:otlp:endpoint": "",
we_app  |     "logging:otlp:sampling": "1.0",
we_app  |     "logging:stackdriver:enabled": "False",
we_app  |     "logging:stackdriver:projectid": "",
we_app  |     "logging:storeenabled": "True",
we_app  |     "logging:storeretentionindays": "90",
we_app  |     "logging:zipkin:enabled": "False",
we_app  |     "logging:zipkin:endpoint": "http://localhost:9411/api/v2/spans",
we_app  |     "messaging:type": "MongoDb",
we_app  |     "mode:isreadonly": "true",
we_app  |     "news:appname": "squidex-website",
we_app  |     "news:clientid": "squidex-website:default",
we_app  |     "news:clientsecret": "QGgqxd7bDHBTEkpC6fj8sbdPWgZrPrPfr3xzb3LKoec=",
we_app  |     "notifo:apikey": "",
we_app  |     "notifo:apiurl": "https://app.notifo.io",
we_app  |     "notifo:appid": "",
we_app  |     "path": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
we_app  |     "plugins:0": "Squidex.Extensions.dll",
we_app  |     "rebuild:apps": "False",
we_app  |     "rebuild:assetfiles": "False",
we_app  |     "rebuild:assets": "False",
we_app  |     "rebuild:contents": "false",
we_app  |     "rebuild:rules": "False",
we_app  |     "rebuild:schemas": "False",
we_app  |     "robots:text": "User-agent: *\nAllow: /api/assets/*",
we_app  |     "rules:executiontimeoutinseconds": "10",
we_app  |     "rules:jobqueryinterval": "00:00:10",
we_app  |     "rules:rulescacheduration": "00:00:10",
we_app  |     "running_in_container": "true",
we_app  |     "schemas:deletepermanent": "False",
we_app  |     "scripting:timeoutexecution": "00:00:04",
we_app  |     "scripting:timeoutscript": "00:00:00.200",
we_app  |     "store:mongodb:assetshardcount": "0",
we_app  |     "store:mongodb:atlas:clustername": "",
we_app  |     "store:mongodb:atlas:fulltextenabled": "False",
we_app  |     "store:mongodb:atlas:groupid": "",
we_app  |     "store:mongodb:atlas:privatekey": "",
we_app  |     "store:mongodb:atlas:publickey": "",
we_app  |     "store:mongodb:configuration": "mongodb://root:pass@squidex_mongo",
we_app  |     "store:mongodb:contentdatabase": "content-db",
we_app  |     "store:mongodb:contentshardcount": "0",
we_app  |     "store:mongodb:database": "db",
we_app  |     "store:mongodb:textshardcount": "0",
we_app  |     "store:mongodb:valuerepresentation": "Document",
we_app  |     "store:type": "MongoDB",
we_app  |     "templates:repositories:0:contenturl": "https://raw.githubusercontent.com/Squidex/templates/main",
we_app  |     "templates:repositories:0:giturl": "https://github.com/Squidex/templates.git",
we_app  |     "translations:deepl:authkey": "",
we_app  |     "translations:deepl:mapping:zh-cn": "zh-CN",
we_app  |     "translations:deepl:mapping:zh-tw": "zh-TW",
we_app  |     "translations:googlecloud:projectid": "",
we_app  |     "twitter:clientid": "QZhb3HQcGCvE6G8yNNP9ksNet",
we_app  |     "twitter:clientsecret": "Pdu9wdN72T33KJRFdFy1w4urBKDRzIyuKpc0OItQC2E616DuZD",
we_app  |     "ui:hidedatebuttons": "true",
we_app  |     "ui:hidedatetimemodebutton": "true",
we_app  |     "ui:hideindexes": "False",
we_app  |     "ui:hidenews": "true",
we_app  |     "ui:hideonboarding": "true",
we_app  |     "ui:map:googlemaps:key": "AIzaSyB_Z8l3nwUxZhMJykiDUJy6bSHXXlwcYMg",
we_app  |     "ui:map:type": "OSM",
we_app  |     "ui:onlyadminscancreateapps": "true",
we_app  |     "ui:redirecttologin": "true",
we_app  |     "ui:referencesdropdownitemcount": "100",
we_app  |     "ui:regexsuggestions:email": "^[a-zA-Z0-9.!#$%\u0026\u2019*\u002B\\/=?^_\u0060{|}~-]\u002B@[a-zA-Z0-9-]\u002B(?:.[a-zA-Z0-9-]\u002B)*$",
we_app  |     "ui:regexsuggestions:path": "^\\/[a-z0-9-]{0,}$",
we_app  |     "ui:regexsuggestions:phone": "^[\u002B]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]*$",
we_app  |     "ui:regexsuggestions:slug": "^[a-z0-9]\u002B([a-z0-9-]\u002B)*$",
we_app  |     "ui:regexsuggestions:url": "^(?:http(s)?:\\/\\/)?[\\w.-]\u002B(?:\\.[\\w\\.-]\u002B)\u002B[\\w\\-\\._~:\\/?#%[\\]@!\\$\u0026\u0027\\(\\)\\*\\\u002B,;=.]\u002B$",
we_app  |     "ui:showinfo": "true",
we_app  |     "urls": "http://\u002B:5000",
we_app  |     "urls:basepath": "",
we_app  |     "urls:baseurl": "https://squidex.local",
we_app  |     "urls:enableforwardheaders": "True",
we_app  |     "urls:enforcehost": "false",
we_app  |     "urls:enforcehttps": "False",
we_app  |     "version": "8.0.12"
we_app  |   }
we_app  | }

Thanks for any feedback on the issue. It’s not a blocker and I can leave it as is, I’d just be curious what I’m doing wrong/missing and if it might should go anywhere in the docs if it’s not a self-made problem.

Which mongo version do you use?

I’m using the Docker image mongo:5 locally, where I tried the migration prior to the hosted instance on Atlas, which runs already Mongo 8. Do you think this might be the issue? Looking at the suggested docker-compose.yml it would be mongo:6 right? (squidex-hosting/docker-compose/docker-compose.yml at master · Squidex/squidex-hosting · GitHub)

Don’t know yet.

I am running all API tests against this setup with each build, and I also created a sample, but I cannot reproduce the problem yet.

using MongoDB.Driver;

namespace ConsoleApp1
{
    internal class Program
    {
        class TestEntity
        {
            public Guid Id { get; set; }
            public int LongProperty1 { get; set; }
            public int LongProperty2 { get; set; }
            public int LongProperty3 { get; set; }
            public int LongProperty4 { get; set; }
            public int LongProperty5 { get; set; }
            public int LongProperty6 { get; set; }
            public int LongProperty7 { get; set; }
            public int LongProperty8 { get; set; }
            public int LongProperty9 { get; set; }
        }

        static void Main(string[] args)
        {
            var mongoClient = new MongoClient("mongodb://localhost");
            var mongoDatabase = mongoClient.GetDatabase("content-new_bbfc490e-596e-4966-9e54-4bb2627f6299");
            var mongoCollection = mongoDatabase.GetCollection<TestEntity>("States_Contents_Published3_4862df23-be4f-46c2-8ff7-2f523f3c8282");

            mongoCollection.Indexes.CreateOneAsync(
                new CreateIndexModel<TestEntity>(
                    Builders<TestEntity>.IndexKeys
                        .Ascending(x => x.Id)
                        .Ascending(x => x.LongProperty1)
                        .Ascending(x => x.LongProperty2)
                        .Ascending(x => x.LongProperty3)
                        .Ascending(x => x.LongProperty4)
                        .Ascending(x => x.LongProperty5)
                        .Ascending(x => x.LongProperty6)
                        .Ascending(x => x.LongProperty7)
                        .Ascending(x => x.LongProperty8)
                        .Ascending(x => x.LongProperty9)));

            Console.WriteLine("Successful");
        }
    }
}

Thanks for looking into it. I can give it a try with the mongo:6 image and report if it changes something. I’m not a Mongo dev so I cannot tell if it even is likely to change something.

1 Like