# Webtrigger returning 424 Failed dependency

**URL:** <https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319>\
**Category:** Forge Platform and Tools\
**Created:** [March 18, 2021, 12:42pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319 "2021-03-18T12:42:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrettB](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@BrettB](https://community.developer.atlassian.com/u/BrettB)\
**Post date:** [March 18, 2021, 12:42pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/1 "2021-03-18T12:42:30Z")

</div>

I have tried setting up a webtrigger both in my own app and just using the example one here:

[https://bitbucket.org/atlassian/forge-issue-alerting/src/master/README.md](https://bitbucket.org/atlassian/forge-issue-alerting/src/master/README.md)

Going through the setup to get a url:

1. Get the Forge installation IDs for the app by running. `forge install:list`
2. Get the webtrigger URL using the _Jira_ installation ID from step 1 by running. `forge webtrigger <jira-installation-id>`
3. Set the environment variable by running. `forge variables:set WEBTRIGGER_URL "<webtrigger-url>"`
4. Redeploy the app to use the environment variable. `forge deploy`

Both triggers return “Failed Dependency” when curl’ing them, presumably because it can’t find the webtrigger function.

{“timestamp”:“2021-03-18T12:27:52.678+00:00”,“path”:“xx”,“status”:424,“error”:“Failed Dependency”,“requestId”:“xxx”}%

Does anyone have a hint where I am going wrong?

Thanks,

B

---

<div class="post-metadata">

**Author:** ![RyanBraganza](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ryanbraganza/32/38400_2.png) [@RyanBraganza](https://community.developer.atlassian.com/u/RyanBraganza)\
**Post date:** [March 19, 2021, 5:38am UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/2 "2021-03-19T05:38:38Z")

</div>

Hi @BrettB,

That error message usually indicates that your trigger function didn’t return an acceptable response - possibly because an error was thrown. You can try wrapping your function with a try/catch, and returning the error details. Something like…

```auto
try {
  // do the things
} catch (err) {
  return buildOutput(String(err), 500, 'Internal Server Error');
}

```

---

<div class="post-metadata">

**Author:** ![AliHaydar](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@AliHaydar](https://community.developer.atlassian.com/u/AliHaydar)\
**Post date:** [April 6, 2022, 11:05pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/3 "2022-04-06T23:05:02Z")

</div>

Hello,

I tried wrapping my function with a try catch, but the code is never reaching the catch and still returning the 424 error. Any hints on how to proceed?

Is it possible that’s something related to rate limit or size of the body object? I get a correct response when I return a smaller object, or could it be there’s something messed up in the data it’s not able to stringify it?

Thanks,

---

<div class="post-metadata">

**Author:** ![IlyaRadchenko](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ilyaradchenko/32/46004_2.png) [@IlyaRadchenko](https://community.developer.atlassian.com/u/IlyaRadchenko)\
**Post date:** [September 8, 2022, 5:09pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/4 "2022-09-08T17:09:26Z")

</div>

Having the same error, and I’m not even doing anything

```auto
export async function taskCreated(value) {
  console.log('taskCreated: ', JSON.stringify(value, null, 2));
  return {ok: true};
}

```

I tried with no return, and in both cases the same error and the console.log is not hit.  
What is `buildOutput`? Seems like it should work without a return though.

**edit** : I found [[FRGE-489] - Ecosystem Jira](https://ecosystem.atlassian.net/browse/FRGE-489) but no luck there either.

```auto
export async function taskCreated(value: any) {
  let err: Error | undefined;

  try {
    console.log('taskCreated: ', JSON.stringify(value, null, 2));
  } catch (e) {
    console.log(`taskCreated error: ${e}`);
    err = e;
  }

  return {
    body: err ? `{"error": "${err.message}"}` : '{"hello": "world"}',
    headers: {
      'Content-Type': ['application/json'],
      'X-Request-Id': ['example'],
    },
    statusCode: err ? 400 : 200,
    statusText: err ? err.message : 'OK',
  };
}

```

And get this:

```auto
{
    "timestamp": "2022-09-08T17:33:30.499+00:00",
    "path": "/x1/L4-I8W7xWunEunceEBKbvVTqau0",
    "status": 424,
    "error": "Failed Dependency",
    "requestId": "98c5752e-62703"
}

```

This page: [https://developer.atlassian.com/platform/forge/manifest-reference/modules/web-trigger/](https://developer.atlassian.com/platform/forge/manifest-reference/modules/web-trigger/) needs an example of the request, response and an example of the function defined.

---

<div class="post-metadata">

**Author:** ![IlyaRadchenko](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ilyaradchenko/32/46004_2.png) [@IlyaRadchenko](https://community.developer.atlassian.com/u/IlyaRadchenko)\
**Post date:** [September 12, 2022, 3:32pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/5 "2022-09-12T15:32:51Z")

</div>

I was posting the following to the webhook:

 ![Screen Shot 2022-09-12 at 11.31.03 AM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/b/e/be39acc95b9249c8b123107c015b62f218853f80.png)  
 ![Screen Shot 2022-09-12 at 11.32.05 AM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/c/b/cb4376ef14eecf57fca24bd7174a14d87938fec8.png)

And manifest has the following:

```nohighlight
modules:
  webtrigger:
    - key: task-created-webtrigger
      function: task-created-web-func
  function:
    - key: task-created-web-func
      handler: web-triggers.taskCreated

```

---

<div class="post-metadata">

**Author:** ![IlyaRadchenko](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ilyaradchenko/32/46004_2.png) [@IlyaRadchenko](https://community.developer.atlassian.com/u/IlyaRadchenko)\
**Post date:** [September 14, 2022, 3:06pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/6 "2022-09-14T15:06:32Z")

</div>

Was able to solve this. Basically any time you change manifest for webtriggers you need to do `forge deploy` even if just using the tunnel.

---

<div class="post-metadata">

**Author:** ![rmassaioli](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rmassaioli/32/35834_2.png) [@rmassaioli](https://community.developer.atlassian.com/u/rmassaioli)\
**Post date:** [November 15, 2023, 2:43am UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/7 "2023-11-15T02:43:06Z")

</div>

Also, make sure you return the `statusCode: 204` in the return statement of the function.

I was not returning the right return function in my app as documented here [https://developer.atlassian.com/platform/forge/events-reference/web-trigger/#web-trigger-events](https://developer.atlassian.com/platform/forge/events-reference/web-trigger/#web-trigger-events) and that resulted in the above error.

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [November 15, 2023, 12:36pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/8 "2023-11-15T12:36:40Z")

</div>

For folks finding this thread based on the error message, please know the solution indicates one of many causes. Because web triggers lack runtime observability, you may not be able to determine what is the cause in your case. For that problem, I opened [FRGE-1297](https://ecosystem.atlassian.net/jira/software/c/projects/FRGE/issues/FRGE-1297).

In addition to failing to return a proper error code, I found a couple other problems.

- [FRGE-1298](https://ecosystem.atlassian.net/jira/software/c/projects/FRGE/issues/FRGE-1298) If your `package.json` uses `”type”: “module”` (fix on the way). More generally, try starting a new Forge app and creating a “reduced test case” by removing settings until you have a working web trigger, then add in settings 1 by 1 until you isolate the problem.
- [FRGE-1299](https://ecosystem.atlassian.net/jira/software/c/projects/FRGE/issues/FRGE-1299) There is an additional bundling step (Forge Bundler) in the Forge Deploy step. Since you can’t control it directly, it can still cause dependencies to fail a deploy, even for the native Node.js runtime. As with above, use the “reduced test case” approach to strip out dependencies until you have a working web trigger, then add libs back in until you find what is “choking the bundler”.

With multiple potential causes, I recommend future cases should start as new threads so we can work through diagnosis more carefully on a case-by-case basis. The same error does not mean the same underlying problem. Hence, I’m also locking this thread to avoid more problem conflation.

---

<div class="post-metadata">

**Author:** ![ibuchanan](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ibuchanan/32/35815_2.png) [@ibuchanan](https://community.developer.atlassian.com/u/ibuchanan)\
**Post date:** [November 15, 2023, 12:36pm UTC](https://community.developer.atlassian.com/t/webtrigger-returning-424-failed-dependency/46319/9 "2023-11-15T12:36:46Z")

</div>

Closed on November 15, 2023, 12:36pm UTC


