# Script error: "executor terminated unexpectedly with exit code 1"

**URL:** <https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977>\
**Category:** Misc\
**Created:** [September 5, 2021, 2:54am UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977 "2021-09-05T02:54:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [September 5, 2021, 2:54am UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/1 "2021-09-05T02:54:59Z")

</div>

Tyrying to develop and debug Fibery Action scripts is super frustrating – even worse than Google Apps Script 😠

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/b/b4a56f8880e80089b5114a7a552eda3454568d56.png)

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [September 5, 2021, 7:04pm UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/2 "2021-09-05T19:04:53Z")

</div>

> [@Matt\_Blais](#):
>
> even worse than Google Apps Script 😠

Interesting that you say that, there are definitely “gotchas” with Google Apps Scripts, especially when working with Sheets and Drive, but 90% of my bugs were caused by lack of skills with JavaScript.

Haven’t worked with Fibery Action scripts yet but if it doesn’t have a debugging function the next thing would just be to start adding `console.log()` until you figure out what’s wrong.

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [September 6, 2021, 3:00pm UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/3 "2021-09-06T15:00:54Z")

</div>

Thank you for the screenshot!  
We would check the details on our side and will give the answer tomorrow 💖

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [September 6, 2021, 3:57pm UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/4 "2021-09-06T15:57:36Z")

</div>

I resolved it, and I believe it was caused by passing `undefined` as one of the params to `fibery.addCollectionItem` or `fibery.cxreateEntity`.

The real problem is the absence of helpful error information when this occurs.

Even the `try/catch` block was ignored, and all of the previously generated console.log messages were nowhere. So nothing to help debug it!

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [September 6, 2021, 4:34pm UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/5 "2021-09-06T16:34:17Z")

</div>

Some things that would make debugging MUCH easier:

- Support javascript’s `Error.stack`
- Always show console.log messages generated by the script, even when the script does not “complete successfully”

Also the last time I checked, your server node.js disallows newer language features such as _[Optional Chaining and Nullish Coalescing](https://www.programmableweb.com/news/nodejs-v14-has-arrived-some-new-api-features/review/2020/05/14)_ – these would be useful, if there’s not a good reason to disallow them.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [September 7, 2021, 9:49am UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/6 "2021-09-07T09:49:07Z")

</div>

Will fix both issues you’ve mentioned and will message here when done. Sorry for inconvenience.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [September 8, 2021, 3:24pm UTC](https://community.fibery.io/t/script-error-executor-terminated-unexpectedly-with-exit-code-1/1977/7 "2021-09-08T15:24:32Z")

</div>

Completed the promise partially.

Now if script fails, `console.log` output will be in Activity Log. But unfortunately this will not affect your particular case in a screenshot. Will investigate it a bit more, in a case on a screenshot an engine has failed unexpectedly, probably it’s a bug on our side. But in 99% of cases debugging will become easier I hope.

Failed to add stack trace, need to dig further, probably not an easy thing to do.

About latest NodeJs features: we use Node 12, probably will migrate in future, no exact promise here.
