Help

Re: Random 404 responses from airtable api

Solved
Jump to Solution
7789 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Paul_Kortman
6 - Interface Innovator
6 - Interface Innovator

For the last couple of weeks, I’ve been getting new 404 errors on API calls that used to work perfectly every time.

The API calls run every 5 minutes or so, and 90% of the time it works great, but now 10% of the time I’m getting back an error that says the table cannot be found. This is crazy as the table remains and in just a few seconds/minutes when the next webhook runs it will find the table and run correctly.

These 404s are causing significant problems, especially when I’m testing for a record and I get back a 404 my script thinks the record does not exist… but that’s not true. In my oponion this should be more of a 500 level server error.

Here’s the calls I’m making and the errors I’m receiving:Screenshot 2019-10-02 17.16.12.png Screenshot 2019-10-02 17.19.36.png

(yes these are from Zapier, and yes I had to spoof the user-agent to make it work)

I’m calling https://api.airtable.com/v0/appU29NNGxB8qigRN/Main%20Table
I get a 404, “We made a request to api.airtable.com and received (404) Not Found.” Specifically saying:
“Could not find table Main Table in application appU29NNGxB8qigRN”

I reached out to airtable support and their response was: “It looks like the GET request looks identical so we can’t see any reason why one returns a 200 and one returns the 404. I would recommend posting in the Airtable Community Forum specifically in the API section.”

So here I am posting here, hoping that someone can point me in the right direction since airtable support cannot seem to?

1 Solution

Accepted Solutions
Paul_Kortman
6 - Interface Innovator
6 - Interface Innovator

Update from my side on this… a Zapier engineer discovered that I was using user-agent in my webhook header and not User-Agent the capitalized version would overwrite the default User-Agent:"Zapier" whereas the lower case would be sent along with the default upper case.

We did see that the headers are sent in somewhat of a random order each time, so sometimes when two “user-agent” headers were sent the User-Agent:"Zapier" would go first, sometimes thw user-agent:"postman" would go first, thus the randomness.

Our guess is that airtable took the first one (regardless of capitalization) and would opperate that way.

So it is my fault for not capitalizing the U and the A… but also Zapier’s fault for sending headers in a random order, and they couldn’t explain why that happens.

Thanks for your help in diagnosing this problem!

See Solution in Thread

36 Replies 36

Hi Paul - welcome to the forum!

I have seen this, although, I can’t say specifically with Airtable. So here’s my hunch with two bets whose causes may be related …

#1 404 errors are notoriously ambiguous because API designers tend to use them as a default result when nothing else seems appropriate. My hunch is this is not really a 404 - it’s some other issue huddling under the umbrella of a 404 response.

#2 Intermittent API errors (of any type) can be triggered when the deployment of updates to web services fail to entirely complete. Imagine an API instance that hasn’t completely terminated and restarted following a significant update. Now you have new calls using new features occasionally hitting an old (residual) instance of the service.

Forensics into the response headers could provide more clarity regarding #1. But let’s be clear - imagine Airtable does respond with 404’s for errors that are not really discrete. Imagine your Zap is expecting data in a specific field and there is none (10% of the time). Is Zapier creating the ambiguity, or is it Airtable? Using Zapier is akin to wrapping an API in another API. What could go wrong? :winking_face:

#2 suggests Airtable has an issue.

If the cause were #2, one would ask - is this pervasive across the universe of all API apps? I don’t think the community is seeing this (at this time), but we can’t be certain because many API integrations do not require the precision that your solution needs and most are likely written to fail and recover gracefully.

Typically, I will develop a solution with the anticipation that various 400-class responses will occur from time-to-time and I instrument them to perform three automatic retries. I make this extra effort because the Interweb is an inconsistent cesspool of inter-disconnectedness.

My money is on #1 - either the 404 is not really a 404, or Zapier is somehow misinterpreting the true error, or Zapier is giving you an ambiguous response on its own.

EvanHahn
6 - Interface Innovator
6 - Interface Innovator

Developer on Airtable’s API team here.

For what it’s worth, we basically only return 404s in two cases:

  1. the resource you’re fetching is missing. For example, if we can’t find the table, or the base, or the record, or whatever.
  2. the URL you’re hitting is totally bogus. For example, a request to api.airtable.com/v0/garbage will return a 404.

It’s strange that you’re seeing this error intermittently, and nothing immediately comes to mind about why this would be failing. Any additional information you can provide is helpful. Things like:

  1. are there any other collaborators who might be changing the name of the table and then changing it back? Probably not, based on what you described, but want to double-check.
  2. does it happen on a pattern? For example, does it happen every 5 times, or every 10 minutes, or something like that?
  3. is your base over any limits?
  4. are you able to reproduce this by making similar requests yourself, perhaps using Postman or curl?

I’d love to get to the bottom of this, because it sounds spooky.

Paul_Kortman
6 - Interface Innovator
6 - Interface Innovator

Thank you for your response Evan, I was a little disappointed in Bill’s response, so hopefully with your help we can get to the bottom of this!

Additional information:

  1. There are other collaborators, but they are not changing the names of the tables. To be clear the error is always about the table being not found I’m looking for records (which are there) inside the table and it’s saying the table is not found.
  2. I’ll look into the pattern idea, it’s difficult because the webhook runs very frequently and only 10% of the time (that’s a gut feeling) does it fail … more below.
  3. It is getting close to Attachment space limits but it still has 6 GB. Are there other places I should look for limits to the base: https://www.dropbox.com/s/0l2w61cy1y8852v/Screenshot%202019-10-03%2011.07.10.png?dl=0 Like is there an API calls/requests limit?
  4. I haven’t ever seen this error in postman. But I can try to trigger it.

I suspect it’s a frequency or a rate limit issue… meaning I’m making a ton of (possibly concurrent) calls to airtable via the API… this is why I would expect a different error code, something indicating rate limits exceeded etc. but getting a 404 table not found is VERY odd to me!

Here’s a brief log of the instances that ran via Zapier, those marked “scheduled” hit the 404 and are rescheduled to try again (this may sound ideal but it’s not, the 404 shouldn’t exist in the first place)

Screenshot 2019-10-03 11.19.15.png

Screenshot 2019-10-03 11.21.11.png

41

13
the above screenshot indicates that the pattern is not predictable imo

48

I’ve run this api call from postman 20-30 times just now and have not seen an error.

Paul,

If you read the error message from Zapier, they disclose a degree of ambiguity concerning 404’s. While the error message starts with a Table Missing indication, you must read further. Even they say that this is not a table missing error, but likely a field missing error.

image.png

From this, one might surmise that in 10 percent of the API calls, a field the Zap is expecting, is simply not in the API GET response.

Is that possible in your data?

Does “whatever” include the possibility that his Zap is expecting a specific field and none exists in the GET response?

No, that’s not how Zapier works, the actual text of the error says the table cannot be found. I wouldn’t get a 404 if there were no results, I would get an empty result set (which I test for later in the zap)

Nope, not possible, since all the values for the GET are “hard coded” … meaning they are the same everytime this zap triggers and have no variables in them. I’m basically looking for a list of all records in a view… the zap is triggered on like a cron job, so there’s no “values” that change at this point in the zap, every 5 (ish) minutes the zap is triggered and the first thing it does is run this API call to query if any records are in this view. It handles empty resultset very well and there is no 404 because the table and view are found, it’s just an empty resultset.

Fair enough. I am no expert concerning Zapier and it’s great you are able to rule out Zapier as the possible cause. This leaves only Airtable as the source of the trouble.

I’m going to go way out on a limb here and predict that ultimately you will discover that a 10% failure rate involving your integration is attributed to a data condition that occurs only 1 in ten requests on average. I believe the answer is in your data (somewhere). If I’m wrong, I’ll buy you a nice turkey sandwich or a beer - your choice. :winking_face:

Edit #1: One recommendation - build the exact same GET request process using Google Apps Script and set it up for 5-minute intervals. Log all responses to a spreadsheet and then test to see what the failure rate is. At worst, you will have some good data for @EvanHahn to look at.

Edit #2: for the record…

But it also goes on to say that this is what [Zapier, possibly Airtable as well] reports “when a field value used in this step is missing”. Despite leading with “Table Not Found”, this is a typical ambiguity we often see in 404 errors. The true issue is likely related to the data and the expectations of Zapier, not a missing table. This leads me to one more question -

What if there is a result returned but it’s not a complete result - i.e., certain expected values are not present as JSON elements?

How can that be in an API that does not return NULL or even EMPTY values?