konveyor / kai

Konveyor AI - static code analysis driven migration to new targets via Generative AI
Apache License 2.0
25 stars 32 forks source link

podman compose up results in a permission denied error writing logs on Fedora #266

Closed jmontleon closed 3 months ago

jmontleon commented 3 months ago

When running podman compose up on Fedora the output is flooded with errors PermissionError: [Errno 13] Permission denied: '/podman_compose/logs/kai_psql.log'.

I opened a podman issue to try to get some insight into why we see a difference with podman(-compose) on Mac and Fedora. https://github.com/containers/podman/issues/23439

I have also tried on a couple clean Fedora 40 VM installs with podman and podman-remote/machine and the issue reproduced, so I don't believe it is a system misconfiguration.

There are a few ways to proceed:

  1. More manual steps:

    mkdir logs
    podman unshare chown 1001:1001 logs
    podman compose up
  2. Automated, but will cause problems with git: Update mounts to :rw,Z,U

But this will break the git repo if you try to fetch updates or do anything else:

$ git fetch upstream
fatal: detected dubious ownership in repository at '/home/jason/Documents/go/src/github.com/konveyor/kai'
To add an exception for this directory, call:

    git config --global --add safe.directory /home/jason/Documents/go/src/github.com/konveyor/kai
  1. Improving on 2:
    • Populate a logs directory in the repo
    • Add it to .gitignore
    • Add an additional volume mount - ${PWD}/logs:/podman_compose/logs:rw,z,U

I think unless we get some insight 3 is probably the most seamless approach.

jwmatthews commented 3 months ago

I'm good with trying out option #3