Skip to main content
Solved

New error in automation script : Error: Request processing is disabled due to earlier failed request

  • December 6, 2024
  • 7 replies
  • 18 views

Forum|alt.badge.img+11

Hi, I keep getting this new message in the automation script ide :

Error: Request processing is disabled due to earlier failed request

It seem like airtable does not want to rerty a fetch that previously failed even if the input parameters have changed. Anybody else is getting this?

It's the first day that I saw this message and it's a bit combersome.

Best answer by dilipborad

Hello @Pierre-Alexand2,
Not sure but first try this
Add await to the keyword to getLabel &  updateShipmentReord functions.

You should be aware of Airtable automation run script limitations as per time and resources. https://support.airtable.com/docs/run-a-script-action#run-a-script-action-limits

View original
Did this topic help you find an answer to your question?

7 replies

dilipborad
Forum|alt.badge.img+20
  • Brainy
  • 215 replies
  • December 7, 2024

Hello @Pierre-Alexand2,
I don't think this is a new error. 

As per my understanding, It just said that you're API or any other request you made to get external data fusing fetch failed, and due to that the further process is disabled to response failed. 
Maybe I'm wrong but to understand your error in more depth you need to share your code with excluding credentials.
Also, explain what API you're trying to use with data parameters.

I hope it helps. Please do 👍 if you like it.


Forum|alt.badge.img+2
  • New Participant
  • 1 reply
  • December 11, 2024
dilipborad wrote:

Hello @Pierre-Alexand2,
I don't think this is a new error. 

As per my understanding, It just said that you're API or any other request you made to get external data fusing fetch failed, and due to that the further process is disabled to response failed. 
Maybe I'm wrong but to understand your error in more depth you need to share your code with excluding credentials.
Also, explain what API you're trying to use with data parameters.

I hope it helps. Please do 👍 if you like it.


I also just got this error as a one-off.

I didn't have any failed prior requests...


dilipborad
Forum|alt.badge.img+20
  • Brainy
  • 215 replies
  • December 12, 2024

Hello @abr & @Pierre-Alexand2
Can you guys able to share your JS code scripts? 
Please also make sure you exclude credentials.
👍


Forum|alt.badge.img+11
  • Author
  • Participating Frequently
  • 7 replies
  • December 12, 2024

Hi, here is the script in question:

 

async function getToken() { let response = await fetch('https://api.novoxpress.ca/prod/auth/get-token', { method: 'POST', headers: { accept: '*/*', username: 'XXXX', password: 'XXXX' } }) let data = await response.json() console.log('Token data: ', data) return data.response.token } async function createShipment(token, serviceId, requestId, param) { let response = await fetch('https://api.novoxpress.ca/prod/shipment/create-shipment', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "service_id": serviceId, "request_id": requestId, "details": { "sender": param.sender, "recipient": param.recipient, "payment_type": "Sender", "packaging_type": "package", "packaging_properties": param.packaging_properties, "additional_options": { "declared_value": param.declared_value, "signature_option": "SR" }, "reason_for_export": "Permanent", "business_relationship": "NotRelated", "non_delivery": "RTS", "internationalForms": param.internationalForms } }) }) let data = await response.json() console.log('Shipment details: ', data) let shipmentId = data.shipment_id let trackingNumber = data.tracking_number return { shipmentId, trackingNumber } } async function getLabel(shippingId, token) { console.log(shippingId) console.log(token) let response = await fetch('https://api.novoxpress.ca/prod/shipment/print-label', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ "shipment_id": shippingId, "label_type": "EightFiveByEleven" }).toString() }) if (response.ok) { let data = await response.json() console.log('Label details: ', data) return [{ url: data?.label?.shipping_label || '' }, { url: data?.label?.CustomsInvoiceThermal || '' }] }else{ throw new Error('Error fecthing label') } } async function updateShipmentReord(labelUrl, shippingRecordId, trackingNumber, carrier, shipmentId) { const shippingTable = base.getTable('tblFhBOpSFpTjv47Z') const shippingDocumentsFieldId = 'fldfe8ZJCZ9nq5fbN' const carrierFieldId = 'fldFHvJJ6N1SghQLl' const trackingNumberFieldId = 'fld2fpolAqrkkzFmv' const shippingIdField = 'fldjR8loIDplIDG4C' await shippingTable.updateRecordAsync(shippingRecordId[0], { [carrierFieldId]: carrier, [trackingNumberFieldId]: trackingNumber, [shippingDocumentsFieldId]: labelUrl, [shippingIdField]: shipmentId }) } async function main() { const { parameters, shippingRecordId, serviceId, requestId, carrier } = input.config() let param = JSON.parse(parameters) console.log('Param: ', param) let token = await getToken() let { shipmentId, trackingNumber } = await createShipment(token, serviceId, requestId, param) let labelUrl = getLabel(shipmentId, token) updateShipmentReord(labelUrl, shippingRecordId, trackingNumber, carrier, shipmentId) } await main()

 

 

In this script, the airtable automation script IDE will always throw this error 

 

Error: Request processing is disabled due to earlier failed request
    at getLabel on line 54    at main on line 97    at async main on line 102

When using postman with the same token and shippingId, the endpoint work fine.


dilipborad
Forum|alt.badge.img+20
  • Brainy
  • 215 replies
  • Answer
  • December 16, 2024

Hello @Pierre-Alexand2,
Not sure but first try this
Add await to the keyword to getLabel &  updateShipmentReord functions.

You should be aware of Airtable automation run script limitations as per time and resources. https://support.airtable.com/docs/run-a-script-action#run-a-script-action-limits


Forum|alt.badge.img+11
  • Author
  • Participating Frequently
  • 7 replies
  • December 16, 2024
dilipborad wrote:

Hello @Pierre-Alexand2,
Not sure but first try this
Add await to the keyword to getLabel &  updateShipmentReord functions.

You should be aware of Airtable automation run script limitations as per time and resources. https://support.airtable.com/docs/run-a-script-action#run-a-script-action-limits


Thank you very much for this. I keep forgetting to put await.


Forum|alt.badge.img+4
  • New Participant
  • 4 replies
  • December 30, 2024

Hi,

I also received this message and it was confusing for me too. The solutions provided in this thread are really working, thanks everyone!


Reply