# Mattermost only display data before a date

**URL:** <https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734>\
**Category:** Troubleshooting\
**Created:** [May 25, 2021, 10:11am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734 "2021-05-25T10:11:12Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [May 25, 2021, 10:11am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/1 "2021-05-25T10:11:12Z")

</div>

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.

 ![Screenshot from 2021-05-25 17-57-38](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/4/472da9ab9e7d324bb6d641163fe08d41ae25bc0a.png)

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 26, 2021, 5:59am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/2 "2021-05-26T05:59:54Z")

</div>

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:

```auto
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:

```auto
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

```

```auto
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.

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [May 26, 2021, 8:50am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/3 "2021-05-26T08:50:09Z")

</div>

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?

 ![Screenshot from 2021-05-26 16-41-47](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/e/eb9bbdbb3d6f1054eea08bdd32afdead84663765.png)

---

<div class="post-metadata">

**Author:** ![XxLilBoPeepsxX](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/xxlilbopeepsxx/32/4993_2.png) [@XxLilBoPeepsxX](https://forum.mattermost.com/u/XxLilBoPeepsxX)\
**Post date:** [May 26, 2021, 5:25pm UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/4 "2021-05-26T17:25:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 27, 2021, 1:23am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/5 "2021-05-27T01:23:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [May 27, 2021, 2:23am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/6 "2021-05-27T02:23:08Z")

</div>

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.

 ![Screenshot from 2021-05-27 10-19-16](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/8/8c32c45790589c33b732f74c3186d62cf2ec4d08.png)

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 27, 2021, 7:34am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/7 "2021-05-27T07:34:33Z")

</div>

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?

```auto
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.

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [May 27, 2021, 9:31am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/8 "2021-05-27T09:31:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 28, 2021, 12:07am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/9 "2021-05-28T00:07:35Z")

</div>

Hello, @Ada

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

```auto
SELECT COUNT(*) FROM Posts WHERE CreateAt >= 1606348800;

```

```auto
SELECT CreateAt, Type, Message, Filenames FROM Posts WHERE CreateAt >= 1606348800;

```

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

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [May 28, 2021, 3:01am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/10 "2021-05-28T03:01:53Z")

</div>

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

 ![Screenshot from 2021-05-28 10-56-22](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/a/a6560b4e349048ebe2c2901fe33d20b8cf26ddcf.png)  
Below is the part of result running ` SELECT CreateAt, Type, Message, Filenames FROM Posts WHERE CreateAt >= 16063488` command, as the result includes private message.  
 ![Screenshot from 2021-05-28 10-50-39](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/1/10a79066a6423b5affec2b1e0a4f2bb865cf0abd.png)  
 ![Screenshot from 2021-05-28 10-49-09](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/5/5091da866f89a7a050013135724b3b9ec72eb7cb.png)

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [May 30, 2021, 11:44pm UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/11 "2021-05-30T23:44:47Z")

</div>

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:

> [@Ada](#):
>
> My staff reported to me that Mattermost only display data before 26-11-2020

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)?

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

```

Thank you.

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [June 2, 2021, 2:52am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/12 "2021-06-02T02:52:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [June 6, 2021, 11:35pm UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/13 "2021-06-06T23:35:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [June 6, 2021, 11:52pm UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/14 "2021-06-06T23:52:27Z")

</div>

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:

```auto
Filenames: []

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/9/9f80a474b67a14d1e1e4e8e9bb1a9e518a56d4d2.png)

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?

---

<div class="post-metadata">

**Author:** ![Ada](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ada](https://forum.mattermost.com/u/Ada)\
**Post date:** [June 7, 2021, 9:52am UTC](https://forum.mattermost.com/t/mattermost-only-display-data-before-a-date/11734/15 "2021-06-07T09:52:35Z")

</div>

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.
