Webhook gives error when it is triggered

Hi, I’m getting an error when my webhook node receives the trigger. I was googling a bit, but no luck… Anyone has an idea? All of my nodes with webhooks are giving the same response.

Webhook nodes get triggered but always give the same response and the workflow does not continue.

What is the error message (if any)?

The error message says: Cannot read properties of undefined (reading ‘getNode’).

Stack trace message:
TypeError: Cannot read properties of undefined (reading ‘getNode’) at Object.webhook (/home/node/.n8n/nodes/node_modules/n8n-nodes-base/nodes/Webhook/Webhook.node.ts:185:64) at Workflow.runWebhook (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:665:38) at Object.executeWebhook (/usr/local/lib/node_modules/n8n/dist/WebhookHelpers.js:219:48) at processTicksAndRejections (node:internal/process/task_queues:95:5) at /usr/local/lib/node_modules/n8n/dist/TestWebhooks.js:99:37

I’m also attaching a few pictures from my docker (dockge) setup and the error it self.


## Information on your n8n setup
- **n8n version:** 1.44.1
- **Database (default: SQLite):** default
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** docker 
- **Operating system:**Ubuntu server 22.04

Hi @alexroot, thanks for reaching out and being a part of the community! :tada:

I see you’ve configured your webhook urls. Did you encounter any of these issues prior to setting those up?

Hi @Ludwig ,

thanks for the quick reply.
No, before the manual cfg of webhook URL I did not have any issues. But If I recall correctly it used to work with this custom URL as well.

I tried to reset the config to default settings and I’m still having a problem. n8n gets the trigger when I open the GET url link, but it then results to this error…

There are only two calls to .getNode in Webhook.node, and both of them are on the context object, which should never be undefined.
Looks like you are hitting some major bug :exploding_head:
Are all the other nodes working for you?

I’m also experiencing this.
I seem to be having trouble with other nodes that attempt to communicate outside of n8n, specifically Budibase wont connect. “ECONNRESET”

      TZ: "America/Los_Angeles"
      VUE_APP_URL_BASE_API: https://${N8N_HOST}/
      N8N_LOG_LEVEL: debug
      N8N_LOG_OUTPUT: console #console or file
      N8N_HOST: ${N8N_HOST}
      N8N_EDITOR_BASE_URL: http://${N8N_HOST}
      WEBHOOK_URL: https://${N8N_HOST}/
      WEBHOOK_TUNNEL_URL: https://${N8N_HOST}/
      N8N_PORT: 25678
      N8N_PROTOCOL: https
n8n version

1.44.1 (Self Hosted)

Stack trace

TypeError: Cannot read properties of undefined (reading 'getNode') at Object.webhook (/home/node/.n8n/nodes/node_modules/n8n-nodes-base/nodes/Webhook/Webhook.node.ts:185:64) at Workflow.runWebhook (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:665:38) at Object.executeWebhook (/usr/local/lib/node_modules/n8n/dist/WebhookHelpers.js:219:48) at processTicksAndRejections (node:internal/process/task_queues:95:5) at /usr/local/lib/node_modules/n8n/dist/TestWebhooks.js:99:37

