We're Hiring!

Mattermost, Inc.

Mattermost only display data before a date

Dear Supporting team,
I use CentOS Linux release 8.2.2004 (Core) , and I use the MySQL version 8. I use Mattermost 5.27.0 My staff reported to me that Mattermost only display data before 26-11-2020, but when I search Mattermost data at /opt/mattermost/data/ . It includes 2020122 folder with team member folders and uploaded Mattermst photos. Could you help me to solve the problems? Please refer to attached image. Thank you.

Hi, @Ada

One of the first thing that I would recommend you to do is to check on the ownership & permission of the directory. It’s one of the common cases where they limits the visibility of the file/attachments from the client.

Run sudo chown -R mattermost:mattermost /opt/mattermost command and once done, confirm the ownership of the directory.

For example, this is how it looks like on my end:

ahmaddanial@mattermost:/opt/mattermost/data# ls -lAh | grep 20210526
drwxr-x--- 3 mattermost mattermost 4.0K May 26 05:53 20210526

Take note of the permissions as well. In this case, it is sudo chmod 750 for the specific file 20210526.

If you want to go into detail, you can also deeper into the file structure and check the permission of those files. For example:

ahmaddanial@mattermost:/opt/mattermost/data/20210526/teams/noteam/channels# ls -lAh
total 8.0K
drwxr-x--- 3 mattermost mattermost 4.0K May 26 05:53 h6k8sbzpkjrm9jrecbm1ybw63h
drwxr-x--- 3 mattermost mattermost 4.0K May 26 05:53 x5zwqgc3jp8gtnk86febyz11ih
ahmaddanial@mattermost:/opt/mattermost/data/20210526/teams/noteam/channels/x5zwqgc3jp8gtnk86febyz11ih/users/6tqxzhbtg38t8cye65mdm3heqc# ls -lAh
total 12K
drwxr-x--- 2 mattermost mattermost 4.0K May 26 05:53 3swmcicj37fddn579rqd6kfzoe
drwxr-x--- 2 mattermost mattermost 4.0K May 26 05:53 cqsemsjqiigujnwanft677rmta
drwxr-x--- 2 mattermost mattermost 4.0K May 26 05:53 znzdy1uqwt8xdy8q6cqssbiz7a

Let me know how it looks on your end. Thanks.

Dear @ahmaddanial ,
Thank you for your reply. Please refer to below image of how it looks on my end. Also, I would like to inform you that My staff reported to me that Mattermost only display data before 26-11-2020, which is on the Web UI. When she login to the Mattermost webpage. She can just only see message records before 26-11-2020. Could you help me to solve it?

Do you think suggesting just regranting ownership and proper read/write permissions to all files in the /opt/mattermost/data/ directory might be worth a shot? Just in case something somehow got changed in updates, etc?

1 Like

Hello, @Ada

Can you please run an ls -lAh on your /opt/mattermost/data directory instead of grepping the specific date? I want to see how the directory ownership and permission looks like on your end now. Since you showed that ls -lAh | grep 20210524 shows that there are no such file or directory, I want to understand what is the current set up.

@XxLilBoPeepsxX Good idea. We can do a recursive sudo chmod -R 750 /opt/mattermost/data in that case but before that, I just want to understand how it looks like on the user’s end now before we go down that path.

Dear @ahmaddanial ,
I would like to inform you that below image is the result of running an ls -lAh on your /opt/mattermost/data directory instead of grepping the specific date. Thank you.

Hi, @Ada

Got it. At this point, can you please run the following command on your CLI and once completed, confirm that the user can view the attachments uploaded?

sudo chmod -R 750 /opt/mattermost/data

Just so we are clear, this issue is pertaining to the attachments and not the posts, right? The reason why I am clarifying on this is because the posts are not stored in the /opt/mattermost/data directory but rather in the Posts table on the database.

Dear @ahmaddanial ,
Thank you for your reply. After running sudo chmod -R 750 /opt/mattermost/data command, the team members only can see post records before 26-11-2020.

Hello, @Ada

Sounds like we are dealing with posts instead of just the attachments. Can you run the SQL query below

SELECT COUNT(*) FROM Posts WHERE CreateAt >= 1606348800;
SELECT CreateAt, Type, Message, Filenames FROM Posts WHERE CreateAt >= 1606348800;

This should give us the information of the posts post November 26, 2020.

Dear @ahmaddanial ,
I would like to inform you that Below is the result running SELECT COUNT(*) FROM Posts WHERE CreateAt >= 1606348800; command.


Below is the part of result running SELECT CreateAt, Type, Message, Filenames FROM Posts WHERE CreateAt >= 16063488 command, as the result includes private message.

Hi, @Ada

Just to make sure that I am fully grasping the issue here. Users are unable to see messages/posts that were posted AFTER November 26, 2020 based on this:

Based on the result of 260 rows you shared, it means that there were 260 messages/posts that were sent after that. The screen shots don’t help much because we cannot see the details of it. Can you send me a direct message with the copy of the full result of the SQL below (in a .txt file)?

SELECT CreateAt, Type, Message, Filenames FROM Posts WHERE CreateAt >= 1606348800\G

Thank you.

Dear @ahmaddanial,
I would like to inform you that I have sent you a direct message with the copy of the full result of the SQL . Thank you.

1 Like

Hello, @Ada

Thanks for the update and sorry for the delayed response. I was away last week.

I’ll check on the file you shared and see what I find there.

Hi, @Ada

I went through the 260 records on the MySQL result you attached and all of them are just posts without any attachments. This is indicated by the following line:

Filenames: []

So, can you confirm exactly what is missing here? Are the users actually not able to view the all the 260 posts mentioned on their end from the desktop / web app?

Dear @ahmaddanial,
I would like to inform you that from current Mattermost post, it includes message and attachments such as images and documents. Also, I have confirmed our company Mattermost is missing post message with attachments after 26/11/2021 from the desktop / web app. Thank you.