Forge webtriggers broken, 424 error code

Getting an error when posting to a webtrigger. Get the 424 error ‘Failed dependency’. I posted here: Webtrigger returning 424 Failed dependency but that is solved and I haven’t heard back so reposting as a new topic.

I found [FRGE-489] - Ecosystem Jira but no luck there either.

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 manifest has the following:

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

Posting to the url returns this:

{
    "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/ needs an example of the request, response and an example of the function defined.

I was posting the following to the webhook:


I tried multiple header and body variations, but all return the same thing.
Running npx forge webtrigger <id> returns the same webtrigger url.

So this is super dumb, but was able to solve this. The error messaging needs to be better for sure. 424 default error is not enough.

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

5 Likes