I have a few sheets that track attendance and performance, and they’ve worked in legion until last night. Anyone else having problems with API pulls?
What’s going wrong?
I narrowed it down to my “var report =
JSON.parse(reportJSON.getContentText())” type lines. When I reload the
pull, most of the time it works. I’m just getting way more failures than
I’ve ever gotten. I don’t know why though, because it’s actually always
worked very well.
“SyntaxError: Unexpected token: <(line #).”
Need more details. Which API specifically is failing and what does the JSON look like that you get back?
I use Power Query in Excel to pull the API data and am getting an error: Details: “We found extra characters at the end of JSON input.”
I need an actual example guys.
var reportJSON = UrlFetchApp.fetch(“
var report = JSON.parse(reportJSON.getContentText());
You think it might be because I’m not adding any kind of wait in between
those two lines? Have I just been lucky up until now? haha. Btw, thanks
for all the work you put into this. I love being able to pull all of this
information and play with it.
I refreshed this twice and then got the actual data on the second try.
Can you paste in the link without your key? Thanks.
We probably have separate issues, and mine is exclusive at this point to pulling the data through power query in Excel. I used report/events without issue, but when I used report/fights I got the error: “DataFormat.Error: We found extra characters at the end of JSON input.”
Should say that I’m not having issues getting the data with DHC for either call.
Ok, I can at least stop the exception, and then we can see what’s really going on.
Solved my issue (I think). Just stopped using https and used http and it started working (with other “fights” reports). Thanks much for the quick attention.
HTTP just redirects to HTTPS, so probably just getting lucky. Something is definitely weird here… I suspect this is a bug with PHP7 move.
This is a PHP7 regression. json_decode is now failing on the fights JSON. All the validators I try this on say it’s fine though, so I’m really confused. Reading online, it does sound like PHP7 replaced json_decode’s implementation with a new one, so this is definitely the problem.
Even weirder is that it intermittently succeeds.
This appears to be a bug in PHP7 with memcached. Compressed values in the cache contain garbage characters when uncompressed.
I have switched all report-related caching over to redis with compression off until I can test if compression in redis has similar issues.
Everything seems to be working now. Thanks!