Ryotaro-Sanpe666 / google-cloud-sdk

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

The gcloud components update broke the instalation for the second time #157

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Having installed a previous version of gcloud (< 0.9.68) with all components, 
then run gcloud components update. The install will remove your App Engine SDKs 
including preview/beta commands.

What is the expected output? What do you see instead?
I expected to be able to still use gcloud preview app, but I have a bogus error 
about managed vms or so:

Traceback (most recent call last):
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 200, in main
    _cli.Execute()
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 523, in Execute
    args = self.__parser.parse_args(args)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 73, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 64, in parse_known_args
    args, argv = super(ArgumentParser, self).parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1735, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1944, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1900, in consume_positionals
    take_action(action, args)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1809, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 268, in __call__
    parser, namespace, values, option_string=option_string)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1111, in __call__
    namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 64, in parse_known_args
    args, argv = super(ArgumentParser, self).parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1735, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1944, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1900, in consume_positionals
    take_action(action, args)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1809, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 268, in __call__
    parser, namespace, values, option_string=option_string)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1111, in __call__
    namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 64, in parse_known_args
    args, argv = super(ArgumentParser, self).parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1735, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1952, in _parse_known_args
    self.error(_('too few arguments'))
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 188, in error
    self._calliope_command, self._calliope_command.ai)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/usage_text.py", line 381, in ShortHelpText
    command.LoadAllSubElements()
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 978, in LoadAllSubElements
    element = self.LoadSubElement(name)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1018, in LoadSubElement
    self.SubParser(), parent_group=self)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1070, in __init__
    self._GetModuleFromPath(module_dir, module_path, path, construction_id),
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 726, in _GetModuleFromPath
    module = imp.load_module(name, f, file_path, items)
  File "/home/nitrous/google-cloud-sdk/lib/googlecloudsdk/appengine/app_commands/setup_managed_vms.py", line 6, in <module>
    from googlecloudsdk.appengine.lib.images import pull
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/appengine/lib/images/pull.py", line 13, in <module>
    from googlecloudsdk.core.util import console_io
CommandLoadFailure: Problem loading gcloud.preview.app.setup_managed_vms: 
cannot import name console_io.

What is the output of 'gcloud info'?
Google Cloud SDK [0.9.68]

Platform: [Linux, x86_64]
Python Version: [2.7.6 (default, Mar 22 2014, 22:59:56)  [GCC 4.8.2]]
Site Packages: [Enabled]

Installation Root: [/home/nitrous/google-cloud-sdk]
Installed Components:
  core: [2015.07.02]
  app-engine-python: [1.9.23]
  core-nix: [2015.06.02]
  kubectl: []
  gcutil-msg: [2015.07.02]
  app-engine-java: [1.9.23]
  gcloud: [2015.07.02]
  gsutil-nix: [4.12]
  bq-nix: [2.0.18]
  app-engine-python-extras: [1.9.21]
  beta: [2015.06.30]
  gsutil: [4.13]
  bq: [2.0.18]
  alpha: [2015.06.30]
  preview: [2015.07.02]
  app: [2015.07.02]
  kubectl-linux-x86_64: [0.20.1]
System PATH: 
[/home/nitrous/google-cloud-sdk/bin::/home/nitrous/tools/bin:/home/nitrous/.loca
l/bin:/home/nitrous/.npm/bin:/home/nitrous/workspace/go/bin:/home/nitrous/bin:/u
sr/local/bin:/home/nitrous/google-cloud-sdk/bin:/usr/local/sbin:/usr/sbin:/usr/b
in:/sbin:/bin:/usr/games:/usr/local/games]
Cloud SDK on PATH: [True]

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

Account: [******@*******]
Project: [None]

Current Properties:
  [core]
    account: [******@*******]
    disable_usage_reporting: [False]

Logs Directory: [/home/nitrous/.config/gcloud/logs]
Last Log File: 
[/home/nitrous/.config/gcloud/logs/2015.07.09/02.04.26.052765.log]

Please provide any additional information below.
This happened before on an upgrade that changed something on gcloud compute, 
and I had to reinstall. It then happened again now with the latest 0.9.68 
version update. Is the new standard to reinstall the SDK after every update? If 
so, why gcloud components update does not perform a clean install?

Best

Original issue reported on code.google.com by ronoaldo on 9 Jul 2015 at 2:07

GoogleCodeExporter commented 8 years ago
Hi ronoaldo,

Apologies for the breakage. You should *not* have to reinstall the Cloud SDK on 
each update. Please continue to report any issues you have updating.

We're looking into why this update didn't happen cleanly, and how we can ensure 
that this doesn't happen in the future.

Cheers,
Zack

Original comment by z...@google.com on 9 Jul 2015 at 2:35

