sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

Error running version 2.8: "error: config value 'safe.directory' was not found"

Open pedrocarrico opened this issue 4 years ago • 4 comments

Environment

I'm running the 2.8 docker image version

Steps to Reproduce

  1. 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.

pedrocarrico avatar Oct 25 '22 10:10 pedrocarrico

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.

wmcg avatar Oct 25 '22 11:10 wmcg

may be linked to #1372 …

Christophe31 avatar Nov 02 '22 09:11 Christophe31

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

kamilogorek avatar Nov 02 '22 16:11 kamilogorek

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

lexxxel avatar Nov 03 '23 09:11 lexxxel