Skip to content

HTTP Request Node - "TypeError: Converting circular structure to JSON" #3089

Description

@mark-monteiro

Describe the bug
After updating tot he latest version, the HTTP Request node in my workflow now always crashes with the error message "Workflow execution process did crash for an unknown reason!"

The log file on the server has an error message TypeError: Converting circular structure to JSON. The relevant log and stack trace has been included below.

To Reproduce
Steps to reproduce the behavior:

  1. Create HTTP request node with code below
  2. Execute node and see error

Http request node configuration:

{
  "nodes": [
    {
      "parameters": {
        "authentication": "oAuth2",
        "requestMethod": "PATCH",
        "url": "=https://www.googleapis.com/upload/drive/v3/files/{{$json[\"googleDriveFileId\"]}}",
        "allowUnauthorizedCerts": true,
        "options": {
          "fullResponse": true
        },
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "mimeType",
              "value": "application/vnd.google-apps.spreadsheet"
            }
          ]
        },
        "queryParametersUi": {
          "parameter": [
            {
              "name": "uploadType",
              "value": "resumable"
            }
          ]
        }
      },
      "name": "Start Upload To Drive (Metadata)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        500,
        320
      ],
      "credentials": {
        "oAuth2Api": {
          "id": "7",
          "name": "Google Drive Update API"
        }
      },
      "notes": "Details on how xlsx file is converted to Google Sheet: https://stackoverflow.com/a/36957953/1988326"
    }
  ],
  "connections": {}
}

Expected behavior
Node should not crash with an unhandled exception.

Environment (please complete the following information):

  • OS: Docker image on Ubuntu host
  • n8n Version: 0.171.0
  • Node.js Version: Deployed with docker image
  • Database system: SQLite (default)
  • Operation mode: own (default)

Additional context
Logs + stacktrace:

n8n    | 2022-04-04T20:07:02.430Z | debug    | Received child process message of type start for execution ID 3601. {"executionId":"3601","file":"WorkflowRunner.js"}
n8n    | 2022-04-04T20:07:02.440Z | verbose  | Initializing n8n sub-process {"pid":198,"workflowId":"8","file":"WorkflowRunnerProcess.js","function":"runWorkflow"}
n8n    | 2022-04-04T20:07:02.709Z | verbose  | Workflow execution started {"workflowId":"8","file":"WorkflowExecute.js","function":"processRunExecutionData"}
n8n    | 2022-04-04T20:07:02.712Z | debug    | Received child process message of type processHook for execution ID 3601. {"executionId":"3601","file":"WorkflowRunner.js"}
n8n    | 2022-04-04T20:07:02.712Z | debug    | Executing hook (hookFunctionsPush) {"executionId":"3601","sessionId":"y8wf57iym9","workflowId":"8","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteBefore"}
n8n    | 2022-04-04T20:07:02.713Z | debug    | Send data of type "executionStarted" to editor-UI {"dataType":"executionStarted","sessionId":"y8wf57iym9","file":"Push.js","function":"send"}
n8n    | 2022-04-04T20:07:02.712Z | debug    | Start processing node "Start Upload To Drive (Metadata)" {"node":"Start Upload To Drive (Metadata)","workflowId":"8","file":"WorkflowExecute.js"}
n8n    | 2022-04-04T20:07:02.713Z | debug    | Received child process message of type processHook for execution ID 3601. {"executionId":"3601","file":"WorkflowRunner.js"}
n8n    | 2022-04-04T20:07:02.713Z | debug    | Executing hook on node "Start Upload To Drive (Metadata)" (hookFunctionsPush) {"executionId":"3601","sessionId":"y8wf57iym9","workflowId":"8","file":"WorkflowExecuteAdditionalData.js","function":"nodeExecuteBefore"}
n8n    | 2022-04-04T20:07:02.713Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI {"dataType":"nodeExecuteBefore","sessionId":"y8wf57iym9","file":"Push.js","function":"send"}
n8n    | 2022-04-04T20:07:02.713Z | debug    | Running node "Start Upload To Drive (Metadata)" started {"node":"Start Upload To Drive (Metadata)","workflowId":"8","file":"WorkflowExecute.js"}
n8n    | 2022-04-04T20:07:02.760Z | debug    | Received child process message of type sendMessageToUI for execution ID 3601. {"executionId":"3601","file":"WorkflowRunner.js"}
n8n    | 2022-04-04T20:07:02.760Z | debug    | Send data of type "sendConsoleMessage" to editor-UI {"dataType":"sendConsoleMessage","sessionId":"y8wf57iym9","file":"Push.js","function":"send"}
n8n    | 2022-04-04T20:07:02.770Z | debug    | Proxying request to axios {"file":"NodeExecuteFunctions.js","function":"proxyRequestToAxios"}
n8n    | /usr/local/lib/node_modules/n8n/dist/src/Logger.js:20
n8n    |                     return `${timestamp} | ${level.padEnd(18)} | ${message}${Object.keys(metadata).length ? ` ${JSON.stringify(metadata)}` : ''}`;
n8n    |
      ^
n8n    |
n8n    | TypeError: Converting circular structure to JSON
n8n    |     --> starting at object with constructor 'TLSSocket'
n8n    |     |     property '_httpMessage' -> object with constructor 'ClientRequest'
n8n    |     --- property 'socket' closes the circle
n8n    |     at JSON.stringify (<anonymous>)
n8n    |     at Printf.template (/usr/local/lib/node_modules/n8n/dist/src/Logger.js:20:118)
n8n    |     at Printf.transform (/usr/local/lib/node_modules/n8n/node_modules/logform/printf.js:11:26)
n8n    |     at Format.transform (/usr/local/lib/node_modules/n8n/node_modules/logform/combine.js:20:24)
n8n    |     at Console._write (/usr/local/lib/node_modules/n8n/node_modules/winston-transport/index.js:91:33)
n8n    |     at doWrite (/usr/local/lib/node_modules/n8n/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:409:139)
n8n    |     at writeOrBuffer (/usr/local/lib/node_modules/n8n/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:398:5)
n8n    |     at Console.Writable.write (/usr/local/lib/node_modules/n8n/node_modules/winston-transport/node_modules/readable-stream/lib/_stream_writable.js:307:11)
n8n    |     at DerivedLogger.ondata (/usr/local/lib/node_modules/n8n/node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js:681:20)
n8n    |     at DerivedLogger.emit (node:events:526:28)
n8n    | 2022-04-04T20:07:02.977Z | debug    | Subprocess for execution ID 3601 finished with error code 1. {"executionId":"3601","file":"WorkflowRunner.js"}
n8n    | 2022-04-04T20:07:02.977Z | debug    | Executing hook (hookFunctionsSave) {"executionId":"3601","workflowId":"8","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter"}
n8n    | 2022-04-04T20:07:02.980Z [Rudder] debug: no existing flush timer, creating new one
n8n    | 2022-04-04T20:07:03.037Z | debug    | Executing hook (hookFunctionsPush) {"executionId":"3601","sessionId":"y8wf57iym9","workflowId":"8","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter"}
n8n    | 2022-04-04T20:07:03.038Z | debug    | Save execution progress to database for execution ID 3601  {"executionId":"3601","workflowId":"8","file":"WorkflowExecuteAdditionalData.js","function":"workflowExecuteAfter"}
n8n    | 2022-04-04T20:07:03.038Z | debug    | Send data of type "executionFinished" to editor-UI {"dataType":"executionFinished","sessionId":"y8wf57iym9","file":"Push.js","function":"send"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions