binbeobo / google-cloud-sdk

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

unexpected keyword argument 'revision' after installing 0.9.87.1 #395

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
After bug # 393 was resolved, I tried running gcloud again I'm getting the same 
problem. Here are my steps:

$ sudo apt-get remove google-cloud-sdk                                          

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  google-cloud-sdk
0 upgraded, 0 newly installed, 1 to remove and 21 not upgraded.
After this operation, 32.3 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 137463 files and directories currently installed.)
Removing google-cloud-sdk (0.9.87.1-20151118121533-0) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

$ sudo apt-get install google-cloud-sdk                                         

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  google-cloud-sdk
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 0 B/4,360 kB of archives.
After this operation, 32.3 MB of additional disk space will be used.
Selecting previously unselected package google-cloud-sdk.
(Reading database ... 133380 files and directories currently installed.)
Preparing to unpack .../google-cloud-sdk_0.9.87.1-20151118121533-0_all.deb ...
Unpacking google-cloud-sdk (0.9.87.1-20151118121533-0) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up google-cloud-sdk (0.9.87.1-20151118121533-0) ...

$ gcloud
Traceback (most recent call last):
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 86, in <module>
    from googlecloudsdk.calliope import base
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/base.py", line 8, in <module>
    from googlecloudsdk.calliope import usage_text
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/usage_text.py", line 12, in <module>
    from googlecloudsdk.calliope import arg_parsers
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/arg_parsers.py", line 43, in <module>
    from googlecloudsdk.core import log
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 12, in <module>
    from googlecloudsdk.core import properties
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 11, in <module>
    from googlecloudsdk.core import exceptions
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 307, in <module>

  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 279, in Load
    directory name so that different release channels can have separate
TypeError: __init__() got an unexpected keyword argument 'revision'

Is it complaining about the contents of this file? 
/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json

/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core$ more config.json 
{
  "config_suffix": "", 
  "disable_updater": true, 
  "disable_usage_reporting": false, 
  "documentation_url": "https://developers.google.com/cloud/sdk/", 
  "release_channel": "rapid", 
  "revision": 20151118121533, 
  "snapshot_schema_version": 3, 
  "snapshot_url": "https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json", 
  "user_agent": "Cloud SDK Command Line Tool", 
  "version": "0.9.87"
}

Original issue reported on code.google.com by vsi...@gmail.com on 19 Nov 2015 at 9:07

GoogleCodeExporter commented 8 years ago
So if I remove the line
 "revision": 20151118121533,
from the config.json file
Things appear to work again. How important is that revision key?

$ gcloud
Usage: gcloud [optional flags] <group | command>
  group may be           auth | components | compute | config | container |
                         deployment-manager | dns | preview | source | sql |
                         topic
  command may be         docker | feedback | help | info | init | version

The *gcloud* CLI manages authentication, local configuration, developer
workflow, and interactions with the Google Cloud Platform APIs.
....

Original comment by vsi...@gmail.com on 19 Nov 2015 at 9:47

GoogleCodeExporter commented 8 years ago
Same error on ubuntu vivid, this time it was an upgrade from 0.86 to 0.87.1

The following packages will be upgraded:
  google-cloud-sdk
1 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Need to get 4,360 kB of archives.
After this operation, 88.1 kB of additional disk space will be used.
Get:1 http://packages.cloud.google.com/apt/ cloud-sdk-vivid/main 
google-cloud-sdk all 0.9.87.1-20151118121533-0 [4,360 kB]
Fetched 4,360 kB in 0s (6,065 kB/s)        
(Reading database ... 299808 files and directories currently installed.)
Preparing to unpack .../google-cloud-sdk_0.9.87.1-20151118121533-0_all.deb ...
Unpacking google-cloud-sdk (0.9.87.1-20151118121533-0) over 
(0.9.86-20151106084643-0) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up google-cloud-sdk (0.9.87.1-20151118121533-0) ...
Traceback (most recent call last):
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 86, in <module>
    from googlecloudsdk.calliope import base
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/base.py", line 8, in <module>
    from googlecloudsdk.calliope import usage_text
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/usage_text.py", line 12, in <module>
    from googlecloudsdk.calliope import arg_parsers
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/calliope/arg_parsers.py", line 43, in <module>
    from googlecloudsdk.core import log
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/log.py", line 12, in <module>
    from googlecloudsdk.core import properties
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/properties.py", line 11, in <module>
    from googlecloudsdk.core import exceptions
  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 307, in <module>

  File "/usr/bin/../lib/google-cloud-sdk/./lib/googlecloudsdk/core/config.py", line 279, in Load
    directory name so that different release channels can have separate
