Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use URL safe Base64 encoding for user data #50

Merged

Conversation

petrhosek
Copy link
Contributor

Older version of CloudStack may complain about non-printable ASCII
characters in user data unless URL safe Base64 encoding is used.

Older version of CloudStack may complain about non-printable ASCII
characters in user data unless URL safe Base64 encoding is used.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fd4e9b2 on petrhosek:use_urlsafe_base64_encoding into 98012fc on klarna:master.

@lndbrg
Copy link
Contributor

lndbrg commented Jun 25, 2014

@petrhosek what versions does this apply to?

@lndbrg
Copy link
Contributor

lndbrg commented Jun 25, 2014

This is probably the correct way to do it. We need to make sure this works with the current release of cloudstack and hopefully be future proof. This this also work with newer cloudstack versions?

@petrhosek
Copy link
Contributor Author

This was tested against 4.1.1 which is also the version that fails with the current implementation. Unfortunately I don't have access to newer versions, but in general I believe this is the correct way as we are sending these arguments in URL.

@mindjiver
Copy link
Contributor

@petrhosek We are running 4.3.x internally so we should be able to test it out(?)

@lndbrg
Copy link
Contributor

lndbrg commented Jun 25, 2014

If it works, it will get merged for the next release.

@lndbrg
Copy link
Contributor

lndbrg commented Jun 30, 2014

@petrhosek could you provide us with a minimal Vagrantfile that is broken with the current code, but works with your code? That would be aweome!

@lndbrg
Copy link
Contributor

lndbrg commented Aug 19, 2014

LET'S GO!

lndbrg added a commit that referenced this pull request Aug 19, 2014
Use URL safe Base64 encoding for user data
@lndbrg lndbrg merged commit 0705d0f into MissionCriticalCloud:master Aug 19, 2014
@petrhosek
Copy link
Contributor Author

I'm sorry about the delay, I had to wait till my pull requests were merged into CoreOS, which only happened yesterday, since this is where I was experiencing the issue. I've created a reproducer which consists of a Packer template that builds a CloudStack template which is then used in the Vagrantfile that triggers the issue. Please note that you need to use @mindjiver's version of Packer which has the CloudStack support.

I have tested this against CloudStack versions 4.1.1 and 4.2.1 and experienced the issue in both versions, i.e. without urlsafe_encode64 I'm getting the following error when trying to bring up the machine:

There was an error talking to Cloudstack. The error message is shown
below:

Received value I2Nsb3VkLWNvbmZpZwoKY29yZW9zOgogICAgZXRjZDoKICAgICAgICBkaXNj
b3Zlcnk6IGh0dHBzOi8vZGlzY292ZXJ5LmV0Y2QuaW8vYmVjYTMyMzkyOGNl
MmU1YzYxNTFjMjFjMmQzM2MwNDYKICAgICAgICBhZGRyOiAkcHVibGljX2lw
djQ6NDAwMQogICAgICAgIHBlZXItYWRkcjogJHB1YmxpY19pcHY0OjcwMDEK
ICAgICAgICAKICAgIHVuaXRzOgogICAgICAtIG5hbWU6IGV0Y2Quc2Vydmlj
ZQogICAgICAgIGNvbW1hbmQ6IHN0YXJ0CiAgICAgIC0gbmFtZTogZmxlZXQu
c2VydmljZQogICAgICAgIGNvbW1hbmQ6IHN0YXJ0Cg==
 for parameter userdata is invalid, contains illegal ASCII non-printable characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants