Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubious ownership error in GitLab CI #524

Open
gergelypolonkai opened this issue Nov 8, 2023 · 1 comment
Open

dubious ownership error in GitLab CI #524

gergelypolonkai opened this issue Nov 8, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@gergelypolonkai
Copy link

Describe the bug

While running darker in our GitLab CI, it fails with the following message:

ERROR:darker.git:fatal: detected dubious ownership in repository at '/builds/group/repo'
ERROR:darker.git:To add an exception for this directory, call:
ERROR:darker.git:
ERROR:darker.git:	git config --global --add safe.directory /builds/group/repo

Environment (please complete the following information):

  • OS: Kubernetes, running inside the official Python container
  • Python version 3.10.13
  • Git version 2.39.2
  • Darker version 1.7.2
  • Black version 22.8.0

Additional context

What makes this strange is that git itself works without a problem after marking the directory as safe. Here’s the output of some debug commands i put into our darker job:

$ git --version
git version 2.39.2
$ cat $HOME/.gitconfig || echo "No config"
cat: /project/.gitconfig: No such file or directory
No config
$ git status || echo "bah"
fatal: detected dubious ownership in repository at '/builds/group/repo'
To add an exception for this directory, call:
	git config --global --add safe.directory /builds/group/repo
bah
$ git config --global --add safe.directory /builds/group/repo
$ cat $HOME/.gitconfig || echo "No config"
[safe]
	directory = /builds/group/repo
$ git status || echo "bah"
HEAD detached at af72d68b1
nothing to commit, working tree clean
$ poetry run darker --diff --revision origin/master... app data_tests tests
ERROR:darker.git:fatal: detected dubious ownership in repository at '/builds/group/repo'
ERROR:darker.git:To add an exception for this directory, call:
ERROR:darker.git:
ERROR:darker.git:	git config --global --add safe.directory /builds/group/repo

The directory itself (/builds/group/repo) is owned by root and has permissions 0777. The whole CI process is running as user app (UID 1000).

@gergelypolonkai gergelypolonkai changed the title dubious ownership error in our CI dubious ownership error in GitLab CI Nov 8, 2023
@akaihola
Copy link
Owner

Hi @gergelypolonkai,

Could you add -vv to Darker arguments to get more debug output?

@akaihola akaihola self-assigned this Feb 23, 2024
@akaihola akaihola added the question Further information is requested label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

2 participants