repo upload and publickey issues with AOSP

1,401 views
Skip to first unread message

vikasa

unread,
Jun 20, 2011, 2:57:25 AM6/20/11
to Repo and Gerrit Discussion, android-...@googlegroups.com
Hi -

I am not able to get my 'repo upload' to work for Android. I followed
an earlier mail thread on the similar issue
http://groups.google.com/group/repo-discuss/browse_thread/thread/c8e68f9b4dfb143b/c868fb37d4b5a434?lnk=gst&q=repo+upload#c868fb37d4b5a434

Following is the details of my Android Open Source account:
Username: Vikas
Full Name: Vikas Arora
Email Address: vik...@google.com
Account ID: 1006707

Just to make sure I have not missed nay step, I did following:
- Registered my SSH keys
- cd ~/.ssh; ssh-keygen -t rsa -C vik...@google.com; cat id_rsa.pub;
- Added my public SSH keys generated in first step to 'https://
review.source.android.com/#settings,ssh-keys'

- Initializing a Repo client
- repo init -u git://android.git.kernel.org/platform/manifest.git
- In the above step, provided my Full Name & Email Address
(vik...@google.com) as specified in my AOSP account.
- repo sync -j 16

- Verifying Git Tags (Load the following public key into your GnuPG
key database)
- gpg --import
- Copy pasted following pub-key (ref: http://source.android.com/source/downloading.html)
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
...
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----
Cntl-D
I got following response:
gpg: key 9AB10E78: "The Android Open Source Project <initial-
contri...@android.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1

- git tag -v TAG_NAME
I got an error: "error: tag 'TAG_NAME' not found."
// Not sure if I need to worry about this error or this is just
some redundant error

- Build & code changes
- Edited some files in git project 'external/webp', commit the
changes 'git commit -a'
- make -j 16

- Upload code for review:
- repo upload
Upload project external/webp/:
branch Android_webp_encoder_ver_0_1_2 ( 1 commit, Thu Jun 16
15:56:45 2011 +0530):
7c970a0a Add WebP Encoder code to the /external/webp code-
repo. With this change in addtion to libwebp-decode static lib,
libwebp-encode static library corresponding to WebP encoder will be
build & installed.
to review.source.android.com (y/n)? y
Permission denied (publickey).
fatal: The remote end hung up unexpectedly


- Some debugging info:
git var GIT_COMMITTER_IDENT
Vikas Arora <vik...@google.com> 1308552673 +0530

repo --trace upload
: unpickle /usr/local/google/home/vikasa/android/opensource/.repo/
manifests.git/config
: unpickle /home/vikasa/.gitconfig
: load refs /usr/local/google/home/vikasa/android/opensource/.repo/
projects/bionic.git
: unpickle /usr/local/google/home/vikasa/android/opensource/.repo/
projects/external/webp.git/config
: export GIT_DIR=/usr/local/google/home/vikasa/android/
opensource/.repo/projects/external/webp.git
: git rev-list --abbrev=8 --abbrev-commit --pretty=oneline --reverse --
date-order ^refs/remotes/korg/master refs/heads/
Android_webp_encoder_ver_0_1_2 -- 1>| 2>|
: git log --pretty=format:%cd -n 1 refs/heads/
Android_webp_encoder_ver_0_1_2 -- 1>| 2>|
Upload project external/webp/:
branch Android_webp_encoder_ver_0_1_2 ( 1 commit, Thu Jun 16
15:56:45 2011 +0530):
7c970a0a Add WebP Encoder code to the /external/webp code-
repo. With this change in addtion to libwebp-decode static lib,
libwebp-encode static library corresponding to WebP encoder will be
build & installed.
to review.source.android.com (y/n)? y

: cd /usr/local/google/home/vikasa/android/opensource/external/webp
: git update-index -q --unmerged --ignore-missing --refresh 1>| 2>|
: git diff-index -z --cached HEAD 1>| 2>|
: git diff-files -z 1>| 2>|
: git ls-files -z --others --exclude-standard 1>| 2>|
: git var GIT_COMMITTER_IDENT 1>| 2>|
: git push --receive-pack=gerrit receive-pack
ssh://vik...@review.source.android.com:29418/platform/external/webp
refs/heads/Android_webp_encoder_ver_0_1_2:refs/for/master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly


Ian Kumlien

unread,
Jun 20, 2011, 10:33:18 AM6/20/11
to vikasa, Repo and Gerrit Discussion, android-...@googlegroups.com
On Mon, Jun 20, 2011 at 08:57, vikasa <vik...@google.com> wrote:
> to review.source.android.com (y/n)? y
> Permission denied (publickey).
> fatal: The remote end hung up unexpectedly

Is your username on the local machine the same as your email username?

If it isn't you can set it in your ssh configuration (~/.ssh/config):
Host <host>
User <username>

or you can do it via repo:
git config --global review."<URL>".username <username>

Best way to find out would be to ssh <host> -p 29418 gerrit,
if that doesn't work try adding -l vikasa and try again...

Jean-Baptiste Queru

unread,
Jun 20, 2011, 11:50:32 AM6/20/11
to Repo and Gerrit Discussion, vikasa
Sorry you're having so much trouble. Clearly we need to improve our
documentation in that area.

IIRC that can come from two areas:

-username mismatch
-key issue

On the username front, you need to check in Gerrit settings that you
do have an ssh username set up. It's the first field at
https://review.source.android.com/#settings

Also, the default behavior is to assume that your ssh username is the
username in the email address you set up during repo init. If that's
not the case, Ian gave details later in the thread about how to manage
the mismatch. I've recently helped someone do it successfully with git
config --global
review.https://android-git.corp.google.com/g/Gerrit.username
<username>

On the key side, things can be harder to diagnose. Luckily, it's easy
to eyeball that your public key has been properly uploaded. Once
that's the case, the rest tends to boil down to invoking ssh-add
and/or ssh-agent in the right order with the right parameters... and
as far as I'm concerned that's black magic.

JBQ

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

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

Vikas Arora

unread,
Jun 20, 2011, 12:59:54 PM6/20/11
to Ian Kumlien, Repo and Gerrit Discussion, android-...@googlegroups.com
Ian -

Ok so I tried following and still getting the same issue :-(

- I changed the .ssh/config to make sure I have correct username:

vikas[101] cat .ssh/config 
    User git
    Hostname github.com
    IdentityFile /home/vikasa/.ssh/id_rsa
    User vikasa
    IdentityFile /home/vikasa/.ssh/id_rsa

- Tried setting username with 'git config'
 git config --global review.https://android.git.kernel.org.username vikasa

- My username (LDAP) is 'vikasa' and my email registered is 'vik...@google.com'

- I tried ssh to review.source.android.com
vikas[108] ssh review.source.android.com -p 29418 gerrit -l vikasa
Permission denied (publickey).

vikas[109] ssh -v review.source.android.com -p 29418 gerrit -l vikasa
OpenSSH_5.8p1, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /home/vikasa/.ssh/config
debug1: Applying options for review.source.android.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *.*
debug1: Applying options for *
debug1: Executing need proxy command: exec /usr/sbin/prodssh --logtostderr --minloglevel=2 --dest_host=review.source.android.com --dest_port=29418 --dest_user=vikasa --test_need_proxy
debug1: permanently_drop_suid: 45834
debug1: UseProxyIf returned false, disabling proxy
debug1: Connecting to review.source.android.com [140.211.167.229] port 29418.
debug1: Connection established.
debug1: could not open key file '/etc/ssh/ssh_host_key': Permission denied
debug1: identity file /home/vikasa/.ssh/id_rsa type 1
...
debug1: identity file /home/vikasa/.ssh/clusterhost/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version GerritCodeReview_2.2.1-57-g4efeb4f (SSHD-CORE-0.5.1-R1095809)
debug1: no match: GerritCodeReview_2.2.1-57-g4efeb4f (SSHD-CORE-0.5.1-R1095809)
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8
debug1: Unspecified GSS failure.  Minor code may provide more information
Ticket expired
debug1: Unspecified GSS failure.  Minor code may provide more information
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA d1:08:4f:37:ea:6a:f2:05:ba:3f:c5:02:b6:67:a1:d3
debug1: Host '[review.source.android.com]:29418' is known and matches the RSA host key.
debug1: Found key in /home/vikasa/.ssh/known_hosts:5
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/vikasa/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: .ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/vikasa/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/vikasa/.ssh/identity
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/vikasa/.ssh/localhost/identity
debug1: Trying private key: /home/vikasa/.ssh/clusterhost/identity
debug1: Trying private key: /home/vikasa/.ssh/id_dsa
debug1: Offering RSA public key: /home/vikasa/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/vikasa/.ssh/localhost/id_dsa
debug1: Trying private key: /home/vikasa/.ssh/localhost/id_rsa
debug1: Trying private key: /home/vikasa/.ssh/clusterhost/id_dsa
debug1: Trying private key: /home/vikasa/.ssh/clusterhost/id_rsa
debug1: No more authentication methods to try.
Permission denied (publickey).

Anatol Pomazau

unread,
Jun 20, 2011, 1:07:20 PM6/20/11
to Vikas Arora, Ian Kumlien, Repo and Gerrit Discussion, android-...@googlegroups.com
Hi

It looks like your private key does not match the key at Gerrit. Please visit https://review.source.android.com/#settings,ssh-keys and make sure that it contains the right public key.


On Mon, Jun 20, 2011 at 8:03 PM, Ian Kumlien <ian.k...@gmail.com> wrote:
On Mon, Jun 20, 2011 at 08:57, vikasa <vik...@google.com> wrote:
> to review.source.android.com (y/n)? y
> Permission denied (publickey).
> fatal: The remote end hung up unexpectedly

Is your username on the local machine the same as your email username?

If it isn't you can set it in your ssh configuration (~/.ssh/config):
Host <host>
   User <username>

or you can do it via repo:
git config --global review."<URL>".username <username>

Best way to find out would be to ssh <host> -p 29418 gerrit,
if that doesn't work try adding -l vikasa and try again...

Reply all
Reply to author
Forward
0 new messages