Git Review Giving Unauthorized Error

565 views
Skip to first unread message

Russell Haley

unread,
Jun 5, 2018, 2:09:10 AM6/5/18
to Repo and Gerrit Discussion
Hi, 

I'm trying to test Gerrit and I've been stuck chasing my tail for a while now. I've created a git repository under a test Gerrit instance on a Ubuntu VM, cloned it onto my Windows desktop and made changes. I've set up my ssh keys using the integrated git tool in GitGUI and pasted it into the 

When I try to push anything up to the server, I get failures in both Windows powershell and in "Git Bash" (mingw64). The following is the output when using git bash. As you can see, using the test port with ssh works fine?

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/rhaley/.ssh/id_rsa:
Identity added: /c/Users/rhaley/.ssh/id_rsa (/c/Users/rhaley/.ssh/id_rsa)

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ git review
remote: Unauthorized
fatal: Authentication failed for 'http://192.168.16.163:8080/telarray2-lua/'

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh -p 29418 rha...@192.168.16.163

  ****    Welcome to Gerrit Code Review    ****

  Hi Russell The Great, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://rhaley@ubuntu1:29418/REPOSITORY_NAME.git

Connection to 192.168.16.163 closed.


My conclusion at this point is that my user isn't connected to the repository correctly but your groups and user management has me scratching my head.  I've created a new group based on the All-Projects group and added my user, but it doesn't seem to affect anything. Do I need to create a new group with commit rights? Do I need to be editing a config file somewhere or am I just not understanding the user documentation?

Any advice would be grand. 

Thanks
Russ

Matthias Sohn

unread,
Jun 5, 2018, 2:58:58 AM6/5/18
to russ....@gmail.com, Repo and Gerrit Discussion
On Tue, Jun 5, 2018 at 8:09 AM Russell Haley <russ....@gmail.com> wrote:
Hi, 

I'm trying to test Gerrit and I've been stuck chasing my tail for a while now. I've created a git repository under a test Gerrit instance on a Ubuntu VM, cloned it onto my Windows desktop and made changes. I've set up my ssh keys using the integrated git tool in GitGUI and pasted it into the 

I guess you uploaded the public key to http://192.168.16.163:8080/telarray2-lua/#/settings/ssh-keys ?
 
When I try to push anything up to the server, I get failures in both Windows powershell and in "Git Bash" (mingw64). The following is the output when using git bash. As you can see, using the test port with ssh works fine?

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/rhaley/.ssh/id_rsa:
Identity added: /c/Users/rhaley/.ssh/id_rsa (/c/Users/rhaley/.ssh/id_rsa)

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ git review

how is git review defined ?

Try git push origin HEAD:refs/for/master
 
remote: Unauthorized
fatal: Authentication failed for 'http://192.168.16.163:8080/telarray2-lua/'

Did you provide credentials ?
Did you try pushing via ssh protocol ?
For authentication via http protocol see [1]
 
rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh -p 29418 rha...@192.168.16.163

  ****    Welcome to Gerrit Code Review    ****

  Hi Russell The Great, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://rhaley@ubuntu1:29418/REPOSITORY_NAME.git

Connection to 192.168.16.163 closed.


My conclusion at this point is that my user isn't connected to the repository correctly but your groups and user management has me scratching my head.  I've created a new group based on the All-Projects group and added my user, but it doesn't seem to affect anything. Do I need to create a new group with commit rights? Do I need to be editing a config file somewhere or am I just not understanding the user documentation?

Any advice would be grand. 

Thanks
Russ

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 

Luca Milanesio

unread,
Jun 5, 2018, 3:01:20 AM6/5/18
to Russell Haley, Luca Milanesio, Repo and Gerrit Discussion

On 4 Jun 2018, at 19:11, Russell Haley <russ....@gmail.com> wrote:

Hi, 

I'm trying to test Gerrit and I've been stuck chasing my tail for a while now. I've created a git repository under a test Gerrit instance on a Ubuntu VM, cloned it onto my Windows desktop and made changes. I've set up my ssh keys using the integrated git tool in GitGUI and pasted it into the 

