Adding User to Proxy Fails

Output
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.49/containers/ssh/json": dial unix /var/run/docker.sock: connect: permission denied
output
Data
{
    "command": "docker exec ssh useradd -m -p '*' bench-0001-000007-f1",
    "directory": "/home/frappe/agent",
    "duration": "0:00:00.025545",
    "end": "2025-07-07 02:49:35.299042",
    "output": "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.49/containers/ssh/json\": dial unix /var/run/docker.sock: connect: permission denied",
    "returncode": 1,
    "start": "2025-07-07 02:49:35.273497",
    "status": "Failure",
    "traceback": "Traceback (most recent call last):\n  File \"/home/frappe/agent/repo/agent/base.py\", line 60, in execute\n    output, returncode = self.run_subprocess(\n  File \"/home/frappe/agent/repo/agent/base.py\", line 111, in run_subprocess\n    raise subprocess.CalledProcessError(returncode, command, output=output)\nsubprocess.CalledProcessError: Command 'docker exec ssh useradd -m -p '*' bench-0001-000007-f1' returned non-zero exit status 1.\n"
}
data
Traceback
Traceback (most recent call last):
  File "/home/frappe/agent/repo/agent/base.py", line 60, in execute
    output, returncode = self.run_subprocess(
  File "/home/frappe/agent/repo/agent/base.py", line 111, in run_subprocess
    raise subprocess.CalledProcessError(returncode, command, output=output)
subprocess.CalledProcessError: Command 'docker exec ssh useradd -m -p '*' bench-0001-000007-f1' returned non-zero exit status 1.
traceback

After building a bench and it tries to add it to the proxy it fails always, I even tried setting up proxysql in proxyserver but it didn’t work.

@Amein Hloo Bro,

First of all after you set up the proxy server you need to setup ssh certificate authority

After you did this you need to build this image

You need to choose that in the proxy server and also in the press settings

Then you need to run this set up ssh proxy in proxy server from actions(i already did it thus i dont have that option) in proxy server

Then you need to add the frappe user to the docker group. The root cause was that the frappe user lacked the necessary permissions to interact with Docker.

Even after assigning the appropriate permissions, it may not take effect immediately. In such cases, a service restart is required for the changes to apply properly.

To fix this:

  1. Add the frappe user to the docker group on the App Server.
  2. Restart the necessary services or agent on the App Server.
  3. On the Proxy Server, restart the following supervisor services:
sudo supervisorctl restart agent:web agent:redis agent:worker-0

This ensures that both permission changes and agent services are reloaded correctly.