N8n crashes when HTTP node is using Mattermost credentials

Describe the issue/error/question

n8n crashes and the container restarts, as soon as the workflow shown below is executed.

What is the error message (if any)?

Server console:

2023-03-10T07:26:45.192144400Z 
2023-03-10T07:26:45.192167400Z Editor is now accessible via:
2023-03-10T07:26:45.192172600Z http://localhost:5678/
2023-03-10T07:26:45.192175900Z 
2023-03-10T07:26:45.192178900Z Manual executions will be visible only for the owner
2023-03-10T07:26:49.869117100Z Attempt to read execution was blocked due to insufficient permissions
2023-03-10T07:26:56.212426300Z Attempt to read execution was blocked due to insufficient permissions
2023-03-10T07:28:34.479115200Z /usr/local/lib/node_modules/n8n/dist/ErrorReporting.js:59
2023-03-10T07:28:34.479177300Z             throw error;
2023-03-10T07:28:34.479200800Z             ^
2023-03-10T07:28:34.479204300Z 
2023-03-10T07:28:34.479207500Z TypeError: res.destroy is not a function
2023-03-10T07:28:34.479210500Z     at TLSSocket.socketCloseListener (node:_http_client:454:11)
2023-03-10T07:28:34.479213600Z     at TLSSocket.emit (node:events:525:35)
2023-03-10T07:28:34.479216600Z     at TLSSocket.emit (node:domain:552:15)
2023-03-10T07:28:34.479228300Z     at node:net:301:12
2023-03-10T07:28:34.479231700Z     at TCP.done (node:_tls_wrap:588:7)
2023-03-10T07:28:34.479234900Z     at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
2023-03-10T07:28:45.545615900Z Last session crashed
2023-03-10T07:28:56.205266700Z Initializing n8n process
2023-03-10T07:28:57.970611400Z Diagnostics frontend config is invalid
2023-03-10T07:28:59.572324100Z n8n ready on 0.0.0.0, port 5678
2023-03-10T07:28:59.572381600Z Version: 0.219.0

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.219.0
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hey @shrey-42,

Can you share your config options and roll back to 218 to see if it works there.

Hey @Jon ,

Rolled back to 218 and tried again.
The HTTP request works fine this time (well, there was an issue with one of the parameters being passed, and that was prompting the n8n crash…but in 218, it simply gives an error instead of crashing).

Sharing the config in a bit.

The config:

POSTGRES_USER=root_user
POSTGRES_PASSWORD=<password>
POSTGRES_DB=n8n

POSTGRES_NON_ROOT_USER=non_root_user
POSTGRES_NON_ROOT_PASSWORD=<password>

N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=<password>

NODE_FUNCTION_ALLOW_EXTERNAL=lodash,dayjs,twitter-api-sdk,he,html-to-image,axios,form-data,text-to-image,canvas,jimp,handlebars,object-deep-compare,deep-diff-pizza,jsonwebtoken,puppeteer,chance,xlsx,jsdom,cheerio,@bitwarden/cli
GENERIC_TIMEZONE=Asia/Calcutta
N8N_DEFAULT_LOCALE=en-IN

EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true

N8N_DEFAULT_BINARY_DATA_MODE=filesystem
N8N_BINARY_DATA_TTL=720
N8N_PERSISTED_BINARY_DATA_TTL=7200

N8N_USER_MANAGEMENT_DISABLED=true

What is the error you see in 218?

