modxevil / google-cloud-sdk

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

something wrong with the way ssh keys are created. #455

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Issue running command [gcloud compute ssh].

What steps will reproduce the problem?
compute ssh --ssh-flag=-L3000:localhost:3000 --project=strymin-1178 --zone 
us-central1-f mean1-mean

What is the expected output? What do you see instead?
create a ssh tunnell with 3000 port on localhost

Please provide any additional information below.
tried with both password and no password while creating the ssh key

Traceback (most recent call last):
  File "calliope/cli.py", line 609, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "calliope/backend.py", line 1228, in Run
    resources = command_instance.Run(args)
  File "surface/compute/ssh.py", line 153, in Run
    use_account_service=self._use_accounts_service)
  File "api_lib/compute/ssh_utils.py", line 504, in ActuallyRun
    has_keys = self.EnsureSSHKeyIsInProject(user)
  File "api_lib/compute/ssh_utils.py", line 310, in EnsureSSHKeyIsInProject
    self.messages, user, public_key, existing_metadata)
  File "api_lib/compute/ssh_utils.py", line 191, in _AddSSHKeyToMetadataMessage
    constants.SSH_KEYS_METADATA_KEY: _PrepareSSHKeysValue(ssh_keys)},
  File "api_lib/compute/ssh_utils.py", line 173, in _PrepareSSHKeysValue
    return '\n'.join(keys)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 411: 
ordinal not in range(128)

Installation information:

Google Cloud SDK [91.0.1]

Platform: [Mac OS X, x86_64]
Python Version: [2.7.8 (default, Aug 24 2014, 21:26:19)  [GCC 4.2.1 Compatible 
Apple LLVM 5.1 (clang-503.0.40)]]
Python Location: 
[/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/Resou
rces/Python.app/Contents/MacOS/Python]
Site Packages: [Disabled]

Installation Root: [/Users/pbhalesain/google-cloud-sdk]
Installed Components:
  core: [2015.12.16]
  core-nix: [2015.11.24]
  gcloud: []
  gsutil-nix: [4.15]
[output truncated]

Original issue reported on code.google.com by pbhales...@gmail.com on 3 Jan 2016 at 9:58

GoogleCodeExporter commented 8 years ago
It looks like gcloud is choking on a non-ASCII value in either your public key 
(~/.ssh/google_compute_engine.pub) or in the project metadata (Cloud Console > 
Compute Engine > Metadata > SSH Keys). Can you check both of these places for 
keys with non-ASCII characters and remove them? Otherwise, you could add your 
public ssh key in the project metadata in the Cloud Console manually.

We'll look into fixing this up.

Original comment by z...@google.com on 4 Jan 2016 at 12:53

GoogleCodeExporter commented 8 years ago
Thank you for the response. I checked the key it was
generating google_compute_engine.pub. I replaced the hostname with .local
name. The hostname contained *'s *and *space*. I am using mac pro. It is
working fine now.

Original comment by pbhales...@gmail.com on 4 Jan 2016 at 1:13

GoogleCodeExporter commented 8 years ago
Great, that must have been the issue. Thanks for checking.

Original comment by z...@google.com on 4 Jan 2016 at 1:15