When I try to push anything up to the server, I get failures in both Windows powershell and in "Git Bash" (mingw64). The following is the output when using git bash. As you can see, using the test port with ssh works fine?

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/rhaley/.ssh/id_rsa:
Identity added: /c/Users/rhaley/.ssh/id_rsa (/c/Users/rhaley/.ssh/id_rsa)

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ git review
remote: Unauthorized
fatal: Authentication failed for 'http://192.168.16.163:8080/telarray2-lua/'

You are adding your SSH key but then use an Git/HTTP URL. 

Just change the repository URL to:


rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh -p 29418 rha...@192.168.16.163

  ****    Welcome to Gerrit Code Review    ****

  Hi Russell The Great, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:


Connection to 192.168.16.163 closed.

Do you have any errors in the Gerrit error_log?



My conclusion at this point is that my user isn't connected to the repository correctly but your groups and user management has me scratching my head.  I've created a new group based on the All-Projects group and added my user, but it doesn't seem to affect anything. Do I need to create a new group with commit rights? Do I need to be editing a config file somewhere or am I just not understanding the user documentation?

Have you tried, first of all, to use a pre-built / pre-configured Gerrit Docker image from DockerHub?
So that you can have a configuration that is known to work.

Example:
docker run -p 29418:29418 -p 8080:8080 -e HOSTNAME=localhost gerritcodereview/gerrit

And then use the following credentials over HTTP:
admin/secret

HTH

Luca.


Any advice would be grand. 

Thanks
Russ

Russell Haley

unread,
Jun 5, 2018, 1:23:34 PM6/5/18
to Repo and Gerrit Discussion


On Tuesday, June 5, 2018 at 12:01:20 AM UTC-7, lucamilanesio wrote:


On 4 Jun 2018, at 19:11, Russell Haley <russ....@gmail.com> wrote:

Hi, 

I'm trying to test Gerrit and I've been stuck chasing my tail for a while now. I've created a git repository under a test Gerrit instance on a Ubuntu VM, cloned it onto my Windows desktop and made changes. I've set up my ssh keys using the integrated git tool in GitGUI and pasted it into the 

When I try to push anything up to the server, I get failures in both Windows powershell and in "Git Bash" (mingw64). The following is the output when using git bash. As you can see, using the test port with ssh works fine?

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/rhaley/.ssh/id_rsa:
Identity added: /c/Users/rhaley/.ssh/id_rsa (/c/Users/rhaley/.ssh/id_rsa)

rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ git review
remote: Unauthorized
fatal: Authentication failed for 'http://192.168.16.163:8080/telarray2-lua/'

You are adding your SSH key but then use an Git/HTTP URL. 

Just change the repository URL to:

OMG that is... so... embarrassing. Thank you.  


rhaley@Engineering90 MINGW64 ~/gerrit/telarray2-lua (master)
$ ssh -p 29418 rha...@192.168.16.163

  ****    Welcome to Gerrit Code Review    ****

  Hi Russell The Great, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:


Connection to 192.168.16.163 closed.

Do you have any errors in the Gerrit error_log? 



My conclusion at this point is that my user isn't connected to the repository correctly but your groups and user management has me scratching my head.  I've created a new group based on the All-Projects group and added my user, but it doesn't seem to affect anything. Do I need to create a new group with commit rights? Do I need to be editing a config file somewhere or am I just not understanding the user documentation?

Have you tried, first of all, to use a pre-built / pre-configured Gerrit Docker image from DockerHub?
So that you can have a configuration that is known to work.

Example:
docker run -p 29418:29418 -p 8080:8080 -e HOSTNAME=localhost gerritcodereview/gerrit

And then use the following credentials over HTTP:
admin/secret

The basic setup instructions are so simple I figured I could handle it. Apparently the assumptions about my competency need to be re-considered. :-/

I'm getting an error from TortoisePlink now: Server's host key did not match the signature supplied. 

I was able to use the TortoiseGit GUI to override the security error and clone with ssh, but I have no such option from the command line. I can't seem to clone or use git review from the command line due to the tortoiseplink error. This is probably not a gerrit problem, but any suggestions would be great.  This is most likely more ham-fistedness on my part, but could it be a problem with the server side keys?


HTH

Luca.


Any advice would be grand. 

Thanks
Russ

--
--

Russell Haley

unread,
Jun 5, 2018, 4:05:04 PM6/5/18
to Repo and Gerrit Discussion
I regenerated the ssh keys on the server and the system is happy again.


Thanks,
Russ 
Reply all
Reply to author
Forward
0 new messages