Bug 788613 - rhevm userdata is being double encoded
Summary: rhevm userdata is being double encoded
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: deltacloud-core
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: beta6
Assignee: chris alfonso
QA Contact: Ronelle Landy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-08 15:40 UTC by dgao
Modified: 2012-05-15 20:32 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 20:32:59 UTC


Attachments (Terms of Use)
patched to base64 decode file contents (4.82 KB, application/x-rpm)
2012-02-09 16:32 UTC, chris alfonso
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0587 0 normal SHIPPED_LIVE new packages: deltacloud-core 2012-05-15 22:31:31 UTC

Description dgao 2012-02-08 15:40:05 UTC
[root@10-16-120-170 ~]# cat /media/deltacloud-user-data.txt 
TVh4b2RIUndjem92TDJSbFlXUmtiMjVyWlhrdWRYTmxjbk41Y3k1eVpXUm9ZWFF1WTI5dGZERXhNRGd5TWpVMkxUVXhZekV0TVRGbE1TMWhZVEkzTFRBd01UTXlNR1l6WmpCak5YeEphVGR3V1RBMVF6SXlhWEp2WTJaRFRFVnpUbGszWlhkblRsSlRjVnAwU1ZKS1lWZ3lOalJEYm1GRVRXcDRWV3c9[root@10-16-120-170 ~]# vi /media/deltacloud-user-data.txt 
[root@10-16-120-170 ~]# vi /usr/bin/audrey 
[root@10-16-120-170 ~]# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import base64
>>> line = open('/media/deltacloud-user-data.txt', 'r').read().strip()
>>> line
'TVh4b2RIUndjem92TDJSbFlXUmtiMjVyWlhrdWRYTmxjbk41Y3k1eVpXUm9ZWFF1WTI5dGZERXhNRGd5TWpVMkxUVXhZekV0TVRGbE1TMWhZVEkzTFRBd01UTXlNR1l6WmpCak5YeEphVGR3V1RBMVF6SXlhWEp2WTJaRFRFVnpUbGszWlhkblRsSlRjVnAwU1ZKS1lWZ3lOalJEYm1GRVRXcDRWV3c9'
>>> dl = base64.b64decode(line)
>>> dl
'MXxodHRwczovL2RlYWRkb25rZXkudXNlcnN5cy5yZWRoYXQuY29tfDExMDgyMjU2LTUxYzEtMTFlMS1hYTI3LTAwMTMyMGYzZjBjNXxJaTdwWTA1QzIyaXJvY2ZDTEVzTlk3ZXdnTlJTcVp0SVJKYVgyNjRDbmFETWp4VWw='
>>> len(dl.split('|'))
1
>>> ddl = base64.b64decode(dl)
>>> len(ddl.split('|'))
4
>>> ddl
'1|https://deaddonkey.usersys.redhat.com|11082256-51c1-11e1-aa27-001320f3f0c5|Ii7pY05C22irocfCLEsNY7ewgNRSqZtIRJaX264CnaDMjxUl'
>>>

Comment 1 dgao 2012-02-08 15:43:54 UTC
[root@intel-d3c4702-01 deltacloud-core]# rpm -qa | grep "deltacloud"
deltacloud-core-ec2-0.5.0-4.rc1.el6.noarch
deltacloud-core-vsphere-0.5.0-4.rc1.el6.noarch
deltacloud-core-0.5.0-4.rc1.el6.noarch
rubygem-deltacloud-client-0.5.0-1.rc2.el6.noarch
deltacloud-core-rhevm-0.5.0-4.rc1.el6.noarch

Comment 2 dgao 2012-02-08 15:44:29 UTC
The effect of this bug is preventing audrey client from properly digesting the userdata.

Comment 3 Hugh Brock 2012-02-08 15:56:53 UTC
Don't believe this is urgent -- it only blocks Audrey on RHEV. Changing to HIGH. Not clear if we should block beta for it or not.

Comment 4 Ronelle Landy 2012-02-08 17:01:43 UTC
Deltacloud does not seem to be encoding user_data by default. Some call must be
requesting that the data be encoded: 

Create an instance with encoded data (testInstanceEn):

    ssh root.120.210
    root.120.210's password:
    [root@10-16-120-210 ~]# /sbin/modprobe floppy; lsmod | grep floppy
    floppy                 61511  0
    [root@10-16-120-210 ~]# /bin/mount /dev/fd0 /media; cat
/media/deltacloud-user-data.txt
   
MXxodHRwczovL2RlYWRkb25rZXkudXNlcnN5cy5yZWRoYXQuY29tfGNvbmR1Y3Rvcl9rZXl8OTUzODkwNTgyMDY5NTE3MDk0NDQxNzgxNzY3MTkxNzA5NDg4MzU5NTQ5NDg4MTgw[root@10-16-120-210
~]#

The data stays encoded as entered.

Created an instance without encoded data (testInstanceNE)

    ssh root.120.176
    root.120.176's password:
    [root@10-16-120-176 ~]# /sbin/modprobe floppy; lsmod | grep floppy
    floppy                 61511  0
    [root@10-16-120-176 ~]# /bin/mount /dev/fd0 /media; cat
/media/deltacloud-user-data.txt
   
1|https://deaddonkey.usersys.redhat.com|conductor_key|xxxx[root@10-16-120-176
~]#