{
    "status": "rejected",
    "reason": {
        "message": "Bad request - please check your parameters",
        "timestamp": 1678435619194,
        "name": "NodeApiError",
        "description": "400 - \"{\\\"id\\\":\\\"model.team.is_valid.characters.app_error\\\",\\\"message\\\":\\\"Name must be 2 or more lowercase alphanumeric characters.\\\",\\\"detailed_error\\\":\\\"\\\",\\\"request_id\\\":\\\"6618fj8mafbobc7oxbw6zcxy5e\\\",\\\"status_code\\\":400}\"",
        "context": {},
        "cause": {
            "message": "400 - \"{\\\"id\\\":\\\"model.team.is_valid.characters.app_error\\\",\\\"message\\\":\\\"Name must be 2 or more lowercase alphanumeric characters.\\\",\\\"detailed_error\\\":\\\"\\\",\\\"request_id\\\":\\\"6618fj8mafbobc7oxbw6zcxy5e\\\",\\\"status_code\\\":400}\"",
            "name": "Error",
            "stack": "Error: 400 - \"{\\\"id\\\":\\\"model.team.is_valid.characters.app_error\\\",\\\"message\\\":\\\"Name must be 2 or more lowercase alphanumeric characters.\\\",\\\"detailed_error\\\":\\\"\\\",\\\"request_id\\\":\\\"6618fj8mafbobc7oxbw6zcxy5e\\\",\\\"status_code\\\":400}\"\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:525:35)\n    at IncomingMessage.emit (node:domain:552:15)\n    at endReadableNT (node:internal/streams/readable:1358:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
        }
    }
}

Well that is very different and a bit unexpected, @netroy any thoughts on this one?

@shrey-42 Can you please add these to your env variables (so that the error gets logged in the console), and run the workflow on 0.219 again?

N8N_LOG_LEVEL=debug
N8N_DIAGNOSTICS_ENABLED=false
N8N_SENTRY_DSN=

@netroy

2023-03-10T09:50:05.470Z | verbose  | Execution for workflow My workflow 91 was assigned id 37770 "{\n  executionId: '37770',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
2023-03-10T09:50:05.470Z | verbose  | Execution for workflow My workflow 91 was assigned id 37770 "{\n  executionId: '37770',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
2023-03-10T09:50:05.481Z | debug    | Execution ID 37770 will run executing all nodes. "{\n  executionId: '37770',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
2023-03-10T09:50:05.483Z | verbose  | Workflow execution started "{\n  workflowId: '111',\n  file: 'WorkflowExecute.js',\n  function: 'processRunExecutionData'\n}"
2023-03-10T09:50:05.489Z | debug    | Executing hook (hookFunctionsPush) "{\n  executionId: '37770',\n  sessionId: 'fqtnw6m084l',\n  workflowId: '111',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteBefore'\n}"
2023-03-10T09:50:05.489Z | debug    | Send data of type "executionStarted" to editor-UI "{\n  dataType: 'executionStarted',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:05.494Z | debug    | Start processing node "When clicking "Execute Workflow"" "{\n  node: 'When clicking \"Execute Workflow\"',\n  workflowId: '111',\n  file: 'WorkflowExecute.js'\n}"
2023-03-10T09:50:05.495Z | debug    | Executing hook on node "When clicking "Execute Workflow"" (hookFunctionsPush) "{\n  executionId: '37770',\n  sessionId: 'fqtnw6m084l',\n  workflowId: '111',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
2023-03-10T09:50:05.495Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:05.497Z | debug    | Running node "When clicking "Execute Workflow"" started "{\n  node: 'When clicking \"Execute Workflow\"',\n  workflowId: '111',\n  file: 'WorkflowExecute.js'\n}"
2023-03-10T09:50:05.499Z | debug    | Running node "When clicking "Execute Workflow"" finished successfully "{\n  node: 'When clicking \"Execute Workflow\"',\n  workflowId: '111',\n  file: 'WorkflowExecute.js'\n}"
2023-03-10T09:50:05.501Z | debug    | Executing hook on node "When clicking "Execute Workflow"" (hookFunctionsPush) "{\n  executionId: '37770',\n  sessionId: 'fqtnw6m084l',\n  workflowId: '111',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
2023-03-10T09:50:05.501Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:05.502Z | debug    | Save execution progress to database for execution ID 37770  "{\n  executionId: '37770',\n  nodeName: 'When clicking \"Execute Workflow\"',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
2023-03-10T09:50:05.601Z | debug    | Start processing node "HTTP Request" "{ node: 'HTTP Request', workflowId: '111', file: 'WorkflowExecute.js' }"
2023-03-10T09:50:05.601Z | debug    | Executing hook on node "HTTP Request" (hookFunctionsPush) "{\n  executionId: '37770',\n  sessionId: 'fqtnw6m084l',\n  workflowId: '111',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
2023-03-10T09:50:05.602Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:05.604Z | debug    | Running node "HTTP Request" started "{ node: 'HTTP Request', workflowId: '111', file: 'WorkflowExecute.js' }"
2023-03-10T09:50:05.608Z | debug    | Send data of type "sendConsoleMessage" to editor-UI "{\n  dataType: 'sendConsoleMessage',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:05.638Z | debug    | Proxying request to axios "{ file: 'NodeExecuteFunctions.js', function: 'proxyRequestToAxios' }"
2023-03-10T09:50:06.650Z | debug    | Request proxied to Axios failed "{\n  status: 400,\n  file: 'NodeExecuteFunctions.js',\n  function: 'proxyRequestToAxios'\n}"
2023-03-10T09:50:06.660Z | debug    | Running node "HTTP Request" finished with error "{ node: 'HTTP Request', workflowId: '111', file: 'WorkflowExecute.js' }"
2023-03-10T09:50:06.660Z | debug    | Executing hook on node "HTTP Request" (hookFunctionsPush) "{\n  executionId: '37770',\n  sessionId: 'fqtnw6m084l',\n  workflowId: '111',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
2023-03-10T09:50:06.661Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionId: 'fqtnw6m084l',\n  file: 'abstract.push.js',\n  function: 'send'\n}"
2023-03-10T09:50:06.664Z | debug    | Save execution progress to database for execution ID 37770  "{\n  executionId: '37770',\n  nodeName: 'HTTP Request',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
TypeError: res.destroy is not a function
    at TLSSocket.socketCloseListener (node:_http_client:454:11)
    at TLSSocket.emit (node:events:525:35)
    at TLSSocket.emit (node:domain:552:15)
    at node:net:301:12
    at TCP.done (node:_tls_wrap:588:7)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
