Images not showing or downloading since upgrade from 6.1 to 7.5

For feature requests, please see: http://www.mattermost.org/feature-requests/.

For troubleshooting questions, please post in the following format:

Summary
I recently upgraded self hosted mattermost from 6.1 to 7.5 and cannot see or download image files or other files on server. I did the chown command on the directory and files including the data directory. Previously, I had set the path directly to the data folder on a separate drive in the server and attempted the same here.

Steps to reproduce
I changed owner on the mattermost folder in opt. changed into mattermost and did similarly to all files. I also changed owner on the /mnt/mm/data folder as well. I also changed permissions to further grant additional permissions.

Expected behavior
Upon opening client, I should see and be able to download images and/or files.

Observed behavior
I reach a channel and see a blank space. Attempting to download gives me the below image

I did end up resolving. It seems mattermost didn’t like going outside its directory? I put in a symlink for the mnt/mm/data folder and changed owners. All good now!

Hi and welcome to the Mattermost forums!

Well, actually it does, I have it running like this also. What does your FileSettings.Directory option look like in your config.json? On my system, it’s pointing to /data/mattermost which is also outside the /opt/mattermost installation directory and it works without issues. So you’re saying that when you point it to this directory, that Mattermost is unable to load files from there and when you create a symlink from let’s say /opt/mattermost/data to /mnt/mm/data it works without changing anything else?
If that’s the case, then the only thing I can think of is that there’s a deployment-related configuration that prevents reading or writing files from/to a directory that’s not below the base directory (could be a systemd restriction, a missing filesystem label, a wrongly configure docker volume, etc…)

Right. It current is set to default “./data”. Previously, I had it set as the /mnt/mm/data and tested by uploading an image I had on my desktop. And I found a /mnt/mm/data path in the /opt/mattermost directory instead of going up to the root directory. Previously on 6.1, I had it pathed as the /mnt/mm/data and found it worked just fine. And all those are possible, this is a personal home project, and I’m not super knowledgeable or experienced in much of this except rudimentary understanding of linux and following instructions.

But, setting up data as a symlink in the mattermost directory while the link points to the /mnt/mm/data directory did do the trick.

That’s very interesting - in this new topic a user reported almost the same issue, but I was unable to reproduce that on my 7.5.1 demo.

Can you tell me a bit more about your environment, please? What deployment model (binary, docker, omnibus, etc.) did you use and can you share the output of the command jq .FileSettings /opt/mattermost/config/config.json (if this is the path to your config.json)?