Quentin123345 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

"gcloud source repos clone default" doesnt work on Windows #431

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using Google Cloud SDK on Windows and when trying to clone a repository of 
one of my projects I get a pop window asking for credentials. I tried my Google 
account credentials and app specific credentials. I tried to reinstall the SDK 
and to reinitialize (gcloud init) many times. No credentials work and I keep 
getting this error message:

> gcloud source repos clone default

Cloning into 'C:\Users\sagym\src\default'... Failed to erase credential: 
Element not found fatal: Authentication failed for 
'https://source.developers.google.com/p/XXXX/r/default/' ERROR: 
(gcloud.source.repos.clone) Command '['git', 'clone', 'https://source.dev 
elopers.google.com/p/XXXXX/r/default', 'C:\Program Files (x86)\Google\Cl oud 
SDK\default', '--config', 'credential.helper="gcloud.cmd"']' returned non-zero 
exit status 128

Original issue reported on code.google.com by ser...@gmail.com on 19 Dec 2015 at 3:19

GoogleCodeExporter commented 8 years ago
Thanks for reporting the issue.

* gcloud might not be on the path. Are you able to do where gcloud? If not you 
can do set PATH=%PATH%;C:\Program Files (x86)\Google\Cloud 
SDK\google-cloud-sdk\bin

Also can you try to specify destination path
> gcloud source repos clone default C:\Users\sagym\src\default

Note before you run these commands you should be logged in, via [gcloud auth 
login] or via [gcloud init].

Original comment by che...@google.com on 19 Dec 2015 at 3:46

GoogleCodeExporter commented 8 years ago
- gcloud is on the PATH. I verified that.

- gcloud auth logic works. I get the "You are now logged in as 
[sXXXXX@gmail.com]." message.

- running "gcloud source repos clone default C:\Users\sagym\src\default" 
produces a "Git credentials" popup that no matter what password I try, produces 
exit status 128.

Original comment by ser...@gmail.com on 20 Dec 2015 at 5:34

GoogleCodeExporter commented 8 years ago
Thanks for checking this.

Note that 
  gcloud source repos clone default C:\Users\sagym\src\default
simply runs
  git clone https://source.developers.google.com/p/XXXX/r/default C:\Users\sagym\src\default --config credential.helper=gcloud.cmd

The credential helper is named gcloud.cmd which means git will try to invoke 
"git-credential-gcloud.cmd" for credentials, this file should be in your path. 
Can you verify that
  where git-credential-gcloud.cmd
returns a path.

No popup should come up for username password, as credential helper should 
provide these for git from your gcloud credentials. (BTW, the username is 
account and password is access token)

Also can you tell which git version you are using
  git --version

Original comment by che...@google.com on 28 Dec 2015 at 6:15

GoogleCodeExporter commented 8 years ago
C:\>where gcloud.cmd
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd

C:\>where git-credential-gcloud.cmd
C:\Program Files (x86)\Google\Cloud 
SDK\google-cloud-sdk\bin\git-credential-gcloud.cmd

C:\>git --version
git version 1.8.5.2.msysgit.0

Original comment by ser...@gmail.com on 29 Dec 2015 at 2:01

GoogleCodeExporter commented 8 years ago
git 1.8.5 version is relatively old, circa 11/2013.

I am using git version 2.5.3.windows.1, but I will try to find and install this 
older version to make sure it works for it as well.

In meantime you can try to update your git and try again.

Original comment by che...@google.com on 29 Dec 2015 at 3:44

GoogleCodeExporter commented 8 years ago
Upgrading git solved the issue.

Thanks for your support!

Original comment by ser...@gmail.com on 6 Jan 2016 at 9:31

GoogleCodeExporter commented 8 years ago
Glad that you were able to make it work.

We'll leave this issue open to track work on making the error response more 
useful here.

Original comment by z...@google.com on 6 Jan 2016 at 1:43