https://prefect.io logo
Title
t

Tom Klein

11/19/2021, 2:16 PM
Hello, i'm trying to test out prefect locally on a linux machine and running into something (that it seems a bunch of others have run into) but not sure how to solve it
this is what i'm seeing:
[51180] Failed to execute script docker-compose
Exception caught; killing services (press ctrl-C to force)
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1277, in request
  File "http/client.py", line 1323, in _send_request
  File "http/client.py", line 1272, in endheaders
  File "http/client.py", line 1032, in _send_output
  File "http/client.py", line 972, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 410, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1277, in request
  File "http/client.py", line 1323, in _send_request
  File "http/client.py", line 1272, in endheaders
  File "http/client.py", line 1032, in _send_output
  File "http/client.py", line 972, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 214, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 237, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 81, in main
  File "compose/cli/main.py", line 200, in perform_command
  File "compose/cli/command.py", line 70, in project_from_options
  File "compose/cli/command.py", line 153, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 197, in __init__
  File "docker/api/client.py", line 222, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[51184] Failed to execute script docker-compose
Traceback (most recent call last):
  File "/home/klayhamn/.local/lib/python3.9/site-packages/prefect/cli/server.py", line 623, in start
    subprocess.check_call(
  File "/usr/lib64/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker-compose', 'pull']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/klayhamn/.local/bin/prefect", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/klayhamn/.local/lib/python3.9/site-packages/prefect/cli/server.py", line 664, in start
    subprocess.check_output(
  File "/usr/lib64/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib64/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['docker-compose', 'down']' returned non-zero exit status 255.
the commands i used were as per the instructions, i.e.:
pip install prefect
followed by :
prefect server start
a

Anna Geller

11/19/2021, 2:22 PM
@Tom Klein Prefect Cloud is the default, so before starting Server, you need to switch the backend:
prefect backend server
prefect server start
t

Tom Klein

11/19/2021, 2:23 PM
i tried that too, doesn't help, same error
r

Rainer Volz

11/19/2021, 2:25 PM
errors like this appear when the connection to the docker daemon is not ok. So you could check if your user is in the docker group and if the daemon started properly …
:upvote: 1
a

Anna Geller

11/19/2021, 2:26 PM
Could you try reinstalling Docker Desktop and docker-compose? somehow you’re getting docker client errors, so those are no Prefect-specific errors, but rather from the Docker client:
"docker/api/client.py"
Could you check if your Docker is running? πŸ™ƒ I know it sounds stupid, but you can start it on a Linux machine using:
sudo systemctl start docker
βœ… 1
t

Tom Klein

11/19/2021, 2:30 PM
@Anna Geller ya it's running, still same error
a

Anna Geller

11/19/2021, 2:31 PM
btw, did you know that Prefect Cloud is much easier to get started and is free to use for the first 20000 tasks each month? I would definitely recommend starting with Cloud rather than Server - you can still have a local agent and running things locally
t

Tom Klein

11/19/2021, 2:32 PM
@Rainer Volz i'll try to check, thanks
πŸ‘ 1
@Anna Geller i tried that too, see my other issue downstream in the channel πŸ™‚
k

Kevin Kho

11/19/2021, 2:33 PM
You can try doing
docker run hello-world
to verify docker is working right
t

Tom Klein

11/19/2021, 2:40 PM
@Kevin Kho thanks, seems like it only works when i
sudo
it, and otherwise i get a permission error... should i run prefect with sudo?
r

Rainer Volz

11/19/2021, 2:41 PM
No, add your user to the docker group. This works for Ubuntu
usermod -aG docker user_name
πŸ‘ 1
:upvote: 1