Skip to content


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

labisso opened this Issue · 0 comments

2 participants

Nimbus member

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:

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
@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
@priteau priteau was assigned
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.