Skip to content
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

Automatic Oembed cache cleaning does not work #29434

Closed
Gummikavalier opened this issue Jun 2, 2023 · 0 comments · Fixed by #31336
Closed

Automatic Oembed cache cleaning does not work #29434

Gummikavalier opened this issue Jun 2, 2023 · 0 comments · Fixed by #31336

Comments

@Gummikavalier
Copy link

Gummikavalier commented Jun 2, 2023

Description:

We noticed on multiple RC installs that rocketchat_oembed_cache collection is never cleaned up by the automatic process of RC. The default cache expiration time is 30 days, and this value is not respected.

This collection is used as a cache for generating previews in the messages. It seems to contain full original web pages of the links in the messages, hence it can grow quite big on the old RC setups.

Steps to reproduce:

  1. Dump the database and mark down the size of the file rocketchat_oembed_cache.bson.
  2. Log into database and run db.rocketchat_oembed_cache.find().pretty(). Mark down the time of some entry in the beginning of the output. (The last entry will do too as the output limiter cuts it early anyway.)
  3. Press Clear cache button under Admin -> Settings -> Message -> Embed Cache Expiration Days
  4. After a while you'll get an error message. Don't mind that as the button seems to work regardless.
  5. Run the db.rocketchat_oembed_cache.find().pretty() in the database again and make note of time stamps.
  6. Dump the database again and make note of the new size of the file rocketchat_oembed_cache.bson.

Expected behavior:

There should not be more than 30 days worth of content in the oembed cache when the Admin -> Settings -> Message -> Embed Cache Expiration Days settings has been set to 30 days.

Actual behavior:

The Embed Cache Expiration Days setting is not respected. The database contains preview source data from far longer time period.

The manual operation using the Clear button works, although it outputs an error message e.params is not iterable (cannot read property).

In our case, after the manual clearing of the table using the Clear button, the size of the collection dropped from 4.6 GB to 178 MB.

Server Setup Information:

  • Version of Rocket.Chat Server: 6.2.1
  • Operating System: RHEL8
  • Deployment Method: tar
  • Number of Running Instances: 10
  • DB Replicaset Oplog: Yes
  • NodeJS Version: 14.21.3
  • MongoDB Version: 5.0

Client Setup Information

  • Desktop App or Browser Version: Any

Additional context

Looking at the timestamps of the uncleared cache, the cleaning process of oembed cache stopped working a year ago in 2022 April/May.

@Gummikavalier Gummikavalier changed the title Oembed cache cleaning does not work Automatic Oembed cache cleaning does not work Jun 2, 2023
@kodiakhq kodiakhq bot closed this as completed in #31336 Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant