getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.66k stars 2.05k forks source link

nodejs @aws-sdk returns error Unable to parse boolean value "True" #8221

Closed eranbo closed 1 month ago

eranbo commented 1 month ago

Hi, I'm getting error when trying to call describe-db-instances/create-instance.

I'm using nodejs and @aws-sdk/client-ec2, @aws-sdk/client-rds both version is: 3.668.0 (the latest for the time written this bug).

For example the code I'm using is:

    const client = new RDSClient({endpoint:'http://localhost:5000'});
    const command = new DescribeDBInstancesCommand({});
    const res = await client.send(command);

I'm running moto as a container using this command: docker run --rm -p 5000:5000 --name moto motoserver/moto:latest

I'm getting this error:

Error: Unable to parse boolean value "True"
  Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.

When using aws-cli tool from terminal, everything works fine.

bblommers commented 1 month ago

Hi @eranbo, welcome to Moto! I've raised a PR that should fix this.

eranbo commented 1 month ago

Hi @bblommers Thank you !!!

I see the PR fixes models.py under RDS. the same issue occur when trying to create an EC2 instance:

        const client = new EC2Client({endpoint:'http://localhost:5000'});

        const command = new RunInstancesCommand({
            InstanceType: 't2.nano',
            ImageId: 'ami-0001',
            MinCount: 1,
            MaxCount: 1,
        });

        const { Instances } = await client.send(command);

For example.

bblommers commented 1 month ago

Thank you for letting us know @eranbo - I've updated the PR to fix EC2 instances as well. Please let us know if you run into any other issues after the next release.

eranbo commented 1 month ago

Thanks again @bblommers - much appreciated.

Is there a known schedule for releases? What is the ETA for the fix?

bblommers commented 1 month ago

Hi @eranbo, there is no fixed schedule, but usually every other two weeks. I just released 5.0.17.

eranbo commented 1 month ago

Got it. Thanks @bblommers