[AutoGPT][troubleshoot]Error while fetching server API version: (‘Connection aborted.’, PermissionError(13, ‘Permission denied’))

Ruka
2 min readMay 9, 2023

RCA (Root Cause Analysis)

execute_code.py line 44

client = docker.from_env()

Cause by docker not available from host OS.

Troubleshoot/Fix steps

Step 1: Install docker

sudo apt install docker.io

I’ve also try install by snap but that doesn’t work for me.

Step 2: Add current user to user group

run the follow command in cli to add current user to group

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

check the status with the following command, you should see your user name on the cli.

groups

If the user name didn’t show up, try this command

sudo chown root:docker /var/run/docker.sock

Step 3: test from code

open your python and run the command

import docker
docker.from_env()

You should get something like this screenshot.

If the output still shows this error, try to fix it.

Step 4: Done

The problem should solved in AutoGPT, try to run it ansd see if the issue is solved.

Workaround

Use docker to run AutoGPT

According to the source code of autoGpt, if the autoGpt is running in a docker container, it will execute the python file directly in it, which will also solve this issue.

Ref

--

--