Duplicate key error in fullText.chunks

I have…

  • [x] Checked the logs and have provided the logs if I found something suspicious there

I’m submitting a…

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

Current behavior

The key files_id is duplicated in the Squidex.fullText.chunks Mongo collection, causing an error in the TextIndexer consumer. Consequently, full-text search stops working as well.

Expected behavior

The system should not duplicate keys.

Minimal reproduction of the problem

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version
  • [X] Azure cloud with docker + kubernetes

Version: [4.2.0]

Browser:

  • [X] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Log with the relevant info

MongoDB.Driver.MongoBulkWriteException`1[MongoDB.Bson.BsonDocument]: A bulk write operation resulted in one or more errors.
  E11000 duplicate key error collection: Squidex.fullText.chunks index: files_id_1_n_1 dup key: { files_id: "index_c1829165-6a8e-4217-9372-d1a25493e9c8", n: 0 }
   at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)

There is not that much I can do about it, the chunks are managed by GridFS. Your only option is to repair it manually or clear everything and restart the indexer.