GoogleCodeExporter commented 8 years ago
First, for anyone else experiencing this issue, the command `gcloud components 
reinstall` automates the reinstall procedure and will be the fastest way to fix 
it.

Hi Ronaldo,

We think this is not an issue with the latest update, but rather an earlier 
previous one; the file causing the crash has been gone since version 0.9.56.

We've been unable to reproduce this bug on our end. We tried running the 
attached shell script, which creates a Cloud SDK install with all components 
installed at an old version of the Cloud SDK, then updates to version 0.9.68, 
then runs `gcloud preview app deploy`. This command does not result in a crash 
on my Linux machine.

Are there any other details about your previous install that might be helpful? 
Do you remember at which version you initially installed the Cloud SDK?

Original comment by z...@google.com on 9 Jul 2015 at 8:42

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Zack, thanks for your prompt reply. I can compress the google-cloud-sdk 
installation folder that is broken if you want to inspect it. And I now have 
two of them: I have a box that is still at 0.9.67 and is already broken for 
`gcloud preview app -h` for instance.

It may be due to some long-time upgrade path that I had, as I was early 
adopting preview/alpha/beta components. I'm thinking that, for some unknown 
reason, something broken my setup over time. I use gcloud and app engine daily 
on multiple machines so it may be the case that I was cought by a set of 
subsequent upgrades that caused errors. I reported this issue because it is now 
more than three boxes with errors after upgrades. I was previously caught by an 
error on the 'gcloud compute' component on two different boxes, after upgrade 
to 0.9.67. A coworker had the same problem as well.

Is there an install/upgrade log that could help? The full sdk folder is about 
1.5G in size so if you want me I can upload to a storage bucket and send you a 
private link (drop me a letter at my username at gmail dot com).

I'm attaching here gcloud info and the error output of a gcloud preview app -h 
of the same version.

Original comment by ronoaldo on 10 Jul 2015 at 1:39

Attachments:

GoogleCodeExporter commented 8 years ago
Hi ronoaldo (sorry for the misspelling in #2),

I send you an email; that would really help.

I don't think there's any one log that would be helpful in this, unfortunately. 
If you could figure an exact upgrade path (i.e. version 0.9.50->0.9.55->0.9.68) 
that replicates this consistently, it would be great. But don't worry about 
figuring that out if it's going to take too much time.

There's a small bug we've found that's preventing us from trying a couple of 
methods to replicate this, but we're working on that.

There is a chance that this was caused by a packaging/release mis-step several 
versions ago, and that you won't see it in future versions (but you will see it 
with all installs that have been around since before the version with the 
mistake in it). In that case, we won't be able to do a whole lot about it.

Original comment by z...@google.com on 10 Jul 2015 at 6:09

GoogleCodeExporter commented 8 years ago
Thanks for the reply - links sent to you by e-mail with two sample broken sdks. 
I think I have another one. It will be hard to provide a path as I upgrade 
regularly as soon as there is a new release but I'm not sure if I missed one 
version between upgrades that could cause the issue.

It looks like it is fixed from now on either way; I can confirm that upgrading 
from 0.9.67 to 0.9.68 does not cause any errors on the preview app component.

Best regards,

Original comment by ronoaldo on 10 Jul 2015 at 6:37

GoogleCodeExporter commented 8 years ago
Another issue - It was an update as of today, and I got to the point at which 
things are broken but with another error:

-----
$ gcloud
Traceback (most recent call last):
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 200, in main
    _cli.Execute()
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 523, in Execute
    args = self.__parser.parse_args(args)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 73, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 64, in parse_known_args
    args, argv = super(ArgumentParser, self).parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1735, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/nitrous/google-cloud-sdk/./lib/argparse/__init__.py", line 1952, in _parse_known_args
    self.error(_('too few arguments'))
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 188, in error
    self._calliope_command, self._calliope_command.ai)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/usage_text.py", line 381, in ShortHelpText
    command.LoadAllSubElements()
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 978, in LoadAllSubElements
    element = self.LoadSubElement(name)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1011, in LoadSubElement
    self._config_hooks, parent_group=self, allow_empty=allow_empty)
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 812, in __init__
    self._GetModuleFromPath(module_dir, module_path, path, construction_id),
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 726, in _GetModuleFromPath
    module = imp.load_module(name, f, file_path, items)
  File "/home/nitrous/google-cloud-sdk/lib/googlecloudsdk/container/commands/__init__.py", line 10, in <module>
    from googlecloudsdk.container.lib import api_adapter
  File "/home/nitrous/google-cloud-sdk/./lib/googlecloudsdk/container/lib/api_adapter.py", line 10, in <module>
    from googlecloudsdk.compute.lib import constants
CommandLoadFailure: Problem loading gcloud.container: No module named 
compute.lib.
----

