AWS Thinkbox Discussion Forums

Spot Event Configuration Utility error message

Hi I am trying to create a spot event configuration using the Quick Create option (instead of doing things via the AWS console and copying the json to the spot plugin event manually)

Everything seems ok except when i try and add User Data i get an error message when i try and save (press modify) it.

See the attached error.

Any idea why this is happening?

The user data is not base64 encoded when i paste it into the utility. There is no issue with the user data as it can be added fine if i just want to do things manually by creating a json file via the console instead.

I was hoping to use Deadline Spot Event configuration utility instead of going to the aws console but this error is preventing me from doing so.

Using Deadline



I’m not an advanced python user, so hopefully a pipeline/dev person will know the solution.

At first glance it looks like a python2 vs python3 issue – it’s expecting type str not bytes for the base64 encoding/decoding?

UserData (string) needs to be base64 encoded. When you use the aws console it is automatically base64 encoded for you.

I tried feeding it base64 encoded user data but it still gave the same error message.

As a test, copy this file scripts/General/ to the “custom” structure: custom/scripts/General/ . And modify the line (see below).

Disclaimer: not responsible if it barfs

around line 2179:
return base64.b64encode(userDataBytes)

change to:
return base64.b64encode(userDataBytes).decode('ascii')

I did a quick test this afternoon using Quick Create and I got the same error message. I then modified the script and it seemed to work (it gave me a spot fleet request in the aws console), but I didn’t actually use it to see if it launched the spot fleet.

Ah ok thanks!. I will give this a try and let you know!!



Hi @jarak

So tried this and even though it does not throw an error when adding the user data, it does not seem to actually apply the user data to the configuration. If i add it, save(modify) and then reopen the config to view it, no user data is there.

I will open a support ticket and see if the devs are able to review.



Hi Richard,

Yes, hopefully the devs will be able to fix it. I think once everything gets ported to python3/removed all the py2 bits, things will be smoother (again, hopefully)!

I forgot to write that we are using DL – we haven’t updated to yet so could not check if this was fixed in that release or not.

FWIW, I looked at the test cfg json file that was generated (via right-click cfg name → “Open in Advanced Create”) and saw UserData was populated. e.g.:

"ImageId": "ami-0000000123456789",
"InstanceType": "g5.8xlarge",
"KeyName": "myKey",
"SubnetId": "subnet-046159b32ea1ef, subnet-0b704a007ef043, subnet-0e4ce7426dfed5, subnet-0842c2b7d554e1, subnet-082137f07b710f",
"UserData": "I2Nsb3VkLWNvbmZpZwoKcnVuY21kOgoKIC0gc3VkbyB0b3VjaCAvZXRjL3Byb2ZpbGUuZC9saWNlbnNlX3BvcnRzLnNoCgogLSBzdWRvIGNobW9kIDc3NyAvZXRjL3Byb2ZpbGUuZC9saWNlbnNlX3BvcnRzLnNoCgogLSBzdWRvIHRvdWNoIC9ldGMvcHJvZmlsZS5kL2Vudl92YXJzLnNoCgogLSBzdWRvIGNobW9kIDc3NyAvZXRjL3Byb2ZpbGUuZC9lbnZfdmFycy5zaAoKCgogLSAvZXRjL3Byb2ZpbGUuZC9saWNlbnNlX3BvcnRzLnNoCgogLSAvZXRjL3Byb2ZpbGUuZC9lbnZfdmFycy5zaAoKIC0gL2V0Yy9wcm9maWxlLmQvdnJheV9zZXJ2ZXJzLnNo"


Hmm when i tested i even tried opening in advance create and still did not see any user data added. I will check again. Thanks.

Devs have responded to me and they are looking into it. I will update this thread if resolved for others to see.



Just fyi, this got resolved with the devs. If anyone else has this issue, attached is the updated script that you can place in custom/scripts/General/

Hopefully AWS will implement the fix into their next release out of the box. (130.6 KB)

Privacy | Site terms | Cookie preferences