Hi all, I've just trying to to execute "prefect se...
# prefect-server
j
Hi all, I've just trying to to execute "prefect server start" using "backend" server, so I supposed that this issue could be permissions on pyenv:
Copy code
ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml
............
............
subprocess.CalledProcessError: Command '['docker-compose', 'down']' returned non-zero exit status 1.
Operating System: Ubuntu 18.04.5 LTS Kernel: Linux 5.4.0-42-generic Architecture: x86-64 Using pyenv with python 3.7.9 Thanks in advance!
j
Hi Jonathan, you've installed prefect using pyenv I take it? What version of prefect do you have installed? What command did you run that resolved the above error?
j
yes, wait me a second..
With pyenv I executed:
pyenv shell 3.7.9
Then install prefect:
pip install prefect
In the end, execute
prefect backend server
prefect server start
would you like a gist with the completed error?
j
If you could post it here, formatted appropriately between backticks that'd be quite helpful, yes. Thanks!
j
Yes, of course. I don't know if it is readable 😣
Copy code
$ prefect backend server
Backend switched to server

$ prefect server start
ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml
        
Exception caught; killing services (press ctrl-C to force)
ERROR: 
        Can't find a suitable configuration file in this directory or any
        parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml
        
Traceback (most recent call last):
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/cli/server.py", line 332, in start
    ["docker-compose", "pull"], cwd=compose_dir_path, env=env
  File "/home/jloscalzo/.pyenv/versions/3.7.9/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/jloscalzo/.pyenv/versions/3.7.9/bin/prefect", line 8, in <module>
    sys.exit(cli())
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/cli/server.py", line 366, in start
    ["docker-compose", "down"], cwd=compose_dir_path, env=env
  File "/home/jloscalzo/.pyenv/versions/3.7.9/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/home/jloscalzo/.pyenv/versions/3.7.9/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.
I've just executed in any folder, (not special folder). Installation docs doesn't say anything against that...
j
Can you run
prefect diagnostics
and report back the output?
j
Copy code
{
  "config_overrides": {},
  "env_vars": [],
  "system_information": {
    "platform": "Linux-5.4.0-42-generic-x86_64-with-debian-buster-sid",
    "prefect_version": "0.13.5",
    "python_version": "3.7.9"
  }
}
And prefect is installed by pyenv here:
Copy code
~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/
In this folders is located the compose-file, I mean CLI should execute it
j
Hmmm, ok, give me a bit to debug here.
j
if I try to execute it manually, I receive this error:
Copy code
$ docker-compose -f docker-compose.yml up
ERROR: .PermissionError: [Errno 13] Permission denied: './docker-compose.yml'
Should it up as a common cmpose-file, right?
j
Hmmm, that sounds like it might be your problem then. What are the permissions on that file?
Did you use
sudo
to install prefect (we recommend not doing that)?
j
nono, I didn't use sudo to install prefect neither pyenv
Copy code
-rw-r--r--  1 jloscalzo jloscalzo  3062 sep  7 17:35 docker-compose.yml-rw-r--r--  1 jloscalzo jloscalzo  3062 sep  7 17:35 docker-compose.yml
It is my user, and my user has docker-permissions (docker group)
j
That's very odd. Perhaps it's permission issues on the docker-compose/docker side? Have you used docker-compose before on this machine, and if so has it worked then?
j
yes, of course, I have running another stack in this moment 🙂
I didn't try to install prefect with systems-python, which it were installed with ubuntu (in other words, without pyenv)
Also, I've develop a simple script and execute it, it runs ok (python script.py) So, I'm out of possible issues 😞
j
So your docker-compose works fine for other projects? Or just docker? The prefect side looks right, and if you can't
docker-compose up
docker-compose.yml
file (which should run as is) that's very odd.
j
I think the same as you
j
You wouldn't happen to have used
snap
to install docker/docker-compose instead of
apt
?
j
I use to have issues with docker from snap, so I've uninstalled and reinstalled from docker directly
j
j
mmmm, it could be!
j
I'm not familiar with apparmor, haven't seen this issue before.
j
Copy code
docker              19.03.11                    471   latest/stable     canonical*    -docker              19.03.11                    471   latest/stable     canonical*    -
I didn't uninstalled from snap
I'm a lier
😣
j
Ah! well hopefully one of the two links I posted above can help you :)
It sounds like that's the issue then.
j
Thanks a lot, I supposed that I've just uninstalling it from snap. Sorry for not googling it 😞
j
No problem, let us know if you run into any other issues.
c
@Marvin archive “prefect server start raises PermissionError on Ubuntu”
j
@Jim Crist-Harif, is it mandatory to execute
prefect server start
to be located in
~/.pyenv/versions/3.7.9/lib/python3.7/site-packages/prefect/cli
? Or I should copy this compose-file to project-folder?
j
I'm not sure I follow the question, but • It shouldn't matter what directory you run
prefect server start
in, provided you have prefect/docker/docker-compose all installed correctly things should work regardless. • You shouldn't need to copy out the docker-compose file from inside your prefect install,
prefect server start
will use the docker-compose file it's packaged with automatically.
j
Thanks @Jim Crist-Harif, the issue was that I have docker installed by snap, so I've removed & reinstalling it, It works well now. Thanks again!