EE 'push rules' feature causes error from CommitService::CommitDelta
~Conversation #566 (closed)
Reported via slack by @rdavila
Steps to reproduce
- log in as GitLab root
- enable "Check whether author is a GitLab user"
- create a new repository
- create a GitLab user with an email address matching your local Git user (don't need to confirm this new account, you can keep using the gitlab 'root' user) <- without this step you can't reproduce because your push is rejected
- push to the new repository with HTTP (or SSH)
- local git client push fails with
remote: GitLab: API is not accessible
Workaround is to run Feature.disable(:gitaly_commit_deltas)
in GDK rails console.
GRPC::Unavailable (14:CommitDelta: exit status 128):
<snip>
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/gitaly_client/commit_service.rb:51:in `each'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/gitaly_client/commit_service.rb:51:in `flat_map'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/gitaly_client/commit_service.rb:51:in `commit_deltas'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git/commit.rb:316:in `block in deltas'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/gitaly_client.rb:115:in `block in migrate'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/metrics/influx_db.rb:92:in `measure'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/gitaly_client.rb:114:in `migrate'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git/commit.rb:314:in `deltas'
/Users/ruben/projects/gdk-ee-2/gitlab/app/models/commit.rb:359:in `raw_deltas'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/checks/change_access.rb:229:in `check_commit_diff'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/checks/change_access.rb:171:in `block in push_rule_check'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/checks/change_access.rb:165:in `each'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/checks/change_access.rb:165:in `push_rule_check'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/checks/change_access.rb:43:in `exec'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git_access.rb:244:in `check_single_change_access'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git_access.rb:225:in `block in check_change_access!'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/changes_list.rb:12:in `each'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/changes_list.rb:12:in `each'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git_access.rb:222:in `check_change_access!'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git_access.rb:201:in `check_push_access!'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/gitlab/git_access.rb:55:in `check'
/Users/ruben/projects/gdk-ee-2/gitlab/lib/api/internal.rb:40:in `block (2 levels) in <class:Internal>'
Gitaly logs:
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg=spawn args=[/usr/local/bin/git receive-pack /Users/ruben/projects/gdk-e$
-2/repositories/root/test.git] grpc.method=SSHReceivePack grpc.service=gitaly.SSHService path="/usr/local/bin/git" peer.address= pid=72733 span.kind=serve$
system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg=spawn args=[/usr/local/bin/git --git-dir /Users/ruben/projects/gdk-ee-2$
repositories/root/test.git for-each-ref --format=%(refname) refs/heads] grpc.method=FindAllBranchNames grpc.request.repoPath="root/test.git" grpc.request.$
epoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.RefService path="/usr/local/bin/git" peer.address= pid=72738 span.kind=server syste$
=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="spawn complete" args=[/usr/local/bin/git --git-dir /Users/ruben/projec$
s/gdk-ee-2/repositories/root/test.git for-each-ref --format=%(refname) refs/heads] command.exitCode=0 command.inblock=0 command.maxrss=1118208 command.oub$
ock=0 command.real_time_ms=7.00782 command.system_time_ms=1.158 command.user_time_ms=1.113 grpc.method=FindAllBranchNames grpc.request.repoPath="root/test$
git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.RefService path="/usr/local/bin/git" peer.address= span.kind=ser$
er system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="finished streaming call" grpc.code=OK grpc.method=FindAllBranchNames g$
pc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.RefService grpc.time_ms=9 peer.ad$
ress= span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg=spawn args=[/usr/local/bin/git --git-dir /Users/ruben/projects/gdk-ee-2$
repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 211f32e8d5c4b3ab1b9ea55918c$
caa9b89b83a1 --] grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.servic$
=gitaly.CommitService path="/usr/local/bin/git" peer.address= pid=72740 span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.$
epoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=11 peer.address= s$
an.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="spawn complete" args=[/usr/local/bin/git --git-dir /Users/ruben/projec$
s/gdk-ee-2/repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 211f32e8d5c4b3ab$
b9ea55918cacaa9b89b83a1 --] command.exitCode=0 command.inblock=0 command.maxrss=1499136 command.oublock=0 command.real_time_ms=14.003387 command.system_ti$e_ms=2.554 command.user_time_ms=1.756 grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelG$oup=root grpc.service=gitaly.CommitService path="/usr/local/bin/git" peer.address= span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg=spawn args=[/usr/local/bin/git --git-dir /Users/ruben/projects/gdk-ee-2/
repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 4746675fde6ea8d0803555e1f6cf
aa16756536b8 --] grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service
=gitaly.CommitService path="/usr/local/bin/git" peer.address= pid=72741 span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.r
epoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=7 peer.address= spa
n.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="spawn complete" args=[/usr/local/bin/git --git-dir /Users/ruben/project
s/gdk-ee-2/repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 4746675fde6ea8d08
03555e1f6cfaa16756536b8 --] command.exitCode=0 command.inblock=0 command.maxrss=1511424 command.oublock=0 command.real_time_ms=7.323817 command.system_time
_ms=1.245 command.user_time_ms=1.2899999999999998 grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.reques
t.topLevelGroup=root grpc.service=gitaly.CommitService path="/usr/local/bin/git" peer.address= span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg=spawn args=[/usr/local/bin/git --git-dir /Users/ruben/projects/gdk-ee-2/
repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 3381bdb31e5c7dc30d7948357d88
3e20d4387369 --] grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service
=gitaly.CommitService path="/usr/local/bin/git" peer.address= pid=72742 span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="finished unary call" grpc.code=OK grpc.method=FindCommit grpc.request.r
epoPath="root/test.git" grpc.request.repoStorage=default grpc.request.topLevelGroup=root grpc.service=gitaly.CommitService grpc.time_ms=11 peer.address= sp
an.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="spawn complete" args=[/usr/local/bin/git --git-dir /Users/ruben/project
s/gdk-ee-2/repositories/root/test.git log -z --pretty=format:%H%x1f%s%x1f%B%x1f%an%x1f%ae%x1f%aI%x1f%cn%x1f%ce%x1f%cI%x1f%P --max-count=1 3381bdb31e5c7dc30
d7948357d883e20d4387369 --] command.exitCode=0 command.inblock=0 command.maxrss=1511424 command.oublock=0 command.real_time_ms=12.884551 command.system_tim
e_ms=3.423 command.user_time_ms=2.3080000000000003 grpc.method=FindCommit grpc.request.repoPath="root/test.git" grpc.request.repoStorage=default grpc.reque
st.topLevelGroup=root grpc.service=gitaly.CommitService path="/usr/local/bin/git" peer.address= span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="spawn complete" args=[/usr/local/bin/git receive-pack /Users/ruben/proj
ects/gdk-ee-2/repositories/root/test.git] command.exitCode=0 command.inblock=14 command.maxrss=15175680 command.oublock=14 command.real_time_ms=814.801967
command.system_time_ms=92.002 command.user_time_ms=205.987 grpc.method=SSHReceivePack grpc.service=gitaly.SSHService path="/usr/local/bin/git" peer.address
= span.kind=server system=grpc
11:23:53 gitaly.1 | time="2017-09-14T11:23:53-05:00" level=info msg="finished streaming call" grpc.code=OK grpc.method=SSHReceivePack grpc.s
ervice=gitaly.SSHService grpc.time_ms=815 peer.address= span.kind=server system=grpc
Edited by Jacob Vosmaer