Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

[BUG] Rocket.Chat Apps data is not synchronized across Rocket.Chat instances

Open cuonghuunguyen opened this issue 4 years ago • 9 comments

We are using a production design that uses more than one host which multiple instances per host.

When deploying a Rocket.Chat App, we expect that the Rocket.Chat Apps data includes status and configurations are synchronized across all instances.

There is currently a bug in Rocket.Chat App Engine that makes Apps data cached and cannot be synced when we change the data in the other instances of Rocket.Chat.

In src/server/AppManager.ts, you load all of the data from the database in function load into field app. But then, in the function get you did not get the data from the database but from the app field. This makes the AppManager cannot get the updated information from the database as well as from the other instance.

We should fix this problem to let apps synchronize their data with the database and to provide consistency

cuonghuunguyen avatar Aug 04 '20 04:08 cuonghuunguyen

I got the same issue with my Rocket.Chat instances. Whenever I changed the App config, I have to restart all Rocket.Chat instances to let them retrieve configuration from database.

nghiaviettran avatar Aug 04 '20 04:08 nghiaviettran

@d-gubert @lolimay what changed to cause this to no longer work? Changing a setting on one instance used to change it across all other instances due to the oplog handler...this is a major breaking change without a doubt. 😢

graywolf336 avatar Aug 04 '20 15:08 graywolf336

Hey folks! This is definitely a non-trivial bug - there was no intentional change that would cause this behavior. We'll need further investigation to pinpoint what is happening.

d-gubert avatar Aug 12 '20 14:08 d-gubert

Are there any updates on this issue?

nghiaviettran avatar Sep 10 '20 12:09 nghiaviettran

For your information, the data in the database is still correct, somehow the app cannot get the updated data from the database. Restarting all instances makes the Apps data return to the correct value. However, every time we change the data, we still have to restart all the instances again 😭

cuonghuunguyen avatar Oct 20 '20 03:10 cuonghuunguyen

This issue is caused by the firewall between VMs. As my investigation, the server settings are synchronized by the mongo event handler but the Apps settings are only can be synced by the Stream Broadcast. Using a firewall between VMs blocks the connection therefore the settings cannot be synced Anw, it still seems to be a bug @d-gubert @lolimay @graywolf336

cuonghuunguyen avatar Mar 05 '21 04:03 cuonghuunguyen

Thanks @meomay503 for your effort! It helped us a lot! @d-gubert , do we have plans to fix it?

shiqimei avatar Mar 05 '21 10:03 shiqimei

Thanks for having a look into this issue, I've been looking for this fix for a very long time

cuonghuunguyen avatar Mar 07 '21 10:03 cuonghuunguyen

Hi, could you please inform me if you have any plan to move this sync to DB change stream or something? The information could help us a lot in planning the next steps. Thank you.

cuonghuunguyen avatar Jun 28 '21 07:06 cuonghuunguyen