slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
155 stars 27 forks source link

Seemingly random `event_dispatch_failed` errors showing up in activity logs #256

Closed filmaj closed 5 months ago

filmaj commented 8 months ago

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_dispatchfailed 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 https://github.com/slackapi/deno-slack-sdk/issues/179#issuecomment-1837120594

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
mcsescott commented 8 months ago

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
filmaj commented 8 months ago

If it's:

.. then it is definitely #179.

filmaj commented 8 months ago

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.

FallingReign commented 6 months ago

@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 😅

tessi commented 5 months ago

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.

filmaj commented 5 months ago

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.

JaminsonR commented 5 months ago

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

filmaj commented 5 months ago

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.

tessi commented 5 months ago

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