Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer setup documentation suggestions #1353

Open
KrisSiegel opened this issue Apr 11, 2024 · 3 comments
Open

Developer setup documentation suggestions #1353

KrisSiegel opened this issue Apr 11, 2024 · 3 comments
Assignees

Comments

@KrisSiegel
Copy link
Contributor

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
Copy link
Member

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

@KrisSiegel
Copy link
Contributor Author

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

@cwarnermm
Copy link
Member

Thanks, @KrisSiegel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants