08/21/2023, 6:04 PM
Hey team - what are the requirements prior to starting a worker on a server? I started a worker on our server, however when it picks up a flow I am getting the following error. We have other containers running fine on the server fine. Any help would be appreciated
Copy code
File "/usr/local/lib/python3.10/site-packages/prefect_docker/", line 485, in _get_client
    raise RuntimeError("Could not connect to Docker.") from exc

Jake Kaplan

08/21/2023, 6:08 PM
hey, this means that
isn't running on your system likely? (no docker daemon)
i think the rest of the traceback should have the original error
the worker is just trying to call:
Copy code
import docker
docker_client = docker.from_env()


08/21/2023, 6:19 PM
I think this is the root error:
Copy code
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 714, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/site-packages/urllib3/", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.10/http/", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/", line 1038, in _send_output
  File "/usr/local/lib/python3.10/http/", line 976, in send
  File "/usr/local/lib/python3.10/site-packages/docker/transport/", line 27, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:
systemctl status docker.service
Yields the following
Maybe I need to use a volume with the docker.sock


08/22/2023, 1:58 AM
hey @Mitch is your user running your worker in your docker group? i think itd be something like this to add it
Copy code
sudo usermod -aG docker prefect-worker-user
# log out / log in 
sudo systemctl restart docker


08/22/2023, 2:12 AM
I have to look into it a bit. I was able to get it running with systemctl but it still didn’t seem to pick up the proper credentials. I’ll have to ask my team for a little more info on how we configured it for prefect 1 agents
👍 1