TypeError: __init__() got an unexpected keyword argument 'revision'

Original comment by vsi...@gmail.com on 19 Nov 2015 at 10:04

GoogleCodeExporter commented 8 years ago
The revision key seems important. Further gcloud usage crashes without it.

You cannot perform this action because this Cloud SDK installation is 
managed by an external package manager.  If you would like to get the 
latest version, please see our main download page at:

https://developers.google.com/cloud/sdk/

ERROR: (gcloud.components.update) The component manager is disabled for this 
installation
You cannot perform this action because this Cloud SDK installation is 
managed by an external package manager.  If you would like to get the 
latest version, please see our main download page at:

https://developers.google.com/cloud/sdk/

ERROR: (gcloud.components.update) The component manager is disabled for this 
installation
You cannot perform this action because this Cloud SDK installation is 
managed by an external package manager.  If you would like to get the 
latest version, please see our main download page at:

https://developers.google.com/cloud/sdk/

ERROR: (gcloud.components.update) The component manager is disabled for this 
installation
ERROR: gcloud crashed (TypeError): UpdateCheck() takes exactly 1 argument (0 
given)

If you would like to report this issue, please run the following command:
  gcloud feedback

Original comment by vsi...@gmail.com on 19 Nov 2015 at 11:35

GoogleCodeExporter commented 8 years ago
I am completely unable to reproduce this bug. I created a vivid compute 
instance, manually installed google-cloud-sdk_0.9.86-20151106084643-0_all.deb 
and then followed the debian/ubuntu instructions on 
https://cloud.google.com/sdk/?hl=en#debubu.

Can you give instructions on how to reproduce from a clean instance?

Original comment by stephe...@google.com on 20 Nov 2015 at 6:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by stephe...@google.com on 20 Nov 2015 at 6:48

GoogleCodeExporter commented 8 years ago
How about a Dockerfile?

Starting with trusty, I "inoculate" the system with 0.9.86 first and even 
remove it before continuing. Since 0.9.86 is not available via apt anymore, I 
install it from a deb package.

Then I install google sdk via apt as I normally would. Running gcloud doesn't 
work after this.

Then I remove and install gcloud again via apt-get. Running gcloud doesn't work 
after this.

If I just straight install the latest gcloud-sdk via apt, then everything works 
as usual. Something about having 0.9.86 on the system first (which are all my 
machines) seems to help in causing what I'm seeing. 

Just do "docker build ." with my attached Dockerfile

Original comment by vsi...@gmail.com on 20 Nov 2015 at 7:16

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks, I can reproduce with the docker file.

Original comment by stephe...@google.com on 20 Nov 2015 at 7:46

GoogleCodeExporter commented 8 years ago
That dockerfile was extremely helpful. The bug only manifests when you run as 
root which is something I don't normally do.

Short answer:

sudo rm -rf /usr/lib/google-cloud-sdk
sudo apt-get install --reinstall google-cloud-sdk

Long answer:

We are not cleaning up pyc files which are created when you run as root. We 
also normalize all timestamps to 1980 as part of our build which prevents 
python from noticing the files changed. We likely should be generating these on 
install anyways since it would decrease gcloud load times.

Original comment by stephe...@google.com on 20 Nov 2015 at 9:37

GoogleCodeExporter commented 8 years ago

Original comment by stephe...@google.com on 20 Nov 2015 at 9:40

GoogleCodeExporter commented 8 years ago
I just published a new debian package that retroactively fixes the problem and 
prevents it from happening in the future.

As a happy accident, you should also see a major speedup in gcloud load times 
since it is precompiled.

Thanks for the bug report!

Original comment by stephe...@google.com on 23 Nov 2015 at 4:36

GoogleCodeExporter commented 8 years ago
Thanks for the quick turnaround! Looks very good!

Original comment by vsi...@gmail.com on 24 Nov 2015 at 2:49