2024-06-15T05:45:15.494Z [Rudder] debug: in flush
2024-06-15T05:45:17.453Z | debug    | Initializing event bus... "{ file: 'MessageEventBus.js', function: 'initialize' }"
2024-06-15T05:45:17.456Z | debug    | Initializing event writer "{ file: 'MessageEventBus.js', function: 'initialize' }"
2024-06-15T05:45:17.463Z | debug    | Checking for unsent event messages "{ file: 'MessageEventBus.js', function: 'initialize' }"
2024-06-15T05:45:17.548Z | debug    | Start logging into /home/node/.n8n/n8nEventLog.log  "{ file: 'MessageEventBus.js', function: 'initialize' }"
2024-06-15T05:45:17.553Z | debug    | MessageEventBus initialized "{ file: 'MessageEventBus.js', function: 'initialize' }"
2024-06-15T05:45:17.557Z | info     | Version: 1.44.1 "{ file: 'AbstractServer.js', function: 'start' }"
2024-06-15T05:45:17.558Z | debug    | Server ID: main-ZUmQ07Mk1cJab7fd "{ file: 'Server.js', function: 'start' }"
2024-06-15T05:45:17.564Z | debug    | [Pruning] Starting soft-deletion and hard-deletion timers "{ file: 'pruning.service.js', function: 'startPruning' }"
2024-06-15T05:45:17.565Z | debug    | [Pruning] Soft-deletion scheduled every 60 min "{ file: 'pruning.service.js', function: 'setSoftDeletionInterval' }"
2024-06-15T05:45:17.566Z | debug    | [Pruning] Hard-deletion scheduled for next 15 min "{ file: 'pruning.service.js', function: 'scheduleHardDeletion' }"
2024-06-15T05:45:17.580Z [Rudder] debug: no existing flush timer, creating new one
2024-06-15T05:45:17.583Z | info     |  ================================ "{ file: 'ActiveWorkflowManager.js', function: 'addActiveWorkflows' }"
2024-06-15T05:45:17.584Z | info     |    Start Active Workflows: "{ file: 'ActiveWorkflowManager.js', function: 'addActiveWorkflows' }"
2024-06-15T05:45:17.585Z | info     |  ================================ "{ file: 'ActiveWorkflowManager.js', function: 'addActiveWorkflows' }"
2024-06-15T05:45:17.586Z | info     |    - "My workflow 3" (ID: 429zErFYHTvkJute) "{ file: 'ActiveWorkflowManager.js', function: 'add' }"
2024-06-15T05:45:17.587Z | debug    | Initializing active workflow "My workflow 3" (ID: 429zErFYHTvkJute) (startup) "{\n  workflowName: 'My workflow 3',\n  workflowId: '429zErFYHTvkJute',\n  file: 'ActiveWorkflowManager.js',\n  function: 'add'\n}"
2024-06-15T05:45:17.729Z | debug    | Adding webhooks for workflow "My workflow 3" (ID 429zErFYHTvkJute) "{ file: 'ActiveWorkflowManager.js', function: 'addWebhooks' }"
2024-06-15T05:45:17.752Z | verbose  | Successfully started workflow "My workflow 3" (ID: 429zErFYHTvkJute) "{\n  workflowName: 'My workflow 3',\n  workflowId: '429zErFYHTvkJute',\n  file: 'ActiveWorkflowManager.js',\n  function: 'addActiveWorkflows'\n}"
2024-06-15T05:45:17.752Z | info     |      => Started "{ file: 'ActiveWorkflowManager.js', function: 'addActiveWorkflows' }"
2024-06-15T05:45:17.753Z | verbose  | Finished activating workflows (startup) "{ file: 'ActiveWorkflowManager.js', function: 'addActiveWorkflows' }"
Editor is now accessible via:
https://localhost:35678/
2024-06-15T05:45:20.731Z [Rudder] error: Response error code: EAI_AGAIN
2024-06-15T05:45:25.960Z [Rudder] error: Response error code: EAI_AGAIN
2024-06-15T05:45:27.581Z [Rudder] debug: in flush
2024-06-15T05:45:27.582Z [Rudder] debug: cancelling existing flushTimer...
2024-06-15T05:45:31.375Z [Rudder] error: Response error code: EAI_AGAIN
2024-06-15T05:45:34.074Z | debug    | Skipped browserId check on /rest/push "{ file: 'auth.service.js', function: 'resolveJwt' }"
2024-06-15T05:45:34.075Z | debug    | Add editor-UI session "{ pushRef: 'agfh4gplvwc', file: 'abstract.push.js', function: 'add' }"
2024-06-15T05:45:34.077Z | debug    | Skipped browserId check on /rest/push "{ file: 'auth.service.js', function: 'resolveJwt' }"
2024-06-15T05:45:34.078Z | debug    | Add editor-UI session "{ pushRef: 'et1ppjni9cg', file: 'abstract.push.js', function: 'add' }"
2024-06-15T05:46:03.988Z | verbose  | Execution for workflow My workflow 3 was assigned id 19 "{\n  executionId: '19',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"

