-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
After migration failure, Rocket.Chat complains "control is locked" #5542
Comments
I'm having this same issue ( |
Having the same issue as well, after unlocking the db in mongo I will get the follow error in journal cannot read property 'username' of undefined and db locked at version 76, target version 79 |
Having the same issue |
@kentonv can you give us access to a instance currently having this problem? It would help to speedup the fix. |
I guess the error was here https://github.com/RocketChat/Rocket.Chat/blob/develop/server/startup/migrations/v077.js#L16 Trying to use some user that was not found. Can someone find the exception when the migration was locked at the first time? |
Yes, we are using livechat. Unfortunately can't test anything anymore - had to start with clean database. |
@sampaiodiego can/should we test for the existence of username on that migration? |
@rodrigok Yes, we're also using Livechat. |
Sorry for that guys. I did the fix on develop branch now, we will ship the solution within release 49.1 ASAP. You can unlock your database if you have access to it using:
|
@rodrigok But this issue, #5542, is about what happens after a migration fails. On Sandstorm, users can't easily log into a Mongo shell to unlock their database -- and as Sandstorm is designed for non-technical users, we'd prefer that they not have to. Why does Rocket.Chat "lock" the database like this at all? Could it instead retry migration the next time it starts up (possibly failing again, unless there has been an update)? |
Agreed. Ubuntu Snaps are not easy to get into the backend of. My snap isn't refreshing to 49.1 either. Not sure if it has been pushed to the Snap server or not. Thanks for the quick response! |
@engelgabriel it seems this issue was closed without addressing the concerns about database locking brought up by both the Sandstorm and Snap users' community. In practice, can we say that the 'fixes' for migration problems (in later versions) will always unlock the db and update the scheme correctly - as long as all versions are updated in sequence? Thanks. |
I'll read the https://github.com/RocketChat/Rocket.Chat/blob/ad650a36f2a5cb19641ec573499f517f4c157cc9/packages/rocketchat-migrations/migrations.js again and I'll explain it better how it works here. |
I got a Rocket.Chat instance upgraded by doing the following - in my log (which I found by running |
Just had the same issue today when server upgraded. The fix mentioned by @lightweight worked. Except it's 'parties' now instead of 'rocketchat' |
Have this issue with our snap version migrating from 065.x to 0.66.1. Anyone have a pointers on how to get into Mongo in snap to try to get this fix applied? |
@JoeatMJ I did this below, but you may need to change '125' to whatever it says the database is locked at and then add one to that version number. You can often find the locked db version by checking the rocketchat log 'sudo journalctl -u snap.rocketchat-server.rocketchat-server'
|
@cloudsandladders - YOU ARE AWESOME! The server is up again. The server showed that it was at 125, but needed 129. Any issues with such a far leap in updates? |
@JoeatMJ That is what mine read too. I don't know why it happened, but unlocking 125 fixed it. |
Diagnostics: Error:
Solution:
|
By doing this you skip migrations. Anyone that follows, please do not repeat this. You are asking to have random bugs going forward. Migrations are in place to migrate you from one schema to another. If you do not complete the migration your data will not be in the correct schema and you can pretty much count on increased bugginess going forward. |
If you are having this please see: #11353 |
@geekgonecrazy thank you for your warning. I unfortunately have already done this. What is the best course to undo this and so the db can migrate correctly? |
I tried to fix it by modifying the database. but when I start the server, the "lock" returns to "true" { |
Your Rocket.Chat version: 0.49.0
In #5541 I documented a migration failure. Another issue surfaces after the failure: If I restart the grain, Rocket.Chat seems to get stuck claiming that "control is locked". There is only one instance of Rocket.Chat running, but it seems the database is somehow marked "locked" in a way that doesn't resolve automatically. Is this intentional? I would expect Rocket.Chat to retry the failed migration.
Here's the log from the point of clicking "restart" (this is the same grain from #5541):
The text was updated successfully, but these errors were encountered: