mattermost / mattermost-developer-documentation

Mattermost developer documentation.
https://developers.mattermost.com
BSD 3-Clause "New" or "Revised" License
79 stars 383 forks source link

Developer setup documentation suggestions #1353

Open KrisSiegel opened 3 months ago

KrisSiegel commented 3 months ago

As someone new to building and running Mattermost, I just wanted to mention a few minor stumbles I went through. I would have just created a PR but I wasn't sure if these changes would be acceptable or not so I wanted to mention it here first (I'd be happy to submit a PR for any of these).

Specifically referring to this page: https://developers.mattermost.com/contribute/developer-setup/

Install Go.

Above this line mentions doing this in WSL. One thing to notice is once I setup WSL2, I noticed my Ubuntu had Go 1.8 but the server/go.mod file is actually looking for Go 1.21 (or more specifically 1.21.8). When I tried to initially run make this failed because my version of Go was too old.

It might be helpful to mention a minimum version here. I installed Go 1.22.1 and it worked fine.

Install Docker. If you don’t want to use Docker, you can follow this guide.

One fun issue I ran into with WSL2 was attempting to run any docker command inside of WSL2 and having it fail with the following error message:

The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

For details about using Docker Desktop with WSL 2, visit:

https://docs.docker.com/go/wsl2/

The fix for this error message was to open Docker Desktop, open Settings, go to General, uncheck the Use the WSL 2 based engine, let it apply and restart, then go back into that same screen and re-check the Use the WSL 2 based engine box. This seemed to properly install the integration between Docker and WSL 2.

Might be helpful to mention this step.

make run-server

One small issue I ran into here is:

docker compose rm start_dependencies
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.oneoff%3DFalse%22%3Atrue%2C%22com.docker.compose.project%3Dmattermost-server%22%3Atrue%2C%22com.docker.compose.service%3Dstart_dependencies%22%3Atrue%7D%7D": dial unix /var/run/docker.sock: connect: permission denied
make: *** [Makefile:223: start-docker] Error 1

This was with a fresh install of everything. So I checked the group info

ls -lca /var/run/
...
srw-rw----  1 root docker    0 Apr 10 17:46 docker.sock
...

It seems the default permission was set incorrectly? I updated it with sudo chmod 666 /var/run/docker.sock and it ran fine afterward.

I'm not sure if this would necessarily have a place in the documentation or not, however.

cwarnermm commented 3 months ago

Thank you, @KrisSiegel, for raising these issues! Are you open to creating a pull request incorporating your feedback?

KrisSiegel commented 3 months ago

Can do, @cwarnermm! I'll toss something together soon.

cwarnermm commented 3 months ago

Thanks, @KrisSiegel!