New issue
Advanced search Search tips

Issue 708785 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Bug


Previous locations:
gerrit:5950


Sign in to add a comment

Suggest or maybe even run git cl creds-check if "committer email address does not match your user account"

Project Member Reported by h...@chromium.org, Apr 5 2017

Issue description

$ depot-tools-auth login https://codereview.chromium.org
(...)
Logged in to https://codereview.chromium.org as hans@chromium.org.

To login with a different email run:
  depot-tools-auth login https://codereview.chromium.org
To logout and purge the authentication token run:
  depot-tools-auth logout https://codereview.chromium.org


$ git cl upload
Using 50% similarity for rename/copy detection. Override with --similarity.
Running presubmit upload checks ...

Presubmit checks passed.
 src/effects/SkBlurMask.cpp | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)
remote: Processing changes: refs: 1, done            
remote: 
remote: ERROR:  In commit 636e3e810f010894d83a4ab50cfcd42a2ea783b3        
remote: ERROR:  committer email address hans@chromium.org        
remote: ERROR:  does not match your user account.        
remote: ERROR:        
remote: ERROR:  The following addresses are currently registered:        
remote: ERROR:    hwennborg@google.com        
remote: ERROR:    hwennborg@googlers.com        
remote: ERROR:        
remote: ERROR:  To register an email address, please visit:        
remote: ERROR:  https://skia-review.googlesource.com/#/settings/contact        
remote: 
remote: 
To https://skia.googlesource.com/skia.git
 ! [remote rejected]       636e3e810f010894d83a4ab50cfcd42a2ea783b3 -> refs/for/refs/heads/master%m=Initial_upload,notify=NONE (invalid committer)
error: failed to push some refs to 'https://skia.googlesource.com/skia.git'




How does committer email address not match my user account? I just signed in to hans@hanshq.net, but it seems to think I'm signed in with my google.com account?

I also tried "depot-tools-auth login https://skia-review.googlesource.com" but got the same error.
 

Comment 1 by h...@chromium.org, Apr 5 2017

> How does committer email address not match my user account? I just signed in to hans@hanshq.net, but it seems to think I'm signed in with my google.com account?

Gah, that should be "I just signed in to hans@chromium.org" obviously.

I committed with @chromium.org, authenticated with @chromium.org, but it still won't let me upload.

I also tried amending the commit author email to the @google.com address, but that din't help.
Cc: aga...@chromium.org
Components: PolyGerrit
Labels: -Priority-3
Project: chromium
Moved issue gerrit:5950 to now be  issue chromium:708785 .
Cc: -aga...@chromium.org tandrii@chromium.org
Components: Infra>Codereview>Gerrit
Labels: Milestone-Launch Proj-Gerrit-Migration
Owner: aga...@chromium.org
Status: Assigned (was: New)
You are authenticating with codereview.chromium.org (Rietveld) when Gerrit is at skia-review.googlesource.com.

Triaging to Aaron in case he already has a document on this, but the gist of is that you need to have your .gitcookies in order:

+ Head to https://skia.googlesource.com/
+ Click on “Generate password” at the top.
+ Authenticate with whichever account you wish to generate cookies for.
+ Ensure that you are authenticating for ONLY skia.googlesource.com.
+ Paste that into your console to update your .gitcookies file.
+ Ensure that your local git config has the correct email set.

Aaron, are there docs that point to this issue at all? If not then we should make one/update the FAQ.

Comment 5 by h...@chromium.org, Apr 5 2017

I also tried "depot-tools-auth login https://skia-review.googlesource.com"

But that didn't help. Is "depot-tools-auth login" unrelated? It fixed the problem last time I tried to upload a patch to Skia.

Comment 6 by h...@chromium.org, Apr 5 2017

Re 4, that worked.

Maybe the error message could be updated to hint that this is the solution?

Also, I swear "depot-tools-auth login" solved it for me last time. Any idea why that might be?
Glad it helped. I’m not sure why depot-tools-auth login would work since from what I know it shouldn’t affect Gerrit auth. I’ll let Aaron and/or Andrii chime in on that.
Cc: -tandrii@chromium.org aga...@chromium.org
Owner: tandrii@chromium.org
tandrii, since you just created "git cl check-auth", can you take this? I think there's already a bug on file against you to prompt users to run that command when gerrit returns a 401 of some kind.

for posterity: Yeah, "depot-tools-auth login" is for generating oauth2 tokens to talk to appengine apps. It is useful for Rietveld, but has no effect on Gerrit.

Status: Started (was: Assigned)
Summary: Suggest or maybe even run git cl creds-check if "committer email address does not match your user account" (was: "committer email address does not match your user account")
it's called "git cl creds-check" because I wanted to avoid same prefix with git cl checkout :( There is no bug on file, but indeed there was a suggestion in the ML which I'm about to read since I've just got out of vacation :)

Thus, I'll do this in this bug.
Since the tool is called "depot-tools-auth login" could that take care of doing the right thing?
At very least, point developers to the right instructions.
Developers shouldn't have to worry wether we use gerrit or rietveld, and what are the corresponding auth mechanism.

(Slightly related, as we discussed offline, the gerrit web UI has still some problems with multilogin. Every time I need to sign in into it I have to do a dance of login->logout->login before I get logged in with the right account.)

primiano: please file a bug in /p/gerrit for that account switching dance you have to do. I have never experienced that, but it is definitely a bad bug.

It is not possible to make depot-tools-auth login do the right thing. gerrit/gitiles does not provide an API to get auth tokens from the command line -- you would need to already have said tokens in order to do so.
Project Member

Comment 12 by bugdroid1@chromium.org, Apr 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/9d93221fb9ecd31e5ef9373ffe964c69c05613e2

commit 9d93221fb9ecd31e5ef9373ffe964c69c05613e2
Author: Andrii Shyshkalov <tandrii@chromium.org>
Date: Mon Apr 10 12:59:11 2017

git cl: suggest running git cl creds-check after git push failures.

R=sergiyb@chromium.org
BUG= 708785 

Change-Id: Ib29be04cda18b0b1187893e555a4c5a7ea753e6e
Reviewed-on: https://chromium-review.googlesource.com/472866
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/9d93221fb9ecd31e5ef9373ffe964c69c05613e2/git_cl.py

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/4956f798fb978be62762a3a205694df14a52d1e1

commit 4956f798fb978be62762a3a205694df14a52d1e1
Author: Andrii Shyshkalov <tandrii@chromium.org>
Date: Mon Apr 10 13:03:13 2017

git cl: suggest git cl creds-check if Gerrit API returns 401.

R=sergiyb@chromium.org
BUG= 708785 

Change-Id: Id25d3ef9a1449a0c259ed48b782e1b766e1a5fc9
Reviewed-on: https://chromium-review.googlesource.com/472906
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/4956f798fb978be62762a3a205694df14a52d1e1/gerrit_util.py

Status: Fixed (was: Started)

Sign in to add a comment