当前位置: 动力学知识库 > 问答 > 编程问答 >

amazon web services - Invalid BASE64 encoding of user data in boto3

问题描述:

I am making a spot instance request in boto3, the user data is first compressed using bz sompression and then encoded in base64.

base64.b64encode(bz2.compress(user_data, 10)). I get the following error while making the request -

ClientError: An error occurred (InvalidParameterValue) when calling the RequestSpotInstances operation: Invalid BASE64 encoding of user data

I have seen the related question, AWS Boto3 BASE64 encoding error thrown when invoking client.request_spot_instances method. The answer is to decode it to ascii, I am still getting the above error. According to the answer user_data = user_data.decode("ascii") should work . Is there any other way to pass the user_data?

分享给朋友:
您可能感兴趣的文章:
随机阅读: