binbeobo / google-cloud-sdk

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

gcloud dns managed-zones list -- does not works, gives stack trace. #203

Open GoogleCodeExporter opened 8 years ago

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

run
gcloud --project helgo-1 dns managed-zones list

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

Expect the list of dns zones. Instead, this:

stack@gleg:~/lon4_order$ gcloud --project helgo-1 dns managed-zones list
Traceback (most recent call last):
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 194, in main
    _cli.Execute()
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 557, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1111, in Run
    output_formatter(result)
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1105, in <lambda>
    output_formatter = lambda obj: command_instance.Display(args, obj)
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/dns/lib/util.py", line 46, in CatchHTTPErrorRaiseHTTPException
    return func(*args, **kwargs)
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/dns/commands/managed_zones/list.py", line 63, in Display
    list_printer.PrintResourceList('dns.managedZones', items)
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/core/util/list_printer.py", line 18, in PrintResourceList
    console_io.PrintExtendedList(items, COLLECTION_COLUMNS[collection])
  File "/Users/stack/google-cloud-sdk/./lib/googlecloudsdk/core/console/console_io.py", line 529, in PrintExtendedList
    max_col_widths[col] = max(max_col_widths[col], len(str(row[col]))+2)

If you would like to report this issue, please run the following command:
  gcloud feedback --log-file=/Users/stack/.config/gcloud/logs/2015.08.13/20.42.44.476427.log

Please provide any additional information below.

It works fine when I auth with my "work account" (stack@spotify.com) to run the 
same command in project steel-ridge-91615 (that project is set as "default 
project" on this machine).
I tried the project helgo-1 from two different computers (both with "fresh" 
gcloud) with same result.

The output of 'gcloud info':

Google Cloud SDK [0.9.73]

Platform: [Mac OS X, x86_64]
Python Version: [2.7.9 (default, Feb 10 2015, 03:28:08)  [GCC 4.2.1 Compatible 
Apple LLVM 6.0 (clang-600.0.56)]]
Site Packages: [Disabled]

Installation Root: [/Users/stack/google-cloud-sdk]
Installed Components:
  core: [2015.08.10]
  app-engine-python: [1.9.24]
  core-nix: [2015.06.02]
  app: [2015.08.10]
  gcloud: [2015.08.10]
  gsutil-nix: [4.12]
  app-engine-python-extras: [1.9.21]
  beta: [2015.08.10]
  gsutil: [4.13]
  bq: [2.0.18]
  preview: [2015.08.10]
  bq-nix: [2.0.18]
System PATH: 
[/Users/stack/google-cloud-sdk/bin:/Users/stack/bin:/usr/local/sbin:/usr/local/b
in:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/munki]
Cloud SDK on PATH: [True]

Installation Properties: [/Users/stack/google-cloud-sdk/properties]
User Config Directory: [/Users/stack/.config/gcloud]
User Properties: [/Users/stack/.config/gcloud/properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Account: [john.stack@gmail.com]
Project: [steel-ridge-91615]

Current Properties:
  [core]
    project: [steel-ridge-91615]
    account: [john.stack@gmail.com]
    disable_usage_reporting: [False]
  [compute]
    zone: [europe-west1-d]

Logs Directory: [/Users/stack/.config/gcloud/logs]
Last Log File: [/Users/stack/.config/gcloud/logs/2015.08.13/20.42.44.476427.log]

Original issue reported on code.google.com by john.st...@gmail.com on 13 Aug 2015 at 6:47

GoogleCodeExporter commented 8 years ago
Sorry we dropped this on the floor. Are you still experiencing this?

I can't reproduce in any of the projects I've tried; I can take a look at your 
project to help debug if you'd like. Shoot me an email at zjn@... and I'll let 
you know how to grant me access.

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

GoogleCodeExporter commented 8 years ago
Hi!

I just checked, and I still have the same problem. I might also have some new 
clues on what's going on.

TL;DR: A non-ascii character in the description breaks parsing of the http-json 
response.

It seems that the error message has changed (I've done "gcloud components 
update" a couple times since I reported this). Tried on two separate machines, 
first my Mac laptop, and then on a Linux box. On the latter, I did the gcloud 
components update and it switched from "old" to "new" error message after the 
update.

"Old" message (traceback):

Traceback (most recent call last):
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 228, in main
    _cli.Execute()
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 580, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1131, in Run
    output_formatter(result)
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1125, in <lambda>
    output_formatter = lambda obj: command_instance.Display(args, obj)
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/dns/lib/util.py", line 46, in CatchHTTPErrorRaiseHTTPException
    return func(*args, **kwargs)
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/dns/commands/managed_zones/list.py", line 63, in Display
    list_printer.PrintResourceList('dns.managedZones', items)
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/core/util/list_printer.py", line 18, in PrintResourceList
    console_io.PrintExtendedList(items, COLLECTION_COLUMNS[collection])
  File "/home/john/google-cloud-sdk/./lib/googlecloudsdk/core/console/console_io.py", line 578, in PrintExtendedList
    max_col_widths[col] = max(max_col_widths[col], len(str(row[col]))+2)

"New" error message:

ERROR: gcloud crashed (UnicodeEncodeError): 'ascii' codec can't encode 
character u'\xe4' in position 2: ordinal not in range(128)

Looks like a typical python unicode bug. And 0xE4 would be 'ä', a character I 
have in the description field in at least one of my domains (xn--stck-moa.se, 
which translates to 'stäck.se'). A fair guess is that is what is causing the 
problem, and why is not present elsewhere.

I also did try with --log-http added to the command (gcloud --project helgo-1 
dns managed-zones list --log-http), and I do see the complete JSON HTTP 
response, including the result with the exotic character in it.

I can reproduce the same thing on another project (used a test project at 
work). Created one "nice" dns zone which worked fine, and one with an 'ä' in 
it that broke things.

I can't find an obvious way to change the description of a zone without 
deleting and recreating it (which would be problematic since the authoritative 
nameservers might change), or I would try that too.

I can add you as a project member to helgo-1 if that is still of use, but I 
guess it should be reproducable with the right (wrong) description.

/John

Original comment by john.st...@gmail.com on 4 Jan 2016 at 8:11

GoogleCodeExporter commented 8 years ago
Excellent, thanks for the details. Looks like that should be enough to repro on 
our end.

Original comment by z...@google.com on 4 Jan 2016 at 8:36

GoogleCodeExporter commented 8 years ago
Should be fixed in the next Cloud SDK release (92.0.0).

Original comment by z...@google.com on 5 Jan 2016 at 8:57