Skip to content
This repository

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

Closed
labisso opened this Issue July 30, 2012 · 0 comments

2 participants

David LaBissoniere Pierre Riteau
David LaBissoniere
Collaborator

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.

Pierre Riteau priteau closed this issue from a commit August 01, 2012
Pierre Riteau 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.
621b9bb
Pierre Riteau priteau closed this in 621b9bb August 01, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.