trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Slack alert sends more context that is needed

Open gabrielcardetti opened this issue 8 months ago • 1 comments

Provide environment information

I only test this on production, and im running latest version of v3

Describe the bug

I use Slack alerts to send notifications about failing runs. When I receive an error, I receive a lot of context of trigger that is not useful for debugging, so when I receive a lot of notifications, it gets really hard to read because they all trigger stack trace errors.

Reproduction repo

trigger v3

To reproduce

I just created an Slack alarm and had a run fail, here are some examples

Error: Failed to fetch image: Bad Request
    at fetchMediaContent (file:///src/modules/webhooks/utils.ts:83:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at getMediaContent (file:///src/modules/trigger/utils.ts:132:20)
    at run (file:///src/modules/trigger/createDocumentFromWhapi.ts:67:32)
    at _RunTimelineMetricsAPI.measureMetric (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/runTimelineMetrics/index.ts:67:22)
    at file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/workers/taskExecutor.ts:128:28
    at ConsoleInterceptor.intercept (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/consoleInterceptor.ts:36:14)
    at result._tracer.startActiveSpan.kind (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/workers/taskExecutor.ts:90:16)
    at file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/tracer.ts:132:18
    at TaskExecutor.execute (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/workers/taskExecutor.ts:87:20)
    at EXECUTE_TASK_RUN (file:///.npm/_npx/f35930adf21a2162/node_modules/trigger.dev/src/entryPoints/deploy-run-worker.ts:390:30)
    at ZodIpcMessageHandler.handleMessage (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/zodIpc.ts:88:17)
    at ZodIpcConnection.#handlePacket (file:///.npm/_npx/f35930adf21a2162/node_modules/@trigger.dev/core/src/v3/zodIpc.ts:238:24)
run_dp9op98aa2htxwaa85fae | create-document-from-whapi | 20250522.1.prod | Financiera-casper

where the only "useful" for me is

Error: Failed to fetch image: Bad Request at fetchMediaContent (file:///src/modules/webhooks/utils.ts:83:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at getMediaContent (file:///src/modules/trigger/utils.ts:132:20) at run (file:///src/modules/trigger/createDocumentFromWhapi.ts:67:32)

And like this, I have ALL the errors. I always thought that it was like this, but I posted this on Discord, and it says it was a bug, so I should report it.

Matt point me that the code where trigger filter is in

https://github.com/triggerdotdev/trigger.dev/blob/e19bf2abafee4c1802947e4e6af35de7910179d7/packages/core/src/v3/errors.ts#L273

I tried to understand why is the problem but in the code, it has the case to delete the logs that have "/@trigger.dev/core/" so not sure what is happening.

Additional information

Here more examples:

Image

Image

gabrielcardetti avatar May 23 '25 09:05 gabrielcardetti

Hi! I'd like to work on this issue. I will investigate it and will update my progress here.

omkardongre avatar Aug 19 '25 21:08 omkardongre