User data is not parsed correctly by Eucalyptus in some cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Eucalyptus |
Fix Released
|
High
|
chris grzegorczyk | ||
Release Notes for Ubuntu |
Fix Released
|
Undecided
|
Scott Moser | ||
ec2-init (Ubuntu) |
Invalid
|
High
|
Scott Moser | ||
Karmic |
Invalid
|
High
|
Scott Moser | ||
euca2ools (Ubuntu) |
Fix Released
|
High
|
Thierry Carrez | ||
Karmic |
Fix Released
|
High
|
Scott Moser | ||
eucalyptus (Ubuntu) |
Fix Released
|
High
|
Dustin Kirkland | ||
Karmic |
Fix Released
|
High
|
Thierry Carrez |
Bug Description
User data supplied using "euca-run-instances --user-data-file" is not decoded before being presented to the instance.
Inside the instance, "curl http://
EC2 documentation at http://
"The user data must be base64-encoded before being submitted to the API. The API command-line tools perform the base64-encoding for you. The data will be base64 decoded before being presented to the instance."
=================
SRU Report (eucalyptus, euca2ools):
Impact: This bug makes userdata unusable in cloud images used withing UEC. userdata is used for a lot of things, in particular boot-time configuration of our cloud images. This works within EC2 but not within UEC, due to this bug.
This requires a fix in euca2ools (do not b64_encode twice). But fixing it in euca2ools triggers a bug in eucalyptus when certain userdata is received (the previous bug was protecting eucalyptus from this), so this needs a eucalyptus update as well.
Fix in development release: This was fixed in lucid in eucalyptus (1.6.1~
Minimal patch for eucalyptus:
http://
Minimal patch for euca2ools:
--- euca2ools-
+++ euca2ools-
@@ -170,8 +170,6 @@
user_data = read_user_
- if user_data:
- user_data = base64.
euca_conn = euca.make_
try:
TEST CASE:
euca-run-instances -k $MYKEY --user-data " << FOO >" $EMI -t c1.medium
ssh -i $MYKEYPRIV ubuntu@$IP 'wget -q http://
Expected results: should return " << FOO >"
Fails with affected euca2ools and eucalyptus (returns "IDw8IEZPTyA-" instead of " << FOO >")
Succeeds with proposed euca2ools and proposed eucalyptus.
Regression potential:
The regression potential is small, since userdata is not really usable right now. In euca2ools, only someone relying on the bug (and base64_decoding the userdata in the cloud image itself) would be affected. Regression potential is slightly higher on eucalyptus side, since the fix is about escaping special characters in userdata. Careful testing with various userdata strings (to hit the special characters in the urlsafe-
=================
Karmic release notes:
user-data not usable by guest instances
Starting an instance with euca-run-instances and user-data (either using the -d, --user-data option or the -f, --user-data-file option) will store the user data in base64 encoding. Accessing the user data from the instance at http://
==================
Related branches
Changed in eucalyptus (Ubuntu): | |
importance: | Critical → High |
milestone: | none → ubuntu-9.10 |
tags: | added: uec-images |
Changed in eucalyptus (Ubuntu Karmic): | |
status: | Confirmed → Triaged |
Changed in ec2-init (Ubuntu Karmic): | |
status: | Confirmed → Invalid |
Changed in eucalyptus (Ubuntu Karmic): | |
milestone: | ubuntu-9.10 → karmic-updates |
Changed in euca2ools (Ubuntu Karmic): | |
milestone: | none → karmic-updates |
Changed in eucalyptus (Ubuntu Karmic): | |
milestone: | karmic-updates → none |
Changed in euca2ools (Ubuntu Karmic): | |
assignee: | nobody → Scott Moser (smoser) |
status: | Triaged → In Progress |
Changed in ec2-init (Ubuntu Karmic): | |
milestone: | ubuntu-9.10 → none |
Changed in ubuntu-release-notes: | |
assignee: | nobody → Scott Moser (smoser) |
Changed in ubuntu-release-notes: | |
status: | New → Confirmed |
description: | updated |
Changed in ubuntu-release-notes: | |
status: | In Progress → Fix Committed |
Changed in eucalyptus: | |
assignee: | nobody → chris grzegorczyk (chris-grze) |
tags: | added: uec |
Changed in eucalyptus (Ubuntu): | |
assignee: | Dustin Kirkland (kirkland) → Thierry Carrez (ttx) |
milestone: | karmic-updates → none |
Changed in eucalyptus (Ubuntu Karmic): | |
assignee: | Dustin Kirkland (kirkland) → Thierry Carrez (ttx) |
Changed in euca2ools (Ubuntu): | |
milestone: | karmic-updates → none |
tags: | added: eucalyptus |
Changed in eucalyptus: | |
status: | Confirmed → Incomplete |
Changed in eucalyptus (Ubuntu Karmic): | |
status: | Confirmed → In Progress |
Changed in eucalyptus (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in eucalyptus (Ubuntu): | |
assignee: | Thierry Carrez (ttx) → Dustin Kirkland (kirkland) |
description: | updated |
description: | updated |
Changed in euca2ools (Ubuntu): | |
assignee: | Scott Moser (smoser) → Thierry Carrez (ttx) |
Changed in eucalyptus (Ubuntu Karmic): | |
status: | In Progress → Fix Committed |
Changed in euca2ools (Ubuntu Karmic): | |
status: | In Progress → Fix Committed |
Changed in eucalyptus: | |
status: | Fix Committed → Fix Released |
Confirming this: instances 26T15:21: 07.472Z sm-zone-1a eki-3EE316B1 eri-225F1633 192.168. 1.192 'wget -q http:// 169.254. 169.254/ latest/ user-data -O -'; echo jaG8gaGVsbG8gd2 9ybGQK
$ printf "%s\n%s\n" '#!/bin/sh' 'echo hello world" > /tmp/user-data.sh
$ euca-run-instances -k mykey --user-data-file /tmp/user-data.sh emi-220011A6 -t m1.small
$ euca-describe-
RESERVATION r-342805FE admin default
INSTANCE i-3BB70743 emi-220011A6 192.168.1.192 172.19.1.2 running mykey 0 m1.small 2009-10-
$ ssh -i mykey.priv ubuntu@
IyEvYmluL3NoCmV
The above should show plaintext. -0ubuntu1 java-common 1.6~bzr931-0ubuntu7
$ dpkg-query --show "euca*"
euca2ools 1.0+bzr20091007
eucalyptus-cc 1.6~bzr931-0ubuntu7
eucalyptus-cloud 1.6~bzr931-0ubuntu7
eucalyptus-common 1.6~bzr931-0ubuntu7
eucalyptus-gl 1.6~bzr931-0ubuntu7
eucalyptus-
eucalyptus-javadeps
eucalyptus-sc 1.6~bzr931-0ubuntu7
eucalyptus-walrus 1.6~bzr931-0ubuntu7