This was the error I mentioned that happened a few time ago on another machine, 
the same one a friend of mine experienced in his machine as well.

I also experienced another infinite loop when running `gcloud dns`, on a home 
PC I used yesterday (it was a very old installation so I removed and installed 
again). However, the same box raising the error above, also was affected today 
by the gcloud dns inifite loop:

---------
$ gcloud dns -h
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
You do not currently have this command group installed.  Using it
requires the installation of components: [dns]
WARNING: Component [dns] no longer exists.
All components are up to date.
Restarting gcloud command:
  $ gcloud dns info
------

Here are the gcloud info from the previous errors:

Google Cloud SDK [0.9.68]

Platform: [Linux, x86_64]
Python Version: [2.7.6 (default, Mar 22 2014, 22:59:56)  [GCC 4.8.2]]
Site Packages: [Enabled]

Installation Root: [/home/nitrous/google-cloud-sdk]
Installed Components:
  core: [2015.07.02]
  app-engine-python: [1.9.23]
  core-nix: [2015.06.02]
  gae-java-nix: [1.9.10]
  app-engine-go-linux-x86_64: [1.9.18]
  gcutil-msg: [2015.07.02]
  app-engine-java: [1.9.23]
  gcloud: [2015.07.02]
  gsutil-nix: [4.12]
  gcloud-extensions-linux-x86_64: [0.13.1]
  app-engine-python-extras: [1.9.21]
  beta: [2015.06.30]
  gae-go-nix: [2014.09.10]
  bq: [2.0.18]
  preview: [2015.07.02]
  gsutil: [4.13]
  alpha: [2015.06.30]
  preview-extensions-linux-x86_64: [0.11.0]
  app: [2015.07.02]
  gcutil-nix: [1.16.5]
  bq-nix: [2.0.18]
System PATH: 
[/home/nitrous/google-cloud-sdk/bin::/home/nitrous/tools/bin:/home/nitrous/.loca
l/bin:/home/nitrous/.npm/bin:/home/nitrous/workspace/go/bin:/home/nitrous/bin:/u
sr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local
/games]
Cloud SDK on PATH: [True]

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

Account: [**********]
Project: [None]

Current Properties:
  [core]
    account: [**********]
    disable_usage_reporting: [False]

Logs Directory: [/home/nitrous/.config/gcloud/logs]
Last Log File: 
[/home/nitrous/.config/gcloud/logs/2015.07.13/12.47.12.283180.log]

Hope this helps!

Original comment by ronoaldo on 13 Jul 2015 at 12:51

GoogleCodeExporter commented 8 years ago
Just a quick update: running gcloud components reinstall fixed the errors on 
the affected box in #6

Original comment by ronoaldo on 13 Jul 2015 at 12:55

GoogleCodeExporter commented 8 years ago
Another quick update... some of the errors I had are related to the Nitrous.IO 
cloud IDE. It allows you to run docker containers as a development workspace. 
When I restart the container after a gcloud components reinstall, some removed 
files are back in, which explains some weird setup with files that should no 
longer exist still existing. This seems to be a bug in how volumes are used to 
implement this "restart" of the developer container, as some removed files are 
kept once you do this restart.

I also experienced errors outside this env, i.e., on plain Debian desktop both 
at work and at home, so I think that a very old version, once upgraded to the 
more recent ones, may be still causing issues depending on the installed 
components. However, some of the debug info I have here is probably causing 
some noise.

Either way, this upgrade path from a very outdated version can easily be fixed 
with the reinstall command, so I think that this issue could be safelly closed 
if no one else is affected.

Original comment by ronoaldo on 17 Jul 2015 at 1:44

GoogleCodeExporter commented 8 years ago
Issue 178 has been merged into this issue.

Original comment by z...@google.com on 29 Jul 2015 at 4:27

GoogleCodeExporter commented 8 years ago
I just came across the same issue (opened by my former professor Ronoaldo! lol) 
and it's fixed now due to you guys help! Btw, I was not using any beta/alpha 
release of ther SDK. Thanks a lot!

Original comment by lunas...@gmail.com on 11 Aug 2015 at 2:08

GoogleCodeExporter commented 8 years ago
Err... actually the issue happened right after I installed the "alpha" 
component package. I was indeed running alpha code :P

Original comment by lunas...@gmail.com on 11 Aug 2015 at 2:09

GoogleCodeExporter commented 8 years ago
Issue 283 has been merged into this issue.

Original comment by z...@google.com on 5 Oct 2015 at 1:55

GoogleCodeExporter commented 8 years ago
Issue 304 has been merged into this issue.

Original comment by z...@google.com on 14 Oct 2015 at 5:58

GoogleCodeExporter commented 8 years ago

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