Hello. I'm struggling to get prefect to run/insta...
# ask-community
m
Hello. I'm struggling to get prefect to run/install at all. I find that the documentation is severely lacking in terms of having a useful guide on walking you through an install from scratch if you've never used Prefect before. I have a new Ubuntu 18.04 Server installation, docker and docker-compose installed, python 3.7 setup and set as the default. Run "pip install prefect" it's installed, the documentation says to now run "prefect server backend" or really "prefect" anything and I get nothing. Where are the steps in between to getting this running? https://github.com/prefecthq/prefect
a
After running
prefect server backend
, what happens if you run
prefect server start
?
upvote 1
👍 1
Incidentally, it should be
prefect backend server
upvote 1
k
Hey @Michael Eggert, it really just should be
prefect server backend
and
prefect server start
like Amanda mentioned to spin up Server. Just also want to mention that Prefect Cloud has 10000 task runs for free per month if you don’t want to spin up Server (some users are not aware). There are also more docs here
m
After posting this, I was able to get a bit further after a rebuild of the host and starting over. Now I get this:
Copy code
admin@host:~$ prefect backend server
Backend switched to server
admin@host:~$ prefect server start
ERROR: The Compose file './docker-compose.yml' is invalid because:
networks.prefect-server value Additional properties are not allowed ('name' was unexpected)
services.apollo.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.graphql.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.hasura.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.postgres.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
Exception caught; killing services (press ctrl-C to force)
ERROR: The Compose file './docker-compose.yml' is invalid because:
networks.prefect-server value Additional properties are not allowed ('name' was unexpected)
services.apollo.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.graphql.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.hasura.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.postgres.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
Traceback (most recent call last):
  File "/home/admin/.local/lib/python3.7/site-packages/prefect/cli/server.py", line 609, in start
    ["docker-compose", "pull"], cwd=compose_dir_path, env=env
  File "/usr/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker-compose', 'pull']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/admin/.local/bin/prefect", line 8, in <module>
    sys.exit(cli())
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 829, in _call_
    return self.main(*args, **kwargs)
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/admin/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/admin/.local/lib/python3.7/site-packages/prefect/cli/server.py", line 650, in start
    ["docker-compose", "down"], cwd=compose_dir_path, env=env
  File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['docker-compose', 'down']' returned non-zero exit status 1.
z
@Michael Eggert That looks like a docker-compose version issue. What version are you using? We require a minimum of
1.18.0
m
Ok, so updated to the latest versions Docker 20.10.7 and Docker-Compose 1.29.2. Attempted to run that again, now getting permission error messages.
Copy code
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
PermissionError: [Errno 13] Permission denied
Thought I saw someone had this issue before in a google search, but not finding it at the moment
There is actually many, many more messages like this when trying to start the server
k
What happens when you do
docker run hello-world
?
m
sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world b8dfde127a29: Pulling fs layer docker: open /var/lib/docker/tmp/GetImageBlob265868105: no such file or directory.
k
That’s a weird issue. Looks like these guys solved it just by restarting docker. Also, to run docker as a non-root user, you can follow this .
Once docker works (
docker run hello-world
works without
sudo
), you should be good to run
prefect server start