15T05:46:04.003Z | debug    | Executing hook (hookFunctionsPush) "{\n  executionId: '19',\n  pushRef: 'et1ppjni9cg',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteBefore'\n}"
2024-06-15T05:46:04.004Z | debug    | Send data of type "executionStarted" to editor-UI "{\n  dataType: 'executionStarted',\n  pushRefs: 'et1ppjni9cg',\n  file: 'abstract.push.js',\n  function: 'sendTo'\n}"
2024-06-15T05:46:04.010Z | debug    | Execution ID 19 had Execution data. Running with payload. "{\n  executionId: '19',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
2024-06-15T05:46:04.015Z | verbose  | Workflow execution started "{\n  workflowId: '429zErFYHTvkJute',\n  file: 'LoggerProxy.js',\n  function: 'exports.verbose'\n}"
2024-06-15T05:46:04.022Z | debug    | Start processing node "Webhook" "{\n  node: 'Webhook',\n  workflowId: '429zErFYHTvkJute',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-06-15T05:46:04.026Z | debug    | Executing hook on node "Webhook" (hookFunctionsPush) "{\n  executionId: '19',\n  pushRef: 'et1ppjni9cg',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
2024-06-15T05:46:04.026Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  pushRefs: 'et1ppjni9cg',\n  file: 'abstract.push.js',\n  function: 'sendTo'\n}"
2024-06-15T05:46:04.033Z | verbose  | Started execution of workflow "My workflow 3" from webhook with execution ID 19 "{\n  executionId: '19',\n  file: 'WebhookHelpers.js',\n  function: 'executeWebhook'\n}"
2024-06-15T05:46:04.034Z | debug    | Send data of type "testWebhookReceived" to editor-UI "{\n  dataType: 'testWebhookReceived',\n  pushRefs: 'et1ppjni9cg',\n  file: 'abstract.push.js',\n  function: 'sendTo'\n}"
2024-06-15T05:46:04.036Z | debug    | Running node "Webhook" started "{\n  node: 'Webhook',\n  workflowId: '429zErFYHTvkJute',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-06-15T05:46:04.038Z | debug    | Running node "Webhook" finished with error "{\n  node: 'Webhook',\n  workflowId: '429zErFYHTvkJute',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
2024-06-15T05:46:04.040Z | debug    | Executing hook on node "Webhook" (hookFunctionsPush) "{\n  executionId: '19',\n  pushRef: 'et1ppjni9cg',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
2024-06-15T05:46:04.041Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  pushRefs: 'et1ppjni9cg',\n  file: 'abstract.push.js',\n  function: 'sendTo'\n}"
2024-06-15T05:46:04.047Z | verbose  | Workflow execution finished with error "{\n  error: {\n    message: \"Cannot read properties of undefined (reading 'getNode')\",\n    stack: \"TypeError: Cannot read properties of undefined (reading 'getNode')\\n\" +\n      '    at Object.webhook (/home/node/.n8n/nodes/node_modules/n8n-nodes-base/nodes/Webhook/Webhook.node.ts:185:64)\\n' +\n      '    at Workflow.runWebhook (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:665:38)\\n' +\n      '    at Object.executeWebhook (/usr/local/lib/node_modules/n8n/dist/WebhookHelpers.js:219:48)\\n' +\n      '    at processTicksAndRejections (node:internal/process/task_queues:95:5)\\n' +\n      '    at /usr/local/lib/node_modules/n8n/dist/TestWebhooks.js:99:37'\n  },\n  workflowId: '429zErFYHTvkJute',\n  file: 'LoggerProxy.js',\n  function: 'exports.verbose'\n}"
2024-06-15T05:46:04.048Z | debug    | Executing hook (hookFunctionsSave) "{\n  executionId: '19',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
2024-06-15T05:46:04.051Z | debug    | Save execution data to database for execution ID 19 "{\n  executionId: '19',\n  workflowId: '429zErFYHTvkJute',\n  finished: false,\n  stoppedAt: 2024-06-15T05:46:04.046Z,\n  file: 'sharedHookFunctions.js',\n  function: 'updateExistingExecution'\n}"
2024-06-15T05:46:04.082Z | debug    | Executing hook (hookFunctionsPush) "{\n  executionId: '19',\n  pushRef: 'et1ppjni9cg',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
2024-06-15T05:46:04.082Z | debug    | Save execution progress to database for execution ID 19  "{\n  executionId: '19',\n  workflowId: '429zErFYHTvkJute',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
2024-06-15T05:46:04.083Z | debug    | Send data of type "executionFinished" to editor-UI "{\n  dataType: 'executionFinished',\n  pushRefs: 'et1ppjni9cg',\n  file: 'abstract.push.js',\n  function: 'sendTo'\n}"
2024-06-15T05:46:04.088Z [Rudder] debug: no existing flush timer, creating new one
2024-06-15T05:46:13.443Z | debug    | Wait tracker querying database for waiting executions "{ file: 'WaitTracker.js', function: 'getWaitingExecutions' }"
2024-06-15T05:46:14.089Z [Rudder] debug: in flush
2024-06-15T05:46:14.090Z [Rudder] debug: cancelling existing flushTimer...

      
     

@IlIllIlIllIlIIl Those sound like DNS issues, possibly unrelated to the undefined error.
Can you please try the docker image n8nio/n8n:enable-keepAlive to see if the network issues are resolved for you there?

@alexroot @IlIllIlIllIlIIl do you have any community nodes installed ?
Looking at the stacktraces, it looks like you managed to install a second (possibly older and incompatible) version on n8n-nodes-base in /home/node/.n8n/nodes/node_modules/n8n-nodes-base.
If you installed a community node via the UI, then please send me the names of those packages, so that I can get them fixed.
To resolve this issue, I recommend removing community nodes until we have gotten them updated.
I can also try to put another check in n8n itself to prevent issues like these in the future.

I am having a very similar issue myself. Here are the community nodes I currently have installed via the web UI:

n8n-nodes-directus
n8n-nodes-google-service-account-dynamic-impersonate
n8n-nodes-gravityforms
n8n-nodes-iterator
n8n-nodes-splitinbatches-advanced

2024-06-17T15:11:49.411Z | debug    | Wait tracker querying database for waiting executions "{ file: 'WaitTracker.js', function: 'getWaitingExecutions' }"
ResponseError: The requested webhook "POST [webhook-path]/:dynamic-value" is not registered.
    at ActiveWebhooks.findWebhook (/usr/local/lib/node_modules/n8n/dist/ActiveWebhooks.js:128:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ActiveWebhooks.findAccessControlOptions (/usr/local/lib/node_modules/n8n/dist/ActiveWebhooks.js:60:25)
    at /usr/local/lib/node_modules/n8n/dist/WebhookHelpers.js:76:29

I replaced [webhhook-path].

I also get this error

2024-06-17T15:13:58.907Z | error    | Failed to renew license: renewal failed because current cert is not initialized "{\n  stack: 'Error: renewal failed because current cert is not initialized\\n' +\n    '    at p._renew (/usr/local/lib/node_modules/n8n/node_modules/@n8n_io/license-sdk/dist/LicenseManager.js:29:3103)\\n' +\n    '    at p.renew (/usr/local/lib/node_modules/n8n/node_modules/@n8n_io/license-sdk/dist/LicenseManager.js:29:2983)\\n' +\n    '    at License.renew (/usr/local/lib/node_modules/n8n/dist/License.js:184:28)\\n' +\n    '    at LicenseService.renewLicense (/usr/local/lib/node_modules/n8n/dist/license/license.service.js:66:32)\\n' +\n    '    at LicenseController.renewLicense (/usr/local/lib/node_modules/n8n/dist/license/license.controller.js:28:35)\\n' +\n    '    at handler (/usr/local/lib/node_modules/n8n/dist/decorators/registerController.js:76:78)\\n' +\n    '    at /usr/local/lib/node_modules/n8n/dist/ResponseHelper.js:105:32\\n' +\n    '    at newFn (/usr/local/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)\\n' +\n    '    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\\n' +\n    '    at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:149:13)',\n  file: 'license.service.js',\n  function: 'mapErrorMessage'\n}"
2024-06-17T15:13:58.908Z [Rudder] debug: no existing flush timer, creating new one
2024-06-17T15:14:08.908Z [Rudder] debug: in flush
2024-06-17T15:14:08.908Z [Rudder] debug: cancelling existing flushTimer...

I tried checking if it’s any kind of proxy issue, but even locally, I get the same error. (Technically my Cloudflared tunnel is not a reverse proxy…)

I have the latest version, 1.45.1, running via docker-compose.

Thanks for the detailed report @marcel :heart_decoration:

Can you please also go into the .n8n/nodes folder (were all these community nodes are installed), run npm ls --depth=3, and share the output with us.

Thanks for your reply, here’s what I got:

~/.n8n/nodes $  npm ls --depth=3
[email protected] /home/node/.n8n/nodes
+-- [email protected]
+-- [email protected]
+-- [email protected]
| `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected] deduped
|   +-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected] deduped
|   | +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   +-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected] deduped
|   | +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected] deduped
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected] deduped
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected] deduped
|   | +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   `-- [email protected]
+-- [email protected]
`-- [email protected]
  `-- [email protected]
    +-- @eslint-community/[email protected]
    | +-- [email protected] deduped
    | `-- [email protected] deduped
    +-- @eslint-community/[email protected]
    +-- @eslint/[email protected]
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | +-- [email protected]
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | `-- [email protected]
    +-- @eslint/[email protected]
    +-- @humanwhocodes/[email protected]
    | +-- @humanwhocodes/[email protected]
    | +-- [email protected] deduped
    | `-- [email protected] deduped
    +-- @humanwhocodes/[email protected]
    +-- @nodelib/[email protected]
    | +-- @nodelib/[email protected]
    | `-- [email protected]
    +-- @ungap/[email protected]
    +-- [email protected]
    | +-- [email protected] deduped
    | +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | `-- [email protected] deduped
    +-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | +-- [email protected]
    | `-- [email protected] deduped
    +-- [email protected]
    | `-- [email protected] deduped
    +-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    | `-- [email protected] deduped
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | +-- @aashutoshrathi/[email protected]
    | +-- [email protected]
    | +-- [email protected]
    | +-- [email protected] deduped
    | +-- [email protected] deduped
    | `-- [email protected] deduped
    +-- [email protected]
    | `-- [email protected]
    `-- [email protected]

To expand my comment from earlier regarding the Cloudflared proxy tunnel vs local access, I get the same error “Internal Server Error”, but also learned that the Web UI is no longer accessible via my Tailscale config (since it doesn’t have SSL cert configured) and N8N_SECURE_COOKIE env variable is new to me!