Mongo Database Index Error Message after Update to 7.7.0
Description:
After an Upgrade from Version 7.6.1 to 7.7.0 on a Docker container I became after start the Message in the Logfile.
docker container logs rocketchat
Some indexes for collection 'rocketchat_apps_logs' could not be created: Index already exists with a different name: _updatedAt_1 strict mode: missing type "object" for keyword "additionalProperties" at "#" (strictTypes)
It's a problem in the index design in the Mongo-DB Data Model and a performance issue in big databases.
Expected behavior:
please, correct the index problem.
Actual behavior:
Server Setup Information:
+---------------------------------------------------------+ | SERVER RUNNING | +---------------------------------------------------------+ | | | Rocket.Chat Version: 7.7.0 | | NodeJS Version: 22.14.0 - x64 | | MongoDB Version: 7.0.7 | | MongoDB Engine: wiredTiger | | Platform: linux | | Process Port: 3000 | | Site URL: https://rocketchat.deutschland.de | | ReplicaSet OpLog: Enabled | | Commit Hash: d224c87c80 | | Commit Branch: HEAD | | | +---------------------------------------------------------+
Have a search and read here for:
Index already exists with a different name
Thanks, your Information ist good. But it is not the solution for this Error. A Developer must do describe a workaround. It's an index design problem in the Mongo-DB.
Please advise:
Number of users Licence type File storage type
Thanks, your Information ist good. But it is not the solution for this Error. A Developer must do describe a workaround. It's an index design problem in the Mongo-DB.
If you have a paid licence then the correct channel is to open a ticket with support.
If you are on CE then note this is open source. No one HAS to do anything.........
This issue is still open - see my comments on duplicate indexes.
https://github.com/RocketChat/Rocket.Chat/issues/31876
The workaround is to drop the duplicate indexes.
Hy reetp,
your killer argument is right. No one HAS to do anything.........
It's a Version 7.7.0 Starter with <50 User.
I will test your workaround.
thanks for your help.
your killer argument is right.
It is.
No one HAS to do anything.........
Nope they don't. Equally you could propose a PR which they would consider....... :-)
I know it isn't what you want to hear but..... Rocket as a company has its own priorities. First are paying customers.
They release the source code here, but they have their own internal code base and issue trackers and so any issues here are on a 'ad hoc' basis. They may, or may not, choose to fix them. It depends on their needs and focus.
If you see the mentioned bug, duplicate index issues have been around some while and they are aware of them, but for whatever reason they have never been fixed. Presumably as it is non fatal.
The quick workaround is to stop Rocket, delete the indexes, and restart. Rocket will then create new ones.
As per my comments you might need to do that more than once.
Please let us know if it resolves it for you, and you can then close this.
After direkt update to Version 7.7.1 the Message in the log is the same. Some indexes for collection 'rocketchat_apps_logs' could not be created: Index already exists with a different name: _updatedAt_1 strict mode: missing type "object" for keyword "additionalProperties" at "#" (strictTypes)
+---------------------------------------------------------+ | SERVER RUNNING | +---------------------------------------------------------+ | | | Rocket.Chat Version: 7.7.1 | | NodeJS Version: 22.14.0 - x64 | | MongoDB Version: 7.0.7 | | MongoDB Engine: wiredTiger | | Platform: linux | | Process Port: 3000 | | Site URL: https://rocketchat.deutschland.de | | ReplicaSet OpLog: Enabled | | Commit Hash: c1bf9b1296 | | Commit Branch: HEAD | | | +---------------------------------------------------------+
i have not execute the workaround from reetp. The quick workaround is to stop Rocket, delete the indexes, and restart. Rocket will then create new ones.
i will test it in the next days and report here.
After direkt update to Version 7.7.3 the Message in the log is the same. Some indexes for collection 'rocketchat_apps_logs' could not be created: Index already exists with a different name: _updatedAt_1 strict mode: missing type "object" for keyword "additionalProperties" at "#" (strictTypes)
I see no interest from the development to solve this problem. i know, databases are not the first line in an product. But when the db not works or the datamodel ist not good, the application is slowly and unperformant.
Hey @thokich , appreciate the concern. The warning you see in the server means that Rocket.Chat tried to create an index for a specific query but that index already existed, except it does with a different name. That means that the system already benefits from the index, and will keep doing so.
The warning poses no harm besides being annoying :)
Doug, thanks for chipping in.
This has caused stress for a lot of users over a long period (me included!!)
It might be harmless, but importantly, they don't know that.
It's caused lots of unnecessary bugs & support questions that take time to manage.
Is there nothing that can be done to remove the duplicates?
Or hide the problem, or add a "advisory" warning eg 'nothing to worry about' rather than an error?
We're discussing how to better handle this situation, whether and how to supress.
We've reverted the naming of that index in the meanwhile https://github.com/RocketChat/Rocket.Chat/pull/36358
Thank you very much, the message no longer appears after the update from 7.7.3 to 7.7.4. I think you solved it and didn't hide it. Great job @d-gubert . I come from the software industry myself and administer TB databases. I often see that many applications neglect the underlying structure, namely the database. But the data model and indexes are crucial for performance and data volume. Duplicate indexes can also unnecessarily increase the data volume and worsen execution plans for database access. OK here was no duplicate Index, but when the index is here than it's here and must not create once more. It's a Bug and must correct in a Fix. I love Rocket and I like to test it as a user so that I can help you with development and make the Software better. So don't be angry about my messages here.
+---------------------------------------------------------+ | SERVER RUNNING | +---------------------------------------------------------+ | | | Rocket.Chat Version: 7.7.4 | | NodeJS Version: 22.14.0 - x64 | | MongoDB Version: 7.0.7 | | MongoDB Engine: wiredTiger | | Platform: linux | | Process Port: 3000 | | Site URL: https://rocketchat.deutschland.de | | ReplicaSet OpLog: Enabled | | Commit Hash: fe8bc08dd2 | | Commit Branch: HEAD | | | +---------------------------------------------------------+