May 04, 2017 04:02 AM
As far as I can tell I aways get nice JSON responses, but with this error the response comes in the form of a HTML page. My error handling didn’t like that.
<!DOCTYPE html> <html> <head> etc <h1 class="my2">This page is taking too long to load.</h1>
Is this intentional?
May 04, 2017 10:10 AM
No, it shouldn’t be like that. What client language/library are you using? Do you have the headers that you are sending? What’s in the content-type and accept headers?
May 04, 2017 11:37 AM
The hard part is that it almost never happens of course, so it’s difficult to reproduce.
I’ll be back when I have more…
May 04, 2017 01:19 PM
What are those headers for regular requests?
May 04, 2017 11:52 PM
Generally Authorization & Content-Type (application/json) for Post / Patch (HTTP 1.1).
The reason I was asking is that I have a feeling it is related to attachments / photos fields and server-side time-outs only. So I was figuring it might have been some sort of internal error forwarding that’s not converted or something.
But the problem might just as well be me too of course. :slightly_smiling_face:
May 05, 2017 12:12 AM
Anyway, I’ve added the Accept (application/json) now too. I’ll be back…
May 05, 2017 01:04 AM
So rethinking about this all; you probably take my content type header for post & patch as the default for your response and since that hint is missing for the other requests (specifically ‘get’) I get HTML?
May 05, 2017 09:34 AM
Yeah, that’s probably it. We only look at content-type and if it’s not set, you’d get HTML. GET requests may or may not include content-type as it should be sending no content. There was a recent patch for that to airtable.js.
I think we’ll need to change it to just never return HTML for api.airtable.com. Our API always returns JSON anyway.
May 05, 2017 09:46 AM
I was lazily assuming that. And never noticed until I got timed out (which almost never happens).
Anyway, learned a couple of new things. Thanks for the help!
May 25, 2017 01:38 AM
After adding the Accept header (to application/json) I’m still getting HTML with 504’s & 502’s. The weird thing is that sometimes the 502’s come in JSON. I’ve already double checked my code, but I’m pretty sure my calls are consistent.
Since these are both time-out errors could it be something in the processing (order?) on your side or can I try other headers / combinations?
<h1 class="my2">This page is taking too long to load.</h1> <h3 class="quiet">Sorry about that. Please try refreshing and contact us if the problem persists.</h3>
May 25, 2017 01:44 AM
I’ve noticed the order of setting the headers in my code is not consistent. Can’t phantom that could be a problem, but I’ve changed it anyway.
Jul 16, 2017 11:58 PM
Small update: it’s still happening. And the exact same request is getting a JSON response with error 500 and HTML with a 504 so I think it’s something on your side…
Since these are all time out related maybe processing the response is not 100% completed as well?
Just FYI… :slightly_smiling_face:
Jul 17, 2017 05:00 AM
Additional info: going through my log files I also found empty responses and a couple of
All with status 504.
Aug 23, 2017 08:33 PM
I’ve long suspected something like this. I get strange errors when I create sync scripts that depend on results from Airtable. I have error handling coded in, however it seems that at times I get a result that isn’t an error yet isn’t expected content. Anyway, just chiming in so that I get pinged on updates to this thread. I guess I need to dial in my response-error-checking some more. Thanks Tuur for digging deeper!
Aug 24, 2017 12:01 AM
My pleasure. :slightly_smiling_face: