Rusoto: CloudFront ListDistributions fails to parse response

Created on 20 Feb 2018  路  6Comments  路  Source: rusoto/rusoto

The response always is empty. It seems to be because a mismatch between the ListDistributions schema in botocore and the actual xml response. Doesn't seem to affect boto though, but rusoto parsing has problems with it.

Here is a test that shows the problem and a very ugly workaround: https://github.com/ramn/rusoto/tree/cloudfront-hack

Medium bug help wanted

All 6 comments

So the issue looks to be that the response XML hiearachy is off by one.

If you look at an EC2 response for example, DescribeAddresses, it looks like this:

<DescribeAddressesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
   <addressesSet> 
...
   </addressesSet> 
</DescribeAddressesResponse>

However for cloudfront ListDistributions:

<?xml version="1.0" encoding="UTF-8"?>
<DistributionList>
  <Items>
   ..
</DistributionList>

The ListDistributionsResultDeserializer class is looking for the DistributionList block, but we're already past that block a level down, so it's just finding the Items (and other blocks) and returning an empty result.

The payload flag is set which the code indicates should be aware of this, but in my testing it seems like this isn't working as intended here.

I wonder if this is fixed in https://github.com/rusoto/rusoto/pull/1196 , which is now in master.

We are in dire need of tests :)

I added a test! 馃帀 https://github.com/rusoto/rusoto/pull/1201 shows this now appears to work. 馃槃

(edit) I checked out the 0.35.0 release's version of CloudFront code and it did not pass the new unit test, so I think this one is now working. 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewkmayer picture matthewkmayer  路  4Comments

meghashyam6 picture meghashyam6  路  6Comments

matthewkmayer picture matthewkmayer  路  5Comments

pantaloons picture pantaloons  路  4Comments

kaushalyap picture kaushalyap  路  4Comments