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
I try to rebuild data from a corrupted squidex instance into a new instance with the optimizeForSelfHosting=true
flag via cli sync in method. As the instance was started with this flag from the beginning, I did not set any of the rebuild_
flags. Here is an earlier post of mine.
The steps Assets, Schemas, App succeeded without an issue. Upserting content worked for some bulks but failed suddenly:
Upserting #280/50... succeeded.
Upserting #281/0... failed: .
Followed by a few hundred failed bulks until I stopped the import. An error I can see in the logs is as following
{
"logLevel": "Error",
"message": "Failed to repair snapshot for domain object of type Squidex.Domain.Apps.Entities.Contents.DomainObject.ContentDomainObject with ID a906555a-2180-41d2-ae4b-323ae919f9e0--113f3bb7-53a4-4e3c-aedf-aef14aa9ff00.",
"type": "Squidex.Domain.Apps.Entities.Contents.DomainObject.ContentDomainObject",
"id": "a906555a-2180-41d2-ae4b-323ae919f9e0--113f3bb7-53a4-4e3c-aedf-aef14aa9ff00",
"timestamp": "2025-09-10T14:49:14Z",
"app": {
"name": "Squidex",
"version": "7.21.0.0",
"sessionId": "021fef9d-59ee-4b7a-943b-60e53cc77992"
},
"web": {
"requestId": "00-90ff57a1739ef3fad33ba25248f26172-f9b044f252a0ab97-01",
"requestPath": "/api/content/myApp/mySchema/bulk",
"requestMethod": "POST",
"routeValues": {
"area": "api",
"action": "BulkUpdateContents",
"controller": "Contents"
}
},
"category": "Squidex.Domain.Apps.Entities.Contents.DomainObject.ContentDomainObject",
"exception": {
"type": "MongoDB.Driver.MongoCommandException",
"message": "Command createIndexes failed: not authorized on SquidexContent2_a906555a-2180-41d2-ae4b-323ae919f9e0 to execute command {
createIndexes: \u0022States_Contents_All3_eb9c2d8e-d5eb-4069-853a-04ea8d122b41\u0022,
indexes:
[
{
key: { mt: -1, id: 1, dl: 1, rf: 1 },
name: \u0022mt_-1_id_1_dl_1_rf_1\u0022,
},
{ key: { _si: 1, dl: 1, mt: -1 }, name: \u0022_si_1_dl_1_mt_-1\u0022 },
],
$db: \u0022SquidexContent2_a906555a-2180-41d2-ae4b-323ae919f9e0\u0022,
lsid: { id: UUID(\u0022cf2167dc-7258-43ee-b300-07806620ab87\u0022) },
$clusterTime:
{
clusterTime: Timestamp(1757513576,
67),
signature:
{
hash: BinData(0,
9A188F9C709D4832EEAE40340A55E2D0135FA782),
keyId: 7486896985052545026,
},
},
}
.",
"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.CollectionProvider.CreateCollectionAsync(ValueTuple\u00602 key) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/CollectionProvider.cs:line 31\n at Squidex.Domain.Apps.Entities.Contents.Operations.QueryInDedicatedCollection.UpsertAsync(SnapshotWriteJob\u00601 job, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/Operations/QueryInDedicatedCollection.cs:line 77\n at Squidex.Domain.Apps.Entities.Contents.MongoContentCollection.UpsertAsync(SnapshotWriteJob\u00601 job, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/MongoContentCollection.cs:line 269\n at Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentRepository.UpsertCompleteAsync(SnapshotWriteJob\u00601 job, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/MongoContentRepository_SnapshotStore.cs:line 200\n at Squidex.Domain.Apps.Entities.MongoDb.Contents.MongoContentRepository.Squidex.Infrastructure.States.ISnapshotStore\u003CSquidex.Domain.Apps.Core.Contents.WriteContent\u003E.WriteAsync(SnapshotWriteJob\u00601 job, CancellationToken ct) in /src/src/Squidex.Data.MongoDb/Domain/Apps/Entities/Contents/MongoContentRepository_SnapshotStore.cs:line 100\n at Squidex.Infrastructure.States.Persistence\u00601.WriteSnapshotAsync(T state, CancellationToken ct) in /src/src/Squidex.Infrastructure/States/Persistence.cs:line 187\n at Squidex.Infrastructure.Commands.DomainObject\u00601.EnsureLoadedAsync(CancellationToken ct) in /src/src/Squidex.Infrastructure/Commands/DomainObject.cs:line 151"
}
}
The database user for squidex has the permission readWrite@SquidexContent2
and readWrite@Squidex2
in my MongoDB Cluster. I am confused about the error message as it states that it doesn not have permission to create indices on SquidexContent2_a906555a-2180-41d2-ae4b-323ae919f9e0
which looks like a totally different database (or Im interpreting it wrong :D). If I try to access the content via UI, I get a similar error in the logs. I did not find any information about the MongoDB permissions the database user needs. From MongoDB documentation, readWrite
should be sufficient to create indices.
Databases are configured like this
eventstore_database_name = "Squidex2"
store_database_name = "Squidex2"
store_content_database_name = "SquidexContent2"
Expected behavior
Could you please clarify where this suffix in the database name comes from, and what the correct way is to configure the database user so that index creation works? Any guidance or documentation links would be greatly appreciated.
Thanks for your help!
Minimal reproduction of the problem
Environment
App Name:
- Self hosted with docker
- Self hosted with IIS
- Self hosted with other version
- Cloud version
Version: [VERSION]
Browser:
- Chrome (desktop)
- Chrome (Android)
- Chrome (iOS)
- Firefox
- Safari (desktop)
- Safari (iOS)
- IE
- Edge
Others: