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:
(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?
Solved! Go to Solution.
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!
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.
Developer on Airtable’s API team here.
For what it’s worth, we basically only return 404s in two cases:
api.airtable.com/v0/garbagewill 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:
I’d love to get to the bottom of this, because it sounds spooky.
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!
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)
the above screenshot indicates that the pattern is not predictable imo
I’ve run this api call from postman 20-30 times just now and have not seen an error.
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.
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?
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?
Nope, the text you’re reading is the “help text” from Zapier for API novices to say “hey, you might be getting an error from your API because one of the fields we sent to the API was empty” – it’s help text on any error with webhooks. In my case the values are all set and there’s no possibility for an “empty” value being sent to the API (all it is is GETing the records in a specific view)
As we know, an API request for a record that has 10 columns, five of which have data, will return that record without the empty fields represented in the result - i.e., . only five fields that actually have data.
Just a hunch - is it possible the Zap is accommodating two of three possible result occurrences and missing the third possibility where there is a result, but the payload is less than that needed for the Zap to process completely?
Bear in mind, the 404 you are getting from Zapier is an interpretation of the 404 Airtable may (or may not) be generating, right?
Again, I don’t know Zapier that well, but it is a middle-ware API service that must interpret and report errors from 1500 different APIs. How it handles each of them could be giving you inaccurate assessments of failure.
You are making some huge assumptions here… Zapier doesn’t expect the result at all. So 3 records with only 3 fields each or 1 record with 1 field or 0 records with 0 fields (empty resultset) all are the same to Zapier (in this case, since it’s just a simple webhook)
I have already worked with the Zapier team to determine that the 404 error is indeed coming from Airtable and the missing element is the table as the error says.
Zapier knows how to handle errors, so please stop trying to claim it’s a Zapier problem.
Understood - I’m still learning and it seems you have exhausted Zapier as the source of your headache.
I guess you need to focus on Airtable failing to support consistent requests for your data.
To be clear - I’m only suspecting Zapier as a potential source of your troubles. My hunch is that that something in the data has changed and the Zap is unable to deal with it.
If the folks at Zapier have details that prove this is an Airtable failure, you simply need them to explain it to @EvanHahn with actual data.
I’m curious to see what the outcome is.
Unlikely. It’s possible that we’re not returning a field for whatever reason, and then Zapier chokes on that (for some unexpected reason) and then, inexplicably, makes it look like we’re returning a 404. I think all of that is pretty unlikely, especially given the discussion above.
@Paul_Kortman Here’s a wild question: are all of these requests using the same
User-Agent header? Are you able to see that in Zapier’s logs?
A less wild question: is there anything different between a successful request and an unsuccessful one, other than timestamps? Are the outgoing requests any different?
Another thought: could you set up a similar Zap pointing to a different base and see if the problem persists there? That could help us determine whether this is a broader issue.