isusanin / google-cloud-sdk

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

Failed command: gcloud compute disks create “thiagosb-hd-snap” --source-snapshot “thiagosb-hd-snap1” --zone “us-central1-f” #241

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

What is the expected output? What do you see instead?

Please provide any additional information below.

Installation information:

Google Cloud SDK [0.9.76]

Platform: [Windows, x86_64]
Python Version: [2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit 
(AMD64)]]
Site Packages: [Enabled]

Installation Root: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk]
Installed Components:
  core: [2015.08.27]
  app-engine-python: [1.9.25]
  bq-win: [2.0.18]
  core-win: [2015.08.10]
  app: [2015.08.27]
  gcloud: [2015.08.27]
  windows-ssh-tools: [2015.06.02]
  app-engine-python-extras: [1.9.21]
  gsutil: [4.14]
  bq: [2.0.18]
  preview: [2015.08.27]
  gsutil-win: [4.13]
System PATH: [C:\Program Files\Google\Cloud 
SDK\google-cloud-sdk\bin\..\bin\sdk;C:\python27_x64\;C:\Program 
Files\Google\Cloud 
SDK\google-cloud-sdk\bin;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\
Java\javapath;;C:\Program Files\Google\Cloud 
SDK\google-cloud-sdk\bin;c:\windows\system32\;C:\Program Files 
(x86)\Skype\Phone\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft 
DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\10\Windows Performance 
Toolkit\;C:\Program Files (x86)\Brackets\command;C:\Program Files 
(x86)\nodejs\;;C:\Users\thiagosb\AppData\Local\Code\bin;c:\Program Files 
(x86)\Git\bin\;c:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\thiagosb\App
Data\Roaming\npm;]
Cloud SDK on PATH: [True]

[output truncated]

Original issue reported on code.google.com by thiag...@ciandt.com on 6 Sep 2015 at 2:33

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I found the problem. For some reason is not accepting double quotes in the 
"--source-snapshot", but accepted in other commands, for example, instance 
name, disk name, snapshot name, ...

Original comment by thiag...@ciandt.com on 6 Sep 2015 at 2:40

GoogleCodeExporter commented 8 years ago
Thanks for the report. That should also have worked.

Did you run this command from command line or as part of a script (.bat or 
.cmd) file.

Original comment by che...@google.com on 8 Sep 2015 at 3:32

GoogleCodeExporter commented 8 years ago
I ran in command line

Original comment by thiag...@ciandt.com on 8 Sep 2015 at 3:37

GoogleCodeExporter commented 8 years ago
Thanks, so the command you ran was

C:\my-path> gcloud compute disks create "thiagosb-hd-snap" "--source-snapshot" 
"thiagosb-hd-snap1" --zone "us-central1-f"

Can you post stacktrace or error message you received? Thanks.

Original comment by che...@google.com on 8 Sep 2015 at 4:20

GoogleCodeExporter commented 8 years ago
Below the error, but add that this problem happens when it is done ctrl + v 
command. If you enter, in command line, does not issue.

C:\Program Files\Google\Cloud SDK>gcloud compute disks create  "thiagosb-hd-snap
" --source-snapshot "thiagosb-hd-snap1" --zone "us-central1-f"
Traceback (most recent call last):
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecl
oudsdk\gcloud\gcloud.py", line 228, in main
    _cli.Execute()
  File "C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\./lib\googlecl
oudsdk\calliope\cli.py", line 543, in Execute
    raise exceptions.InvalidStringException(s_printable)
InvalidStringException: Failed to read command line argument ['\x93thiagosb-hd-s
nap\x94'] because it does not appear to be valid 7-bit ASCII.  (Argument is comp
osed of bytes ["'\\x93thiagosb-hd-snap\\x94'"].)

Thanks you !!

Original comment by thiag...@ciandt.com on 9 Sep 2015 at 11:51

GoogleCodeExporter commented 8 years ago
Thanks, this is very useful.

What is happening is that when you copy/paste (depending on the source) quote " 
character is sometimes represented as slanting ", which is understood very 
differently by the tool from actual ".

This is common mistake, but it is not clear that we can do better job handling 
such cases.

Original comment by che...@google.com on 9 Sep 2015 at 5:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I understand, but still does not make sense, because in other tools of this 
command is handled properly as the contents of the clipboard.

In my opinion, the tool should show exactly how it will be processed, for 
example, "'<name>'" instead of "<name>", helping the developer to identify 
errors in the copy command.

Regardless, thanks for the clarification.

Original comment by thiag...@ciandt.com on 9 Sep 2015 at 6:07

GoogleCodeExporter commented 8 years ago
Thanks for the feedback. Will try to improve the error message for these cases.

Original comment by che...@google.com on 10 Sep 2015 at 12:40

GoogleCodeExporter commented 8 years ago

Original comment by jsche...@google.com on 14 Mar 2016 at 8:44