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

fatal: unsafe repository ('/opt/proxysql_mysqlbinlog' is owned by someone else) #19

Closed
akuzminsky opened this issue Jun 16, 2022 · 2 comments

Comments

@akuzminsky
Copy link

Build is failing on the latest available commit d8e0140.

$ make build-ubuntu18
building build-ubuntu18
WARNING: The PKG_NAME variable is not set. Defaulting to a blank string.
Creating ubuntu18_mysqlbinlog_1 ... done
Attaching to ubuntu18_mysqlbinlog_1
mysqlbinlog_1  | ==> Build environment:
mysqlbinlog_1  | HOSTNAME=4020325e4942
mysqlbinlog_1  | GIT_VERS=2.0-3-gd8e0140
mysqlbinlog_1  | CC=gcc
mysqlbinlog_1  | PKG_NAME=
mysqlbinlog_1  | PWD=/
mysqlbinlog_1  | HOME=/root
mysqlbinlog_1  | PKG_VERS=2.0
mysqlbinlog_1  | CXX=g++
mysqlbinlog_1  | SHLVL=1
mysqlbinlog_1  | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
mysqlbinlog_1  | IMG_NAME=ubuntu18
mysqlbinlog_1  | _=/usr/bin/env
mysqlbinlog_1  | ==> 'amd64' architecture detected for package
mysqlbinlog_1  | ==> 'ubuntu18' distro detected for package
mysqlbinlog_1  | ==> C compiler: gcc -> /usr/bin/x86_64-linux-gnu-gcc-7
mysqlbinlog_1  | gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
mysqlbinlog_1  | Copyright (C) 2017 Free Software Foundation, Inc.
mysqlbinlog_1  | This is free software; see the source for copying conditions.  There is NO
mysqlbinlog_1  | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mysqlbinlog_1  | ==> C++ compiler: g++ -> /usr/bin/x86_64-linux-gnu-g++-7
mysqlbinlog_1  | g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
mysqlbinlog_1  | Copyright (C) 2017 Free Software Foundation, Inc.
mysqlbinlog_1  | This is free software; see the source for copying conditions.  There is NO
mysqlbinlog_1  | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mysqlbinlog_1  | ==> Dependecies
mysqlbinlog_1  | fatal: unsafe repository ('/opt/proxysql_mysqlbinlog' is owned by someone else)
mysqlbinlog_1  | To add an exception for this directory, call:
mysqlbinlog_1  |
mysqlbinlog_1  | 	git config --global --add safe.directory /opt/proxysql_mysqlbinlog
mysqlbinlog_1  | ==> Epoch:
mysqlbinlog_1  | ==> Cleaning
mysqlbinlog_1  | fatal: unsafe repository ('/opt/proxysql_mysqlbinlog' is owned by someone else)
mysqlbinlog_1  | To add an exception for this directory, call:
mysqlbinlog_1  |
mysqlbinlog_1  | 	git config --global --add safe.directory /opt/proxysql_mysqlbinlog
mysqlbinlog_1  | Makefile:7: *** recipe commences before first target.  Stop.
ubuntu18_mysqlbinlog_1 exited with code 2
Going to remove ubuntu18_mysqlbinlog_1
Removing ubuntu18_mysqlbinlog_1 ... done
$ ll binaries/
total 8
drwxr-xr-x 2 akuzminsky users   24 Jun 16 16:03 ./
drwxr-xr-x 7 akuzminsky users 4096 Jun 16 16:03 ../
-rw-r--r-- 1 akuzminsky users   71 Jun 16 16:03 .gitignore
$
@mirostauder
Copy link
Collaborator

Thanks for the report,
Yes, this is caused by a recent git security update as described here:
https://github.blog/2022-04-12-git-security-vulnerability-announced/
https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory

This can be mitigated in two ways:

  1. the docker image is using root user, to make git happy
    run chown -R root:root . in the checked out proxysql_mysqlbinlog folder
  2. add the config option safe.directory = * to .git/config,
    run git config --global --add safe.directory * in the checked out proxysql_mysqlbinlog folder

I will update the docker image entrypoint to set the safe.directory accordingly.

@mirostauder
Copy link
Collaborator

fixed with commit 0274fbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants