Query API doesn't allow newlines in Base64-encoded userdata #110

labisso opened this Issue Jul 31, 2012 · 0 comments


None yet

2 participants

labisso commented Jul 31, 2012

Userdata included in RunInstances requests must be Base64-encoded, according the the EC2 API. Some base64 encoders (notably openssl) include newlines to break the output into lines. Nimbus does not allow newlines in the encoded data, but EC2 apparently does.

Nimbus validates the userdata here: https://github.com/nimbusproject/nimbus/blob/master/messaging/gt4.0-elastic/java/msgbridge/src/org/nimbustools/messaging/gt4_0_elastic/v2008_05_05/rm/defaults/DefaultRun.java#L195

I was able to reproduce this using boto, but had to step into the internals a bit as boto does its own base64 encoding:

params = {'ImageId': "theimage",
        'MinCount': 1,
        'MaxCount': 1,
        'UserData': base64_data_with_newlines}
ec2conn.get_object('RunInstances', params, Reservation, verb='POST')

Thanks to Anthony Tiradani for the bug report.

@priteau priteau added a commit that closed this issue Aug 1, 2012
@priteau priteau Remove CR/LF characters from Base64 userdata string
Some Base64 implementations delimit encoded data with newlines.
Unfortunately, the isBase64 function of Globus does not support them.
Remove them prior to calling this function.

Closes #110.
@priteau priteau closed this in 621b9bb Aug 1, 2012
@priteau priteau was assigned Aug 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment