We're Hiring!

Mattermost, Inc.

Permission denied on `./data` folder despite permissive folder mod

Summary

Permission denied on ./data folder despite permissive folder mod

Steps to reproduce

I installed mattermost according this guide on a uberspace 7 account.

2020-11-08T14:20:52.861+0100    debug   filesstore/localstore.go:33     Able to write files to local storage.
...
Version: 5.28.0
Build Number: 5.28.1
Build Date: Mon Oct 19 15:20:59 UTC 2020
Build Hash: d991504714aded3b97f95fea8f78a01e6ea125bb
Build Enterprise Ready: true
DB Version: 5.28.0

When I try to e.g. upload a user picture I get errors of the following type:

{"level":"error","ts":1604841828.7755823,"caller":"mlog/log.go:229","msg":"Couldn't upload profile image.","path":"/api/v4/users/bjjb8zjqiidizy7p3oqqnwobdo/image","request_id":"7unuy5esi7dmdm8zroeh6kmr3y","ip_addr":"xxxxxxxx","user_id":"bjjb8zjqiidizy7p3oqqnwobdo","method":"POST","err_where":"SetProfileImage","http_code":500,"err_details":""}
{"level":"debug","ts":1604841828.7758198,"caller":"web/handlers.go:100","msg":"Received HTTP request","method":"POST","url":"/api/v4/users/bjjb8zjqiidizy7p3oqqnwobdo/image","request_id":"7unuy5esi7dmdm8zroeh6kmr3y","status_code":"500"}
{"level":"error","ts":1604841828.8252504,"caller":"mlog/log.go:229","msg":"Encountered an error creating the directory for the new file.","path":"/api/v4/users/bjjb8zjqiidizy7p3oqqnwobdo/image","request_id":"kuuxfsmfnid8tfgut83h9qespa","ip_addr":"xxxxxxxxxx","user_id":"bjjb8zjqiidizy7p3oqqnwobdo","method":"GET","err_where":"WriteFile","http_code":500,"err_details":"directory=/data/users/bjjb8zjqiidizy7p3oqqnwobdo, err=mkdir data: permission denied"}
{"level":"debug","ts":1604841828.825436,"caller":"web/handlers.go:100","msg":"Received HTTP request","method":"GET","url":"/api/v4/users/bjjb8zjqiidizy7p3oqqnwobdo/image","request_id":"kuuxfsmfnid8tfgut83h9qespa","status_code":"500"}

So far, I have tried to change the data folder and create it myself as well as giving 777 to the data folder defined in the config (which is the standard ./data entry).
DEBUG level logs did not show anything immediate noteworthy.

Expected behavior

data folder should be writable and accessible to mm.

Observed behavior

Encountered an error creating the directory for the new file. and mkdir data: permission denied on user image upload.

Happy to answer any questions or give more information if needed.

Solved: The supervisord on uberspace runs all commands from /. Therefore the client attempts to create the data folder there. This is an u7 issue, not a Mattermost one. This can be closed.

The uberspace issue I created is here: https://github.com/Uberspace/lab/issues/823

1 Like