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

Message retention policy is not deleting files, only messages are getting deleted. #13249

Closed
mddvul22 opened this issue Jan 24, 2019 · 8 comments
Assignees

Comments

@mddvul22
Copy link

Description:

We have retention policy enabled in our RC instance, with a maximum age of 7 days. The settings are configured to include private groups, channels, and direct messages. We don't exclude pinned messages from this policy. And we have "Only delete files" set to false. Messages older than 7 days are getting successfully deleted. However, old files are not getting deleted. We have some files that still remain from as far back as 2016. But, to be clear, none of our files are getting removed.

Steps to reproduce:

  1. Enable message retention policy and set a maximum age.
  2. Attach a file to a message.
  3. Let message/file get older than maximum age policy.
  4. Let policy activate and run
  5. Click on files list and see the files still exist.

Expected behavior:

We expect the files to be removed, along with the messages.

Actual behavior:

Files do not get removed.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.72.3
  • Operating System: Linux
  • Deployment Method: tar
  • Number of Running Instances: 2
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 8.9.3
  • MongoDB Version: 3.2

Additional context

image

image

Relevant logs:

Logs seem to show the policy working for messages:

Jan 24 00:00:00 chat rocketchat2: rocketchat_logger.js:299 #33[34mSyncedCron ➔ info#033[39m Starting "Prune old messages by retention policy".
Jan 24 00:00:52 chat rocketchat2: rocketchat_logger.js:299 #33[34mSyncedCron ➔ info#033[39m Finished "Prune old messages by retention policy".

@vynmera
Copy link
Contributor

vynmera commented Feb 6, 2019

Can you test a manual prune, and see if files disappear then? (e.g., create a channel, post some files, prune the channel, then see if the files are left). Perhaps someone updated the file storage logic without changing the references in the prune function.

@mddvul22
Copy link
Author

mddvul22 commented Feb 6, 2019

When I do a manual prune, in a test channel, the files are deleted, also.

@ggazzo ggazzo self-assigned this Feb 10, 2019
@tars21
Copy link

tars21 commented Aug 16, 2019

more or less the same here.

Rocket.Chat v1.1.2

Retention Policy settings:

applies to channels: true
applies to private groups: true
applies to direct messages: true
only delete files: true

"File removed by prune" worked on private chats and some Channels, but not all of them. A manual prune works there. Didn't test "Private Groups" so far.

@ggazzo
Copy link
Member

ggazzo commented Oct 17, 2019

@mddvul22 and @tars21 I think this pr fixes your problems #15252 could you test please? I will close this issue because I'm very confident we fixed, but any problem open it again..

@ggazzo ggazzo closed this as completed Oct 17, 2019
@mddvul22
Copy link
Author

mddvul22 commented Dec 4, 2019

We still have this problem. #15252 does not appear to have fixed our problem. Is there something that we need to do to enable the pruning, by cron, that is mentioned on that page? As mentioned in this ticket, we have a default retention policy of 7 days for everything. But we have files in channels, that are still viewable, going back several years.

@mddvul22
Copy link
Author

Apparently commenting to the issue doesn't automatically reopen it, and I'm not allowed to reopen it explicitly because I didn't close it myself. So, please reopen it :)

@mddvul22
Copy link
Author

@ggazzo can you please re-open? Thanks!

1 similar comment
@mddvul22
Copy link
Author

mddvul22 commented Jan 3, 2020

@ggazzo can you please re-open? Thanks!

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

No branches or pull requests

4 participants