hermes - 💡(How to fix) Fix [Bug]: execute_code failed (RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation) with Docker backend in Docker-out-of-Docker [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#16703Fetched 2026-04-28 06:51:25
View on GitHub
Comments
2
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×5commented ×2

Error Message

{ "role": "tool", "content": "{"error": "Tool execution failed: RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation."}", "tool_call_id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw" },

Root Cause

Root Cause Analysis (optional)

Code Example

{
          "id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "call_id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "response_item_id": "fc_8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "type": "function",
          "function": {
            "name": "execute_code",
            "arguments": "{\"code\":\"import spacy\\nimport textwrap....\"}"
          }
        }
      ]
}

---

{
      "role": "tool",
      "content": "{\"error\": \"Tool execution failed: RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation.\"}",
      "tool_call_id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw"
    },

---

hermes@6c4adb7e4beb:/opt/hermes$ docker version
Client:
 Version:           26.1.5+dfsg1
 API version:       1.45
 Go version:        go1.24.4
 Git commit:        a72d7cd
 Built:             Sun Mar  8 15:28:39 2026
 OS/Arch:           linux/amd64
 Context:           default
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version": dial unix /var/run/docker.sock: connect: permission denied

---

docker exec -it hermes-cli /bin/bash
root@6b3d839cfee3:/opt/hermes# pwd
/opt/hermes
root@6b3d839cfee3:/opt/hermes# docker version
Client:
 Version:           26.1.5+dfsg1
 API version:       1.45
 Go version:        go1.24.4
 Git commit:        a72d7cd
 Built:             Sun Mar  8 15:28:39 2026
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.2.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       8b539b8
  Built:            Fri Sep  6 12:08:10 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

---

Report     https://paste.rs/mt8K5
  agent.log  https://paste.rs/DTNEu

---
RAW_BUFFERClick to expand / collapse

Bug Description

Hi,

I am running Hermes Agent v0.11.0 (2026.4.23) in cli mode from the official docker image with terminal.backend: docker via Docker-out-of-Docker (DooD), ie -v /var/run/docker.sock:/var/run/docker.sock. When agent requested 'execute_code' tool:

{
          "id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "call_id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "response_item_id": "fc_8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw",
          "type": "function",
          "function": {
            "name": "execute_code",
            "arguments": "{\"code\":\"import spacy\\nimport textwrap....\"}"
          }
        }
      ]
}

it encounters the following error response:

    {
      "role": "tool",
      "content": "{\"error\": \"Tool execution failed: RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation.\"}",
      "tool_call_id": "8KVHV7w4AYD2HA9YJ9C2CcnW6ZvzZ3Iw"
    },

To debug the issue, I attached to the running docker container (hermes cli) as hermes user and ran docker version command which failed:

hermes@6c4adb7e4beb:/opt/hermes$ docker version
Client:
 Version:           26.1.5+dfsg1
 API version:       1.45
 Go version:        go1.24.4
 Git commit:        a72d7cd
 Built:             Sun Mar  8 15:28:39 2026
 OS/Arch:           linux/amd64
 Context:           default
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version": dial unix /var/run/docker.sock: connect: permission denied

When I re-attached to the running docker container as root user and ran docker version command, it executed successfully:

 docker exec -it hermes-cli /bin/bash
root@6b3d839cfee3:/opt/hermes# pwd
/opt/hermes
root@6b3d839cfee3:/opt/hermes# docker version
Client:
 Version:           26.1.5+dfsg1
 API version:       1.45
 Go version:        go1.24.4
 Git commit:        a72d7cd
 Built:             Sun Mar  8 15:28:39 2026
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.2.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       8b539b8
  Built:            Fri Sep  6 12:08:10 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Steps to Reproduce

  1. docker pull nousresearch/hermes-agent:latest
  2. run basic setup is necessary, set terminal.backend = docker
  3. docker run -it --rm --name hermes-cli -v /var/run/docker.sock:/var/run/docker.sock -v ~/docker/volumes/hermes/:/opt/data -e AGENT_BROWSER_EXECUTABLE_PATH=/opt/hermes/.playwright/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell nousresearch/hermes-agent
  4. prompt the agent to "Use spaCy to extract entities from https://arxiv.org/html/2604.21896v1 paper"

Expected Behavior

Agent creates a python script and executes the script in an isolated docker runtime and returns results.

Actual Behavior

Encountered "Tool execution failed: RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation." error.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/mt8K5
  agent.log  https://paste.rs/DTNEu

Operating System

Docker

Python Version

No response

Hermes Version

v0.11.0 (2026.4.23)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

hermes user does not belong to docker group and therefore lacks the permission to start a docker container.

Proposed Fix (optional)

I suspect we need to add hermes user to docker group but since the GID in the docker container needs to match host machine's docker GID, is it possible to pass host machine's docker GID as an env variable and add (both the docker group and user to the docker group) in the entry script?

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The most likely fix is to add the hermes user to the docker group to resolve the permission issue when executing the docker version command.

Guidance

  • The error occurs because the hermes user lacks permission to connect to the Docker daemon socket, which is required to execute the docker version command.
  • To verify the issue, run the docker version command as the hermes user in the container and check for the permission denied error.
  • To mitigate the issue, add the hermes user to the docker group by modifying the Docker container's entry script to include the necessary group addition commands.
  • Consider passing the host machine's Docker GID as an environment variable to ensure consistency between the container and host machine.

Example

# In the Docker container's entry script
groupadd -g $(stat -c '%g' /var/run/docker.sock) docker
usermod -aG docker hermes

This example adds a new group with the same GID as the host machine's Docker socket and then adds the hermes user to that group.

Notes

The proposed fix assumes that the hermes user and docker group are not already configured correctly. Additionally, the GID of the docker group on the host machine should match the GID used in the container.

Recommendation

Apply the workaround by adding the hermes user to the docker group, as this should resolve the permission issue and allow the docker version command to execute successfully.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: execute_code failed (RuntimeError: Docker command is available but 'docker version' failed. Check your Docker installation) with Docker backend in Docker-out-of-Docker [2 comments, 1 participants]