The data stays not encoded - in its original form

    rpms tested:

    rpm -qa |grep deltacloud
    deltacloud-core-vsphere-0.5.0-5.el6.noarch
    deltacloud-core-ec2-0.5.0-5.el6.noarch
    deltacloud-core-rhevm-0.5.0-5.el6.noarch
    deltacloud-core-0.5.0-5.el6.noarch
    rubygem-deltacloud-client-0.5.0-2.el6.noarch

    [root@hp-dl360g5-02 ~]# rpm -qa |grep aeolus
    aeolus-configure-2.5.0-12.el6.noarch
    aeolus-all-0.8.0-23.el6.noarch
    rubygem-aeolus-cli-0.3.0-7.el6.noarch
    aeolus-conductor-0.8.0-23.el6.noarch
    aeolus-conductor-daemons-0.8.0-23.el6.noarch
    aeolus-conductor-doc-0.8.0-23.el6.noarch
    rubygem-aeolus-image-0.3.0-7.el6.noarch

Comment 5 Michal Fojtik 2012-02-08 17:04:33 UTC
Guys, I just checked DC driver and there was *no* change related to encoding/decoding past few weeks. If this issue appeared few days ago/yesterday, maybe there is some other issue which triggers double encoding. Maybe worth to look into Conductor as well.

Comment 6 chris alfonso 2012-02-09 14:07:04 UTC
I have add the vdsm-floppyinject-hook source to github, https://github.com/calfonso/vdsm-hook-floppyinject for now.  I've added a patch that decodes the content before it's written to the floppy file.  I'll work with someone on the audrey team to test it out. I'll add an update with the results.

Comment 7 chris alfonso 2012-02-09 16:32:12 UTC
Created attachment 560645 [details]
patched to base64 decode file contents

Attaching the rpms for a patched vdsm-hook-floppyinject.

Comment 8 dgao 2012-02-09 17:37:56 UTC
Decoding in vdsm-hook-floppyinject works, audrey agent is now happy.



>>> import base64
>>> line = open('/media/deltacloud-user-data.txt', 'r').read().strip()
>>> dl = base64.b64decode(line)
>>> len(dl.split('|'))
4
>>> dl
'1|https://deaddonkey.usersys.redhat.com|b8a7f2de-5342-11e1-a949-001320f3f0c5|rCxUQpeJzhftqgbw7pu6v6EkYvN5iJpeSD7p5khXNo8'

2012-02-09 12:23:55,672 - INFO    : audrey:1293 Invoked audrey_script_main
2012-02-09 12:23:56,023 - INFO    : audrey:1321 
<Instance of: CSClient
	Version: 1
	Config Server Endpoint: https://deaddonkey.usersys.redhat.com
	Config Server oAuth Key: b8a7f2de-5342-11e1-a949-001320f3f0c5
	Config Server oAuth Secret: rCxUQpeJzhftqgbw7pu6v6EkYvN5iJpeSD7p5khXNo8
	Config Server Params: 
	Config Server Configs: 
	Temporary Directory: 
	Tarball Name: 
eot>
2012-02-09 12:23:56,038 - INFO    : audrey:944 Invoked CSClient.get_cs_tooling()
2012-02-09 12:23:56,237 - INFO    : audrey:682 Invoked unpack_tooling()
2012-02-09 12:23:56,243 - INFO    : audrey:901 Invoked CSClient.get_cs_configs()
2012-02-09 12:23:56,471 - INFO    : audrey:612 Execute Tooling command: /var/audrey/tooling/user/proxy1/start
2012-02-09 12:23:56,471 - INFO    : audrey:612 return code: 0
2012-02-09 12:23:56,471 - INFO    : audrey:612 
	Start Output of: /var/audrey/tooling/user/proxy1/start >>>

PROGNAME ***   ***   ***   ***   ***   ***
PROGNAME: /var/audrey/tooling/user/proxy1/start

pwd ***   ***   ***   ***   ***   ***
/var/audrey/tooling/user/proxy1

args ***   ***   ***   ***   ***   ***

printenv ***   ***   ***   ***   ***   ***
AUDREY_VAR_proxy1_proxy_server_1_param_1=a
AUDREY_VAR_proxy1_proxy_server_1_param_2=b
AUDREY_VAR_proxy2_proxy_server_1_param_1=c
AUDREY_VAR_proxy2_proxy_server_1_param_2=dd

	<<< End Output
2012-02-09 12:23:56,481 - INFO    : audrey:612 Execute Tooling command: /var/audrey/tooling/user/proxy2/start
2012-02-09 12:23:56,482 - INFO    : audrey:612 return code: 0
2012-02-09 12:23:56,482 - INFO    : audrey:612 
	Start Output of: /var/audrey/tooling/user/proxy2/start >>>

PROGNAME ***   ***   ***   ***   ***   ***
PROGNAME: /var/audrey/tooling/user/proxy2/start

pwd ***   ***   ***   ***   ***   ***
/var/audrey/tooling/user/proxy2

args ***   ***   ***   ***   ***   ***

printenv ***   ***   ***   ***   ***   ***
AUDREY_VAR_proxy1_proxy_server_1_param_1=a
AUDREY_VAR_proxy1_proxy_server_1_param_2=b
AUDREY_VAR_proxy2_proxy_server_1_param_1=c
AUDREY_VAR_proxy2_proxy_server_1_param_2=dd

	<<< End Output
2012-02-09 12:23:56,482 - INFO    : audrey:916 Invoked CSClient.get_cs_params()
2012-02-09 12:23:56,678 - INFO    : audrey:520 Invoked generate_provides()
2012-02-09 12:23:57,254 - INFO    : audrey:931 Invoked CSClient.put_cs_params_values()
[root@10-16-120-196 ~]#

Comment 9 errata-xmlrpc 2012-05-15 20:32:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0587.html


Note You need to log in before you can comment on or make changes to this bug.