planktonicme / google-cloud-sdk

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

Problem using add-metadata on google compute engine #144

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.- Create a new vm on compute engine with: centos6 , name "test" , and all 
permissions with service account activated.
2.-Try to add a meta data, example: 
 /usr/local/bin/gcloud compute instances add-metadata "portal" --project "test" --zone "us-central1-f" --metadata "started_timestamp=2015-25-22 08:40:27"

What is the expected output? What do you see instead?
 I should see the metadata added but shows me: AttributeError: 'FieldList' object has no attribute '_FieldList__field'

What is the output of 'gcloud info'? --http-log:
Traceback (most recent call last):
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 209, in <module>
    main()
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/gcloud/gcloud.py", line 205, in main
    _cli.Execute()
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/cli.py", line 537, in Execute
    result = args.cmd_func(cli=self, args=args)
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1091, in Run
    output_formatter(result)
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/calliope/backend.py", line 1085, in <lambda>
    output_formatter = lambda obj: command_instance.Display(args, obj)
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 1114, in Display
    list(resources)
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 1077, in Run
    new_object = self.Modify(args, objects[0])
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/googlecloudsdk/compute/lib/base_classes.py", line 1125, in Modify
    new_object = copy.deepcopy(existing)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 338, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib64/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib64/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib64/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib64/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 329, in _reconstruct
    y.append(item)
  File "/usr/local/bin/../share/google/google-cloud-sdk/./lib/protorpc/messages.py", line 1087, in append
    self.__field.validate_element(value)
AttributeError: 'FieldList' object has no attribute '_FieldList__field'

Please provide any additional information below.
This is the versions that vm shows:
/usr/local/bin/gcloud version
Google Cloud SDK 0.9.61
alpha 2015.05.19
app 2015.05.19
app-engine-go-linux-x86_64 1.9.20
app-engine-java 1.9.20
app-engine-python 1.9.20
app-engine-python-extras 1.9.20
beta 2015.04.21
bq 2.0.18
bq-nix 2.0.18
compute 2015.05.19
core 2015.05.19
core-nix 2015.04.21
dns 2015.05.19
gae-go 2015.05.19
gae-go-nix 2014.09.10
gae-java 1.9.20
gae-java-nix 1.9.10
gae-python 2014.05.06
gcloud 2015.05.19
gcutil 1.16.5
gcutil-nix 1.16.5
gsutil 4.12
gsutil-nix 4.11
kubectl 
kubectl-linux-x86_64 0.17.0
preview 2015.05.19
sql 2015.05.06

If I do this in my local computer it works find, this problem only happens on 
the compute engine vm.

Original issue reported on code.google.com by darkh...@gmail.com on 22 May 2015 at 5:38

GoogleCodeExporter commented 8 years ago
Thanks for reporting.  This is a known issue that we're working on.  As a work 
around, you can install python 2.7.

Cheers,
Jeff

Original comment by jeffvaughan@google.com on 22 May 2015 at 6:20

GoogleCodeExporter commented 8 years ago

Original comment by jeffvaughan@google.com on 22 May 2015 at 6:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yes, I did this, and now is working.

yum -y groupinstall "Development tools";
yum -y install zlib-devel
yum -y install bzip2-devel
yum -y install openssl-devel
yum -y install ncurses-devel
yum -y install sqlite-devel

#Instaling python2.7.6 for gcloud, if we set de defautl 2.6 does not work 
correctly
wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz -O 
Python-2.7.6.tar.xz;
xz -d Python-2.7.6.tar.xz;
tar -xvf Python-2.7.6.tar;
(cd Python-2.7.6 && ./configure && make && make install);
ln -s /usr/local/bin/python2.7 /usr/bin/python2.7;
rm -rf /usr/bin/python;
ln -s /usr/local/bin/python2.7 /usr/bin/python;

Original comment by darkh...@gmail.com on 22 May 2015 at 8:26

GoogleCodeExporter commented 8 years ago
there is another problem when you install python2.7.6 and you set it like 
default, yum command stops working, so you have to replace teh first line of 
file: /usr/bin/yum with #!/usr/bin/python2.6, to do this you can execute the 
next script.

#Configuring yum module to use python2.6
sed -i "1s/.*/#!\/usr\/bin\/python2.6/" /usr/bin/yum;

So this way python2.6 is used by yum and python2.7.6 is default used by gcloud

Original comment by darkh...@gmail.com on 22 May 2015 at 10:22

GoogleCodeExporter commented 8 years ago
Please also not that you can use 

  export CLOUDSDK_PYTHON=/path/to/python2.7

in your .profile or .bashrc file to tell gcloud where to find python.  That's 
probably safer than patching yum...

Original comment by jeffvaughan@google.com on 26 May 2015 at 5:25

GoogleCodeExporter commented 8 years ago
export CLOUDSDK_PYTHON=/path/to/python2.7

Helped for me. Thanks.

Original comment by orsenthil@gmail.com on 7 Jun 2015 at 5:31

GoogleCodeExporter commented 8 years ago
Thank you, that way is better.

Original comment by darkh...@gmail.com on 9 Jun 2015 at 12:34

GoogleCodeExporter commented 8 years ago

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