Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: remoteFetchAsync() returns "Request Timeout"

3577 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Zollie
10 - Mercury
10 - Mercury

I’m using the scripting app to send data via API request to another application. It’s currently functioning, and the other application is able to take the data and perform as required.

However, I’m having trouble getting a response from the API request that doesn’t timeout. It works for one or two records, but beyond that it’ll return a Request Timeout error. Surprisingly, the code does wait for the function to be fully performed (I get a loading icon), but the response information doesn’t seem to be waiting.

Is this a limitation with remoteFetchAsync/Airtable or is something wrong with my implementation?

Related code:
(I’ve replaced the URL and header/x-functions-key with dummy strings):

const stringifiedData = JSON.stringify(data);
const url = "private_url";
const requestOptions = {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "x-functions-key": "private_key",
    },
    body: stringifiedData,
    keepalive: true
};
await remoteFetchAsync(url, requestOptions).then(response => {
    console.log(response)
})
6 Replies 6
Nathaniel_Grano
8 - Airtable Astronomer
8 - Airtable Astronomer

Sorry if I’m being a bit dense. What specifically happens when you run the code above (with the real URL/key, etc)? Is there a console error? Can you paste a screenshot?

Have you looked into the Networking tab of your browser tools? What does the browser show as the status of the request/response?

Not at all dense. Response from console.log below.

{type: "basic", url: "private_url", status: 408, statusText: "Request Timeout", ok: false…}
type: "basic"
url: "private_url"
status: 408
statusText: "Request Timeout"
ok: false
headers: Object
redirected: false

network_status_codes

I also noticed that the console.log statement occurs before the network messages halt. So my initial thought that the promise is waiting for activity to halt was likely false - it really is timing out.

Can anyone speak to Airtable’s timeout limitations?

Ah, I forgot you were using remoteFetch which proxies the request via airtable’s servers. Are you using a remoteFetch instead of a regular fetch intentionally (for example, due to cors restrictions)? I’ve generally used standard fetch so I can’t speak to timeout limits of the remote execution.

Yes. When I attempt fetch, I receive a TypeError: NetworkError which offers a CORS related explanation

Nathaniel_Grano
8 - Airtable Astronomer
8 - Airtable Astronomer

Alright, afraid I don’t have any real experience with the remoteFetchAsync function so I can’t help further.
If you haven’t already, you might drop a line to support@airtable.com.

lilliandaya
4 - Data Explorer
4 - Data Explorer

Hi, I'm running into the same exact issue, I've spent a few hours now trying to work around it, and then finally came across your post, were you able to resolve this?