2023-03-10T09:50:18.577Z | error    | Last session crashed "{ file: 'CrashJournal.js', function: 'init' }"
2023-03-10T09:50:28.709Z | debug    | Lazy Loading credentials and nodes from n8n-nodes-base "{\n  credentials: 311,\n  nodes: 395,\n  file: 'DirectoryLoader.js',\n  function: 'loadAll'\n}"
2023-03-10T09:50:28.779Z | debug    | No codex available for: Test.node.js "{ file: 'DirectoryLoader.js', function: 'addCodex' }"
2023-03-10T09:50:29.162Z | info     | Initializing n8n process "{ file: 'start.js', function: 'init' }"
2023-03-10T09:50:31.193Z | debug    | Wait tracker querying database for waiting executions "{ file: 'WaitTracker.js', function: 'getWaitingExecutions' }"
2023-03-10T09:50:31.739Z | debug    | [license] initializing for deviceFingerprint 64f7cfe33f90f44483e328859f53f0705f5fda615c80e763ea5150cd6c4510ac "{ file: 'LicenseManager.js', function: 'log' }"
2023-03-10T09:50:32.238Z | debug    | Initializing event bus... "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-03-10T09:50:32.455Z | debug    | Initializing event writer "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-03-10T09:50:32.462Z | debug    | Checking for unsent event messages "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-03-10T09:50:32.521Z | debug    | Start logging into /home/node/.n8n/n8nEventLog.log  "{ file: 'MessageEventBus.js', function: 'initialize' }"
2023-03-10T09:50:32.829Z | debug    | MessageEventBus initialized "{ file: 'MessageEventBus.js', function: 'initialize' }"
n8n ready on 0.0.0.0, port 5678
Version: 0.219.0
1 Like

Fix got released with new version [email protected] got released which includes the GitHub PR 5663.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.