Can not execute "tutor local quickstart" without "sudo" on Ubuntu server

I have a DigitalOcean server running Ubuntu 20.04 with

RAM: 8GB
SSD: 160 GB

I installed docker and docker-compose as specified in their official documentation.
I installed tutor after that using direct binary download method.

When I try to run tutor local quickstart I am faced with an error complaining about lack of permissions as shown below

docker-compose -f /home/abdelaziz/.local/share/tutor/env/local/docker-compose.yml -f /home/abdelaziz/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local stop
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 205, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 228, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 123, in perform_command
  File "compose/cli/command.py", line 69, in project_from_options
  File "compose/cli/command.py", line 132, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 188, in __init__
  File "docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
[25258] Failed to execute script docker-compose
Error: Command failed with status 255: docker-compose -f /home/abdelaziz/.local/share/tutor/env/local/docker-compose.yml -f /home/abdelaziz/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local stop

When I use sudo tutor local quickstart everything works well. But as I can see in the warning message it is not recommended to use sudo for it.

Am I missing something here? Any help is appreciated.

1 Like

Hi,

$ sudo usermod -aG docker $USER

Than reboot server

2 Likes

I am using WSL2 that uses a Linux Kernel (Ubuntu 20.04). I am getting the error again. Is there a way to solve this problem in such cases? (I tried running the command there but restarting the PC or closing the terminal and retrying is still showing the same error).