slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno

Home Page:https://api.slack.com/automation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seemingly random `event_dispatch_failed` errors showing up in activity logs

filmaj opened this issue · comments

I have a function in step 1 of a workflow with two client.apiCall(conversations. ) calls that take less than a couple of seconds.

The function completes successfully but occasionally this event_dispatch_failed error occurs. Oddly the remaining workflows seem to work anyway.

Is there a way to trap this error?

Thanks

2023-12-02 10:45:54 [info] [Fn066BHGLQ8M] (Trace=Tr068E8BTS2G) Function 'Get Deal Function' (app function) completed
2023-12-02 10:45:54 [info] [Wf066BAJ7TN1] (Trace=Tr068E8BTS2G) Workflow step 'Get Deal Function' completed
2023-12-02 10:45:54 [error] [Fn066BHGLQ8M] (Trace=Tr068E8BTS2G) Function 'Get Deal Function' (app function) failed
	event_dispatch_failed
Token fetch succeeded for user 'U4616159U' on workspace 'T460BGG6A' for app 'A066E5JGW11' and provider 'zoho'
2023-12-02 10:45:55 [info] [Wf066BAJ7TN1] (Trace=Tr068E8BTS2G) Workflow step 2 of 2 started
2023-12-02 10:45:55 [info] [Fn067382QLGG] (Trace=Tr068E8BTS2G) Function 'Allocate Modal' (app function) started

Originally posted by @markfoden in #179 (comment)

More reproductions:

I just hit this - twice in a row - with my own testing app running locally, but the function executed just fine even though the event_dispatch_failed error was the first activity log I saw! App ID A05HS9E6P2P:

2023-12-04 09:54:52 [error] [Fn05HKNRE370] (Trace=Tr068WANRNQH) Function 'Approval' (app function) failed
	event_dispatch_failed
---
2023-12-04 09:58:59 [error] [Fn05HKNRE370] (Trace=Tr068WBGKPK3) Function 'Approval' (app function) failed
	event_dispatch_failed

This happens to me with every [local] custom function I am testing. I ignore it, as the function appears to run fine. I am not sure what event it is trying to dispatch, so not sure where to even try to resolve it.

Another example:

2023-12-04 12:59:58 [error] [Fn068M4L1A92] (Trace=Tr0684REH6H5) Function 'Sample function' (app function) failed
        event_dispatch_failed

If it's:

  • local-only, and
  • the function takes longer than 3 seconds before calling the functions.completeSuccess API (aka returning)

.. then it is definitely #179.

An update here: we have some work in progress on the backend to improve and make consistent the timeouts, which should drop the amount of event_dispatch_failed issues app developers are seeing today. Still being reviewed and tested, but once it rolls out I will post an update here as we believe it should address this and #179.

@filmaj Any update on this issue? While I am receiving this error I am unable to use any outputs in my workflow as it is throwing an error.
I am attempting to interact with the Jira API so I am sure you can understand the 3s isn't going to cut it 😅

Ha, same here. I'm interacting with the Notion API and it needs ~8s to come back to me sometimes. My custom function is currently blocked by this issue being resolved.

We are in the process of testing out extending timeouts to 15 seconds across all custom function executions, which should help temporarily alleviate some of the issues here. I am following up with our infrastructure team to get an ETA on when that will be available to all.

Hi @filmaj, are there any updates on this issue? My workflows are also broken since they are throwing event_dispatch_failed errors

Hello! Locally-running functions should now have their timeout extended to 15 seconds to match the behaviour for deployed functions.

We are also working on extending this beyond 15 seconds as well (up to 60 seconds); we will provide updates on that particular rollout in #227, so please keep tabs on that issue if this interests you.

In the mean time, I will close this issue. If you have further issues with timeouts or the event_dispatch_failed error, feel free to comment on this issue, re-open it or open a new issue.

yay, in the name of all who have to interface with sluggish external APIs. thanks!