Nov 25, 2020 12:39 PM
Has anyone else run into this? I have several automations set up on my base, and a week or two ago some of the automations using the Run a script action started randomly failing with the error message
An unknown error occurred. When I look at the log, it just says
ERROR: There was an unexpected error while executing your script.
I haven’t found any way to fix it aside from just re-triggering the automation on whatever records weren’t processed.
Nov 26, 2020 04:52 PM
I’ve only run into that error while testing, not after an automation has been running for a while. Obviously there’s no way of knowing how to fix it without a more detailed error message, so it could be anything, and off the top of my head I can’t recall what the fix was when I’ve hit that error myself.
Dec 01, 2020 07:01 PM
Yeah, the lack of a detailed error message is very frustrating!
Dec 02, 2020 01:52 PM
I receive the same thing a few times a day. I started noticing it happening a couple days ago. Wish I had more to add than just “me too”, but there it is…
Dec 10, 2020 07:34 AM
Erin with Airtable support here :wave:
Thanks @Matthew_Lount for writing in about this and helping us pinpoint the source of some of these error messages. In this case, we noticed that some scripts were occasionally hitting timeouts and failing with this “unexpected error” message. The team is currently working on both increasing those timeouts so this occurs much less frequently, as well as improving the error messages that are surfaced so that when a script fails, you’ll have a better idea of what exactly went wrong. Thanks again for bringing this to our attention, and as always feel free to write into us directly at email@example.com if there are any other issues you encounter.
Dec 10, 2020 09:18 AM
Hi @Erin_OHern, how are these timeouts related to the “CPU time” and “Run Time” displayed in the Automation Script Editor? The scripts that are failing on me don’t come anywhere close to those caps, they’re under 10% in both metrics.
Dec 11, 2020 02:26 PM
Hi @Tim_Mackey. Looking over the advice @Erin_OHern gave me it sounds like it is not the overall usage, but the individual calls to Airtable functions that can time out.
Her suggestions were basically to reduce the load of any individual call to get records from the base to just what I need (such as by passing in specific fields that I need, empty lists of fields if I’m just looking for the name and /or id portion of the records). I expect that reducing numbers of records by choosing appropriate views would also be helpful.
@Erin_OHern feel free to correct me if I’ve misinterpreted your advice. :slightly_smiling_face:
Dec 11, 2020 02:50 PM
Thanks @Matthew_Lount, that makes sense. I suspected it might be something like this, which is why I’ve already made some changes to my scripts like the ones you mentioned (limiting fields). I’m working with several tables with a huge number of linked cells, so I suspect that is where the problem is arising. Without an informative error message though, and given the fact that the scripts normally complete in a short amount of time, there wasn’t enough evidence for me to assume that this was the problem.
Dec 14, 2020 12:26 PM
@Tim_Mackey No worries - I’m in a similar boat - hopefully their suggestions help cut down on the failed calls. :slightly_smiling_face:
Feb 10, 2021 01:23 AM
I think this problem is still not fixed. It occurs on yesterday.
As said by @Matthew_Lount. I’m assuming it’s the same problem with some of the internal function calls are timeout.
I’ve got these errors while used script in Automation. The interesting thing is it’s happened randomly in a week. Sometimes it occurs a couple of times and then suddenly stops and then again occurs after the random number of days.
There is no clue in the error message also I can’t able to find no clue why that’s happening.
After reading this topic I think this is related to that.
Feb 15, 2021 07:40 AM
I too will parrot this thread.
I now run roughly 10 similar automations in 3-4 workspaces. They all throw the same non-descriptive error, maybe 1 in 10, perhaps 1 in 20 times.
Re-running the script via Test (I use a ‘View’ as the trigger) always works, but it takes me about 15 minutes every day to manually fix them myself.
@Erin_OHern you mentioned ways to combat this (change Timeout settings). Could you also consider…
In the ‘Built on Airtable’ slack lots of users are complaining about this exact problem, but we’re not seeing any solutions whatsoever.
Oct 19, 2022 02:45 PM
I’m currently unable to develop new scripts within a base due to this error “An unknown error occurred” after waiting 30 seconds for a script that usually takes 2 seconds.
I was updating a script within an Automation as per normal, but then this error returned when I was testing my finished code - at first I figured there’s something wrong with my script - but then I realised, no error was actually being returned - just a generalised “An unknown error occurred” message.
Eventually, I opt’d to create a new Automation and new script with no custom code within the same base… and still same error… Sooo, it looks like my base is jammed?
As panic started to set in, I’ve quickly worked the existing buttons and forms of my base and THANKFULLY they’re all working, including the script that I patched (thank goodness!!!) - but this leaves me in an awkward position, I have no way to write or edit scripts for my production base… hopefully I’ll hear from Airtable support soon.
The problem doesn’t occur in other bases, but it does follow me around on different computers - so will be interesting to hear what’s going on here.
The problem cleared itself after about an hour or two. I did raise the issue with Airtable support too, but by the time they reached out asking for the Base ID, it had cleared.