RocketChat / RocketChat/Rocket.Chat

Problem uploading avatars and files sent as images after domain migration

Open
#15,465 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Hi!
My installation uses S3 minio as backend storage. The problem is as follows:
After migrating from domain alpha-domain.exp to beta-domain.exp all avatars and files sent as images are no longer accessible within the target installation.

I have inspected mongodb’s collection ‘rocketchat_avatars’ and I can see that all avatars have url leading to http of my old installation.

{ "_id" : "MBz2Y5akv5iopKKKm", "userId" : "jqzQxwnRtcZgYrAs4", "type" : "image/jpeg", "size" : 5798, "AmazonS3" : { "path" : "R5pn7Qb7gYr8KaRjq/avatars/jqzQxwnRtcZgYrAs4" }, "store" : "AmazonS3:Avatars", "_updatedAt" : ISODate("2019-09-03T22:48:25.305Z"), "instanceId" : "d8PpwXcfMQ9WHLB6o", "name" : "my.user", "complete" : true, "etag" : "33GaT9GPx78m4MK8r", "path" : "/ufs/AmazonS3:Avatars/MBz2Y5akv5iopKKKm/undefined", "progress" : 1, "token" : "69D878A978", "uploadedAt" : ISODate("2019-09-03T22:48:25.769Z"), "uploading" : false, "url" : "https://alpha-domain.exp/ufs/AmazonS3:Avatars/MBz2Y5akv5iopKKKm/undefined" }

I have tried changing

{"url" : "https://beta-domain.exp/ufs/AmazonS3:Avatars/"

, but to no avail.
Could you help me proceed with my migration to the new domain and give a few tips on how to make it as seamless as possible?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MongoDB collection rocketchat_avatars and compare the stored url, path, and AmazonS3 fields before and after the domain migration. Reproduce the problem with an existing avatar or image attachment, then verify that stored files resolve through beta-domain.exp without losing access to the Minio-backed objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb
Domain
backend, cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.