Open victorquinn opened 9 years ago
More details:
aws cloudfront list-distributions
with the same AWS credentials I am using for Stout and it works fine, returning all the information on my Cloudfront distributionsOk bit more progress, definitely an XML decoding issue in the goamz module.
In addition to throwing the error on line 625 in cloudfront.go as I referenced in my last comment when the XML is being decoded (strconv.ParseInt: parsing "": invalid syntax
), when I inspect the distributions it got from the decoder it only has the first distribution whereas I actually have 14 distributions returned in the XML.
Trying to figure out what about my Cloudfront distributions could have caused issues with it, we don't have anything unorthodox that I'm aware of.
I'd open an issue on the goamz module but that fork appears to be only used here...
Hey @victorquinn,
We don't use the official AWS Go library only because our use of goamz predates its release. Any chance you can post the XML it's trying to decode? In particular we are looking for something which is an int in the struct (like this, this or this) but is either blank or not included in the XML text.
Hi @zackbloom thanks for ringing in.
Don't feel comfortable posting it (as it includes some sensitive company information), but happy to send it to you directly for analysis. I'm looking myself and haven't been able to see anything out of the ordinary.
Everything in the structs which should be an int is an int in the XML that I can see. It's 1300 lines of XML so it's taking some time to go through every possibility.
With the addition of some println statements in the goamz module, isolated that it's throwing the error trying to decode the CustomErrorResponses
chunk.
It appears that one of my Cloudfront distributions has CustomErrorResponse items with a blank ResponseCode
tag whereas the goamz struct which corresponds to it expects that to be an int. See my attached screenshot:
Yup, confirmed, it was CustomErrorResponse
.
I didn't actually need those so I went into Cloudfront and removed all of them and re-ran it and everything works perfectly now.
Should update the goamz fork to allow Cloudfront distributions with Custom Error Responses because I suspect not all organizations will be able to just delete them in order to get Stout to run.
Should be fixed by https://github.com/EagerIO/Stout/commit/2822cca845e7032f25c3fbeb8f51265c395eca44 as it replaces the goamz/cloudfront package with the official AWS Go SDK.
Screenshot:
I dug into it a bit, appears this error is coming from the goamz module Stout uses under the hood when it tries to fetch the Cloudfront information. It appears to be attempting to deserialize XML which isn't valid XML and it barfs.
Side note: Any reason Stout isn't using the official AWS Go library?
Will continue to investigate and update here as this makes Stout unusable for me, can't even create a site.