-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.4.0 Upgrade: Error creating index: users -> { bio: 1 } #24347
Comments
same here. |
Same problem here. Looks like Meteor was upgraded from btw: just downgrading back to |
We have similar issue, but different index.
Rolled back to 4.3.3. |
just to let you guys know, even though there is this index warning, the system still works. |
No, it doesn't. The server job ends immediately. |
I tried deleting the index generating the error but quickly realized it is Every. Single. Index.
|
that's weird, on our Open server, we get the error only for anyways, we'll take a look on why this is happening.. I'll get back in case I need additional information.. thx |
I can confirm our server was dead too. Full log:
|
interesting.. apparently the ones that kill the server are coming from Meteor and not from Rocket.Chat code, because we do have a try/catch to prevent the server from crashing. |
I'm trying to reproduce the other index errors other than the I've started a rocket.chat version 2.0.0 and starting doing updates up to 4.4.0, and still didn't have such errors. I'm now trying to figure what other variables may take place here.. for you with errors preventing the server from starting up, what mongo version do you use? what is your deployment method? do you remember which was the first rocket.chat version deployed using the same database name? |
@sampaiodiego We deploy using the steps described in Manual Installation for Ubuntu. We have a bash script for it:
Then we replace We're currently running We're using same update process for the Rocket.chat since 12/2018 when we've started using it. Don't really remember what version it was. |
I have a feeling we might have to wait for upstream to fix meteor/meteor#11666 |
@sampaiodiego I can confirm that the fix in #24409 does work as @ixlandia already assumed. This has to be fixed in Meteor though. Untill then a workaround is probably to drop the problematic indexes and let meteor recreate them on startup. Some logs/info
startup log
|
Workaround for everyone looking for a quick solutionRocketChat v4.4.1 will start after manually dropping all old indexes. On start most (hopefully all) indexes should be recreated as I did the following and RocketChat started successfully: /**
* WARNING: be careful, especially with huge rocket instances
* this could take a while, cause heavy load and some indexes might not be recreated...
*/
// first stop rocketchat & backup db
// then run this in mongodb:
db.users.dropIndexes()
db.rocketchat_room.dropIndexes()
db.rocketchat_message.dropIndexes()
// start rocketchat => it should work and indexes should be recreated |
thanks @jthomaschewski .. indeed the indexes you had that were failing were from Meteor, and they don't have a try/catch to "ignore" the errors, that's why they prevent the server to start up. it is safe to remove indexes from DB as you did since they're re-created on every startup.. the ones we have on migrations are the ones that have changed the shape, in this case the one on the model would fail and then the migration would run and fix it. I'll be adding a special to the change log so people can find out how to remove indexes that are preventing the server to start up. |
Thanks for confirming that indexes will be recreated automatically @sampaiodiego Actually not only indexes from Meteor where failing. I started by dropping the index which failed during startup, restarting and so on. Many indexes where causing this issue - also some/all of Maybe recreating those very old indexes is a good idea anyways :-) |
This should be reopened -- or retitled because it's not fixed. |
for me version 4.4.1 fixed the bio index problem. I cannot speak for the other index cases above. |
@oliob I'm shocked these weren't caught to be honest -- I'm not attacking you, just making sure it's mentioned |
The issue is, that the issue seems to occur for every index, which was created with a quite old MongoDB version (+ probably old Meteor version). Also at least some indexes (those maintained by Meteor itself on It's a very hard one to be honest as it's more an issue of the underlying framework (Meteor) in combination with long running instances. Also one can hope for a fix in the Meteor framework which might make manual steps unnecessary in the future. |
To be clear: it doesn't make it not work, just screams when migrations are run |
Having the same problem. Firstly I had an index start issue, now the chat keeps restarting every few hours. No more logs provided just exit code:
Whats more, mobile application is missing avatars and sometimes a chat refresh on phone leads to whole RocketChat app crash. |
We tested the upgrade from 3.18.2 to version 4.5.5 and got these index errors:
Should we wait for a fix before installing the upgrade on the production server? @wojtokuba is your restarting issue fixed in newer versions? How long has the server been running before it keeps restarting? |
Upgraded 3.18.5 to 4.6.1 (manual installation), same error messages in log:
and
But, indeed, the server is/keeps running and seems to work. |
worked for me, ty 👍 |
I seem to have a similar problem when upgrading from 4.7.2 -> 4.8.1:
It seems this is not solved.
|
I had to run:
And from #26089 (comment)
|
@wreiske - thanks 🙇🏿 Was able to complete my full migration from 3.18 directly to 4.8.1 using your 6 index drops in addition to this rate limiter code. 'Only' dropping the 3 indexes did not resolve my issue. HTH somebody ❤️ 💋 |
Unfortunately this did not help me solve my problem.... And within the last command rate_limiter I get an writeError: Could be that I am blind now after the whole day on computer and lines, but I do not see the error. |
For anyone else having other index issues not listed in my comment above, look at the collection: In this case, the database is Connect to mongo using
Exit mongo and then reload your Rocket.Chat service. Rinse and repeat depending on if new errors arise. You may have multiple other indexes that need to be resolved depending on how you use Rocket.Chat. |
So I repeat the last command since there is no more error? |
If there are no more errors you shouldn't need to repeat any commands. Just start up Rocket.Chat and it should run all migrations and do the upgrade. This could take a few minutes depending on how powerful your server is. |
See, .... And the server is back in the reboot-loop. I do the same and add the It is confusing and frustrating. |
Hi,
error now the error does not occur anymore. Was this a safe action? I'm new to rocketchat so I dont know! |
@maxhaslbeck it is safe if you restart rocket.chat after removing all indexes since rocket.chat will create all required indexes during startup |
Description:
After upgrading from 4.3.2 to 4.4.0 i get the message on each start of rocketchat server:
Jan 29 15:19:18 chat rocketchat[180809]: Error creating index: users -> { bio: 1 } { sparse: 1 } MongoError: Index with name: bio_1 already exists with different options
Steps to reproduce:
Expected behavior:
no error message
Actual behavior:
see above
Server Setup Information:
Client Setup Information
Additional context
Relevant logs:
Jan 29 15:19:14 chat systemd[1]: Started The Rocket.Chat server.
Jan 29 15:19:18 chat rocketchat[180809]: Error creating index: users -> { bio: 1 } { sparse: 1 } MongoError: Index with name: bio_1 already exists with different options
Jan 29 15:19:18 chat rocketchat[180809]: at MessageStream.messageHandler (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
Jan 29 15:19:18 chat rocketchat[180809]: at MessageStream.emit (events.js:400:28)
Jan 29 15:19:18 chat rocketchat[180809]: at MessageStream.emit (domain.js:475:12)
Jan 29 15:19:18 chat rocketchat[180809]: at processIncomingData (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
Jan 29 15:19:18 chat rocketchat[180809]: at MessageStream._write (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
Jan 29 15:19:18 chat rocketchat[180809]: at writeOrBuffer (internal/streams/writable.js:358:12)
Jan 29 15:19:18 chat rocketchat[180809]: at MessageStream.Writable.write (internal/streams/writable.js:303:10)
Jan 29 15:19:18 chat rocketchat[180809]: at Socket.ondata (internal/streams/readable.js:731:22)
Jan 29 15:19:18 chat rocketchat[180809]: at Socket.emit (events.js:400:28)
Jan 29 15:19:18 chat rocketchat[180809]: at Socket.emit (domain.js:475:12)
Jan 29 15:19:18 chat rocketchat[180809]: at addChunk (internal/streams/readable.js:293:12)
Jan 29 15:19:18 chat rocketchat[180809]: at readableAddChunk (internal/streams/readable.js:267:9)
Jan 29 15:19:18 chat rocketchat[180809]: at Socket.Readable.push (internal/streams/readable.js:206:10)
Jan 29 15:19:18 chat rocketchat[180809]: at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Jan 29 15:19:18 chat rocketchat[180809]: at TCP.callbackTrampoline (internal/async_hooks.js:130:17) {
The text was updated successfully, but these errors were encountered: