New issue
Advanced search Search tips
Starred by 1 user
Status: Fixed
Owner:
Closed: Nov 20
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment
CQ master failed to push a change with 'git log' errors
Project Member Reported by nxia@chromium.org, Nov 17 Back to list
04:03:07: INFO: Translating result <class 'chromite.lib.cros_build_lib.RunCommandError'>: return code: 128; command: git log -F --all-match --grep 'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac' '--format=%H' master..HEAD
fatal: ambiguous argument 'master..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
cmd=['git', 'log', '-F', '--all-match', '--grep', u'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac', '--format=%H', u'master..HEAD'], cwd=/b/c/cbuild/repository/src/third_party/autotest/files
Traceback (most recent call last):
  File "/b/c/cbuild/repository/chromite/lib/parallel.py", line 603, in TaskRunner
    task(*x, **task_kwargs)
  File "/b/c/cbuild/repository/chromite/lib/parallel.py", line 801, in <lambda>
    fn = lambda idx, task_args: out_queue.put((idx, task(*task_args)))
  File "/b/c/cbuild/repository/chromite/cbuildbot/validation_pool.py", line 1320, in PushRepoBranch
    for change in changes)
  File "/b/c/cbuild/repository/chromite/cbuildbot/validation_pool.py", line 1320, in <genexpr>
    for change in changes)
  File "/b/c/cbuild/repository/chromite/lib/patch.py", line 1352, in GetLocalSHA1
    output = git.RunGit(git_repo, cmd).output.split()
  File "/b/c/cbuild/repository/chromite/lib/git.py", line 821, in RunGit
    ['git'] + cmd, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 244, in GenericRetry
    return _run()
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 177, in _Wrapper
    ret = func(*args, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 243, in _run
    return functor(*args, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/cros_build_lib.py", line 654, in RunCommand
    raise RunCommandError(msg, cmd_result)
RunCommandError: return code: 128; command: git log -F --all-match --grep 'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac' '--format=%H' master..HEAD
fatal: ambiguous argument 'master..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
cmd=['git', 'log', '-F', '--all-match', '--grep', u'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac', '--format=%H', u'master..HEAD'], cwd=/b/c/cbuild/repository/src/third_party/autotest/files
 to fail.
 
Cc: hiroh@chromium.org benchan@chromium.org nsanders@chromium.org
Labels: -Pri-1 Pri-0
Cc: akes...@chromium.org
Owner: shuqianz@chromium.org
The first error from gerrit:


02:02:03: WARNING: git push failed for /b/c/cbuild/repository/src/third_party/autotest/files:master; was a change chumped in the middle of the CQ run?
Traceback (most recent call last):
  File "/b/c/cbuild/repository/chromite/cbuildbot/validation_pool.py", line 1307, in PushRepoBranch
    git.GitPush(repo, 'HEAD', push_to, skip=self.dryrun)
  File "/b/c/cbuild/repository/chromite/lib/git.py", line 1255, in GitPush
    RunGit(git_repo, cmd, retry=retry, capture_output=capture_output, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/git.py", line 821, in RunGit
    ['git'] + cmd, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 244, in GenericRetry
    return _run()
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 177, in _Wrapper
    ret = func(*args, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/retry_util.py", line 243, in _run
    return functor(*args, **kwargs)
  File "/b/c/cbuild/repository/chromite/lib/cros_build_lib.py", line 654, in RunCommand
    raise RunCommandError(msg, cmd_result)
RunCommandError: return code: 1; command: git push https://chromium-review.googlesource.com/chromiumos/third_party/autotest HEAD:master
remote: The push has been rejected because we detect that it contains a private        
remote: key. Please check the following commands and confirm that it's        
remote: intentional:        
remote: 
remote:     git show 4bf41c2beb2c964688716b707ed6af9eaca98e47        
remote: 
remote: You can use `git rev-list --objects --all` to find the files.        
remote: 
remote: To push these files, please run `git push -o nokeycheck`.        
remote: 
To https://chromium-review.googlesource.com/chromiumos/third_party/autotest
 ! [remote rejected]     HEAD -> master (found a private key)
error: failed to push some refs to 'https://chromium-review.googlesource.com/chromiumos/third_party/autotest'
cmd=['git', 'push', u'https://chromium-review.googlesource.com/chromiumos/third_party/autotest', u'HEAD:master'], cwd=/b/c/cbuild/repository/src/third_party/autotest/files


then cbuildbot complained RunCommandError: return code: 128; command: git log -F --all-match --grep 'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac' '--format=%H' master..HEAD
fatal: ambiguous argument 'master..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
cmd=['git', 'log', '-F', '--all-match', '--grep', u'Change-Id: I278d06d70557679dbc1c264cb2fa611441e42dac', '--format=%H', u'master..HEAD'], cwd=/b/c/cbuild/repository/src/third_party/autotest/files
 to fail.


We need to file a bug to gerrit team regarding the first error, I'm going to fix the second error.
Owner: nxia@chromium.org
Assign to nxia@ to fix the git push error, gerrit team has disabled the private key check for us
I think we don't change our current behavior of git push, but we fix the 'git log' failure which was threw after the 'git push' failure.

https://chromium-review.googlesource.com/c/chromiumos/chromite/+/777384
Labels: -Pri-0 Pri-1
https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/775883 has been submitted manually, lower this bug to p1 now
Project Member Comment 10 by bugdroid1@chromium.org, Nov 18
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/4ad7d8002bbafd2ea80819e01a7899e0d6ad5d97

commit 4ad7d8002bbafd2ea80819e01a7899e0d6ad5d97
Author: Ningning Xia <nxia@chromium.org>
Date: Sat Nov 18 04:18:53 2017

validation_pool: check git log diff between local HEAD and remote_ref

When the local repository doesn't contain the branch ('master') to push
to, running git log diff on revisions will error.

BUG= chromium:786395 
TEST=None

Change-Id: I22f61ec9a9c1d46eff88d8bf54a5e257077dcbbf
Reviewed-on: https://chromium-review.googlesource.com/777384
Commit-Ready: Ningning Xia <nxia@chromium.org>
Tested-by: Ningning Xia <nxia@chromium.org>
Reviewed-by: Shuqian Zhao <shuqianz@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/4ad7d8002bbafd2ea80819e01a7899e0d6ad5d97/cbuildbot/validation_pool.py

Is this fixed?
Status: Fixed
Sign in to add a comment