Hey team - what are the requirements prior to star...
# ask-community
m
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/worker.py", line 485, in _get_client
    raise RuntimeError("Could not connect to Docker.") from exc
j
hey, this means that
docker
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()
m
I think this is the root error:
Copy code
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 244, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/usr/local/lib/python3.10/site-packages/docker/transport/unixconn.py", line 27, in connect
    sock.connect(self.unix_socket)
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
n
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
m
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