Replies: 2 comments
|
The Here's what's likely happening:
Fix: Set That's 1 year in seconds. The URLs will still technically expire, but effectively last forever. Alternative — make the MinIO bucket publicly readable: If your MinIO instance is internal/trusted, set the bucket policy to allow public reads: mc anonymous set download myminio/rocketchat-uploadsThen in Rocket.Chat settings:
With proxy mode + public bucket, the presigned URL expiry becomes irrelevant because Rocket.Chat fetches the file server-side using its configured credentials. To verify files still exist in MinIO: mc ls myminio/rocketchat-uploads/If the files are there, it's purely a URL expiry issue, not a deletion issue. |
|
How it works (same in 8.0.1 and current
So the setting you'd want doesn't exist: confirmed uploads simply never have Things to check:
To see which uploads are still marked temporary: db.rocketchat_uploads.find(
{ expiresAt: { $exists: true } },
{ name: 1, rid: 1, userId: 1, uploadedAt: 1, expiresAt: 1 }
)As a stopgap while you find the cause, you can clear the marker on uploads that really are attached to a message (this is exactly what db.rocketchat_uploads.find({ expiresAt: { $exists: true } }).forEach((u) => {
const msg = db.rocketchat_message.findOne(
{ $or: [{ 'file._id': u._id }, { 'files._id': u._id }] },
{ _id: 1 }
);
if (msg) {
db.rocketchat_uploads.updateOne({ _id: u._id }, { $unset: { expiresAt: 1 } });
}
});Take a backup first. Files the cron has already removed are gone from the bucket unless you have versioning enabled on it. |
Uh oh!
There was an error while loading. Please reload this page.
Description:
I’m running Rocket.Chat version 8.0.1 in a Docker container and MinIO also in a Docker container for file uploads. Files uploaded via Rocket.Chat (
store: AmazonS3:Uploads) are automatically assigned anexpiresAttimestamp and become unavailable after ~1 day, even though:Observed Behavior:
rocketchat_uploadsdocuments always haveexpiresAt = uploadedAt + ~1 day.expiresAtpersists for new uploads even after disabling URL expiry & retention policies.What I’ve Checked / Tried:
FileUpload_S3_URLExpiryTimeSpan = 0in admin settingsexpiresAtindex is not TTLQuestions:
expiresAtwhen URL expiry and retention are disabled?expiresAt?expiresAtfor S3 uploads?All reactions