got a non-docker task to work with docker agent, b...
# prefect-community
s
got a non-docker task to work with docker agent, but now a docker task gives
Copy code
Unexpected error: DockerException("Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))")
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/docker/transport/unixconn.py", line 43, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory
i’m using GCS storage with LocalEnvironment
Copy code
with Flow("flow", storage=GCS('bucket')) as flow:
    flow.environment = LocalEnvironment(labels=["docker"])
i specified
--volume /var/run/docker.sock:/var/run/docker.sock
to
prefect agent start docker
and now it gives
Copy code
Unexpected error: ImageNotFound(HTTPError('404 Client Error: Not Found for url: <http+docker://localhost/v1.40/containers/create'>))
sorry that was all just me being silly in not getting google container registry auth right
all good!
n
Hey @sark how did you fix this error? I get the same one when trying to run a flow, while running the agent via a docker image.
s
i was told to perform GCR authentication as a task within the flow itself
n
And that. fixed it for you? Actually I tested that even when running the agent outside the docker image, I get the same error
s
sorry i haven’t tried that, we are in the process of hiring some consultants to help set up a kubernetes deployment of prefect where we hope to rely on the container-attached credentials
currently for testing/proof-of-concept purposes we have been manually pulling the image to the host VM running prefect, which helps the flow by skipping the image pull and allows the rest of the flow to work
👍 1