Error running version 2.8: "error: config value 'safe.directory' was not found"
Environment
I'm running the 2.8 docker image version
Steps to Reproduce
- I was running
docker run -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT --rm -v $(pwd):/work getsentry/sentry-cli releases set-commits --auto $REVISION
Expected Result
Set the revision on the sentry releases for my project
Actual Result
Errors with output: "error: config value 'safe.directory' was not found; class=Config (7); code=NotFound (-3)"
I've rolled back to the 2.7 version and it's working ok. Seems related to https://github.blog/2022-04-12-git-security-vulnerability-announced/ but I can't confirm.
We are also seeing this issue as part of a bitbucket pipeline. I did attempt to try setting safe directory with git config --global --add safe.directory '*' but quickly got bored of trying to make that work inside this image. Downgrade to 2.7 also fixed for me.
may be linked to #1372 …
Could you try to run your docker command with an additional -u "$(id -u):$(id -g)" parameter?
eg: docker run -u "$(id -u):$(id -g)" -e SENTRY_AUTH_TOKEN -e SENTRY_ORG -e SENTRY_PROJECT --rm -v $(pwd):/work getsentry/sentry-cli releases set-commits --auto $REVISION
We cannot change this behavior, as it's security issue, and it was changed directly in libgit, but we can probably update how to run the docker image itself.
ref: https://github.com/libgit2/libgit2/releases/tag/v1.5.0 ref: https://github.com/libgit2/libgit2/pull/6266 ref: https://github.com/convco/convco/issues/86
I had the same issue, but it was not docker related (I use the sentry-dart-plugin) inside my gitlab pipeline. There It can be fixed with:
before_script: # or any other script step
- git config --global --add safe.directory $PWD