This seems to be a Mattermost issue and not permission issue, i had the same issue using Omniinstall, so i set up a new server and are using the tarball this time. Both is having the same issue.
It seems to work fine for 2-3 days and then it broke.
I am running Mattermost of Ubuntu 22, hosted on Hetzner
ImageProxy is disabled, and i have set S3 as the storage places, i have also tried with local storage. Not difference.
root@mattermost:/opt/mattermost/data# sudo su - mattermost
su: warning: cannot change directory to /home/mattermost: No such file or directory
$ ls
20230921 20230922 20230928 brand users
$ pwd
/opt/mattermost/data
$ ls -la
total 28
drwxrwxrwx 7 mattermost mattermost 4096 Sep 28 19:05 .
drwxrwxr-x 12 mattermost mattermost 4096 Sep 20 22:11 ..
drwxrwxrwx 3 mattermost mattermost 4096 Sep 21 01:01 20230921
drwxrwxrwx 3 mattermost mattermost 4096 Sep 22 00:59 20230922
drwxrwxrwx 2 root root 4096 Sep 28 19:05 20230928
drwxrwxrwx 2 mattermost mattermost 4096 Sep 20 22:54 brand
drwxrwxrwx 11 mattermost mattermost 4096 Sep 22 18:01 users
$ cd u
-sh: 4: cd: can't cd to u
$ cd users
$ ls
4wztbwmea3rcde3j1dp4djb19c ctzb1mtq3bggjkrxwetwubxknc hprgfdwsbpdbirum36fjrq1wiy r7rdf5kyeirmxqcuf4nfm7pauc xe5uzemdcfgnjbi1e8ejimk11o
5umy9eogr7ntffmezcqphfco7o d1pe59ntafyuzcjbesr7ucpoie n79i9ceknpddz8xh6fh1wf5cnr sz6rj9uag38bmyfk9zi3kza71a
$ cd 4wztbwmea3rcde3j1dp4djb19c
$ ls
profile.png
$ pwd
/opt/mattermost/data/users/4wztbwmea3rcde3j1dp4djb19c
$ less profile.png
"profile.png" may be a binary file. See it anyway?
$ touch testfile
$ ls
profile.png testfile
$ pwd
/opt/mattermost/data/users/4wztbwmea3rcde3j1dp4djb19c
The Application is running as Mattermost:
root@mattermost:/opt/mattermost/data# ps aux | grep mattermost
matterm+ 122078 0.1 3.4 1870680 134792 ? Ssl Sep28 8:18 /opt/mattermost/bin/mattermost
matterm+ 122088 0.0 0.5 729396 20236 ? Sl Sep28 0:31 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64
matterm+ 122096 0.7 0.8 736436 34740 ? Sl Sep28 39:50 plugins/com.mattermost.calls/server/dist/plugin-linux-amd64
root 184144 0.0 0.0 6608 2236 pts/0 S+ 21:21 0:00 grep --color=auto mattermost
root@mattermost:/opt/mattermost/data# systemctl status mattermost
● mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-09-28 01:23:52 UTC; 3 days ago
Main PID: 122078 (mattermost)
Tasks: 29 (limit: 4523)
Memory: 254.7M
CPU: 48min 41.067s
CGroup: /system.slice/mattermost.service
├─122078 /opt/mattermost/bin/mattermost
├─122088 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64
└─122096 plugins/com.mattermost.calls/server/dist/plugin-linux-amd64
Oct 01 21:23:06 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:06.514 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:06 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:06.519 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:06 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:06.524 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:06 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:06.554 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:06 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:06.554 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:10 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:10.675 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:163","m>
Oct 01 21:23:22 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:22.304 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:>
Oct 01 21:23:22 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:22.307 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:>
Oct 01 21:23:38 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:38.209 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:>
Oct 01 21:23:38 mattermost mattermost[122078]: {"timestamp":"2023-10-01 21:23:38.209 Z","level":"debug","msg":"Websocket request","caller":"wsapi/websocket_handler.go:>
It is not a disk space issue:
root@mattermost:/opt/mattermost/data# df -h /opt/mattermost/data
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 75G 4.1G 68G 6% /
I also tried if it was using the /var/mattermost/data instead of /opt/mattermost/data, same issue:
root@mattermost:/opt/mattermost/data# mkdir -p /var/opt/mattermost/data
root@mattermost:/var/opt/mattermost/data# sudo chown mattermost:mattermost -R /var/opt/mattermost/data
root@mattermost:/var/opt/mattermost/data# sudo chmod 700 -R /var/opt/mattermost/data
root@mattermost:/var/opt/mattermost# ls -la
total 12
drwxr-xr-x 3 root root 4096 Oct 1 21:47 .
drwxr-xr-x 3 root root 4096 Oct 1 21:47 ..
drwx------ 2 mattermost mattermost 4096 Oct 1 21:47 data
The working directory is correct:
root@mattermost:/opt/mattermost/config# ls -l /proc/655/cwd
lrwxrwxrwx 1 mattermost mattermost 0 Oct 1 22:02 /proc/655/cwd -> /opt/mattermost
root@mattermost:/opt/mattermost/config# pwdx 655
655: /opt/mattermost
File settings:
"FileSettings": {
"EnableFileAttachments": true,
"EnableMobileUpload": true,
"EnableMobileDownload": true,
"MaxFileSize": 104857600,
"MaxImageResolution": 33177600,
"MaxImageDecoderConcurrency": -1,
"DriverName": "amazons3",
"Directory": "./data/",
"EnablePublicLink": false,
"ExtractContent": true,
"ArchiveRecursion": false,
"PublicLinkSalt": "xxxxxxxxxxxxxxxxx",
"InitialFont": "nunito-bold.ttf",
"AmazonS3AccessKeyId": "xxxxxxxxxxxxxx",
"AmazonS3SecretAccessKey": "xxxxxxxxxxxxxxxxxx",
"AmazonS3Bucket": "xxxxxxxxxxxxxxx",
"AmazonS3PathPrefix": "",
"AmazonS3Region": "us-east-1",
"AmazonS3Endpoint": "s3.amazonaws.com",
"AmazonS3SSL": false,
"AmazonS3SignV2": false,
"AmazonS3SSE": false,
"AmazonS3Trace": false,
"AmazonS3RequestTimeoutMilliseconds": 30000,
"DedicatedExportStore": false,
"ExportDriverName": "local",
"ExportDirectory": "./data/",
"ExportAmazonS3AccessKeyId": "",
"ExportAmazonS3SecretAccessKey": "",
"ExportAmazonS3Bucket": "",
"ExportAmazonS3PathPrefix": "",
"ExportAmazonS3Region": "",
"ExportAmazonS3Endpoint": "s3.amazonaws.com",
"ExportAmazonS3SSL": true,
"ExportAmazonS3SignV2": false,
"ExportAmazonS3SSE": false,
"ExportAmazonS3Trace": false,
"ExportAmazonS3RequestTimeoutMilliseconds": 30000,
"ExportAmazonS3PresignExpiresSeconds": 21600
},
Update: I just changed the file upload to Local Storage and restarted the server, it seems like the upload is working now. So the issue must be with the S3 integration.