modxevil / google-cloud-sdk

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

Managed VM Fails to Deploy on Windows for Failing to Copy Certificates #529

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Issue running command [gcloud preview app deploy].

What steps will reproduce the problem?
On windows, try to deploy a managed VM instance using the command:
   gcloud preview app deploy

What is the expected output? What do you see instead?
   It should deploy.

Please provide any additional information below.
During the Managed VM deployment, google issues the following command to copy 
certificate files from the remote instance to the local client:
  compute copy-files --zone <zone> --verbosity none --no-user-output-enabled --quiet --project <project> gae-builder-vm-<vmid>:/clientcert/* tmp8mss91
That gcloud command, in turn, calls the pscp command:
 C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\pscp.exe -unsafe -i C:\Users\Michael\.ssh\google_compute_engine.ppk -r Michael@23.251.151.135:/clientcert/* tmpcpmhxy

On Windows 10, pscp.exe will spit out the warning message below before copying 
the files. Because there is no user input to say yes to this warning, the 
command crashes and the entire deployment fails.

    The server's host key is not cached in the registry. You
    have no guarantee that the server is the computer you
    think it is.
    The server's rsa2 key fingerprint is:
    ssh-rsa 2048 a2:36:01:0b:06:d7:5c:02:28:1c:3c:68:08:f8:4b:22
    If you trust this host, enter "y" to add the key to
    PuTTY's cache and carry on connecting.
    If you want to carry on connecting just once, without
    adding the key to the cache, enter "n".
    If you do not trust this host, press Return to abandon the
    connection.
    Store key in cache? (y/n)

I've tracked the issue down to the following code:
    C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\compute\copy_files.py:140

---------------------------------------
Installation information:

Google Cloud SDK [95.0.0]

Platform: [Windows, x86_64]
Python Version: [2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit 
(Intel)]]
Python Location: [c:\Python27\python.exe]
Site Packages: [Disabled]

Installation Root: [C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk]
Installed Components:
  core: [2016.01.29]
  bq-win: [2.0.18]
  core-win: [2016.01.12]
  gcloud: []
  windows-ssh-tools: [2016.01.29]
  beta: [2016.01.12]
  gsutil: [4.16]
  bq: [2.0.18]
  gsutil-win: [4.16]
System PATH: [C:\Program Files (x86)\Google\Cloud 
SDK\google-cloud-sdk\bin\..\bin\sdk;C:\Program 
Files\ImageMagick-6.9.3-Q16-HDRI;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\
system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShe
ll\v1.0\;C:\Program Files\Ethereum 0.9.41\bin;C:\Program Files 
(x86)\Skype\Phone\;C:\Program Files (x86)\Tesseract-OCR;C:\Program Files 
(x86)\Google\Cloud 
SDK\google-cloud-sdk\bin;c:\Python27;C:\Python27\Scripts;C:\cygwin\bin;C:\Users\
Michael\AppData\Local\Programs\Git\cmd]
Cloud SDK on PATH: [True]

Installation Properties: [C:\Program Files (x86)\Google\Cloud 
SDK\google-cloud-sdk\properties]
User Config Directory: [C:\Users\Michael\AppData\Roaming\gcloud]
User Properties: [C:\Users\Michael\AppData\Roaming\gcloud\properties]
[output truncated]

Original issue reported on code.google.com by michael....@docketalarm.com on 9 Feb 2016 at 7:14

GoogleCodeExporter commented 8 years ago
As an aside, it's also somewhat problematic that the gcloud command has 
"--quiet" set  and "--verbosity none", even when the parent command had 
"--verbosity debug". This made tracking down the bug much more difficult.

Original comment by michael....@docketalarm.com on 9 Feb 2016 at 7:18

GoogleCodeExporter commented 8 years ago
Here's a workaround: when you get to the point where it says "Error copying 
certificates." in the logs, type 'y' and then 'enter', even if you're not 
prompted for anything.

Original comment by michael....@docketalarm.com on 9 Feb 2016 at 7:28

GoogleCodeExporter commented 8 years ago
Thanks for the report and workaround.

Original comment by gsfow...@google.com on 9 Feb 2016 at 7:26