n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.72k stars 7.7k forks source link

ExecuteCommand stdout truncated with big output on node 10 #352

Closed agix closed 4 years ago

agix commented 4 years ago

Describe the bug Stdout of executed command is truncated according to the default maxBuffer options of child_process which is 200 * 1024 in node < v12

To Reproduce Steps to reproduce the behavior: Execute the following workflow on 0.55.1-ubuntu :

{
  "nodes": [
    {
      "parameters": {
        "command": "/bin/bash -c \"printf 'a%.0s' {1..204801}\""
      },
      "name": "Execute Command",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        550,
        570
      ]
    },
    {
      "parameters": {
        "functionCode": "item.stdoutLength = item.stdout.length;\ndelete item.stdout;\nreturn item;"
      },
      "name": "FunctionItem",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        760,
        570
      ]
    }
  ],
  "connections": {
    "Execute Command": {
      "main": [
        [
          {
            "node": "FunctionItem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Expected behavior {"stdoutLength": 204801}

Environment (please complete the following information): 0.55.1-ubuntu

Additional context Either bump the nodejs version of docker-ubuntu to node >= v12 as they increased the default maxBuffer to 1024 * 1024 and/or allow exec options to be passed into ExecuteCommand node type.

janober commented 4 years ago

Thanks a lot @agix !

The regular docker-image uses already Node v12. So the Ubuntu image should actually do the same. So changed the image accordingly.

The next version of n8n will automatically build the image with v12.

agix commented 4 years ago

perfect

Le mar. 10 mars 2020 à 19:47, Jan notifications@github.com a écrit :

Thanks a lot @agix https://github.com/agix !

The regular docker-image uses already Node v12. So the Ubuntu image should actually do the same. So changed the image accordingly.

The next version of n8n will automatically build the image with v12.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/n8n-io/n8n/issues/352?email_source=notifications&email_token=AATQCHZATKMJ6FPO3QIY6UDRG2DK7A5CNFSM4LBDQUY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOMVNXI#issuecomment-597251805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATQCH5MBAKRPMRBDA7ONETRG2DK7ANCNFSM4LBDQUYQ .

janober commented 4 years ago

Got released with n8n@0.56.0