Mautic Error

ERROR: Mautic Error: {}

Error: Mautic Error: {}
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Mautic/Mautic.node.js:116:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Not sure what this means.

Hm, it looks like n8n receives some kind of error from the Mautic API but for some reason it does not return the actual error-message. Do you get it with all requests you make to Mautic or just with a specific one?

Tests seem to work. Let me try again. I will also dig into Mautic logs later and see.

My best guess (without knowing and seeing more) would be that some kind of input data that gets supplied has a different format than they expect.

What I am sure, however, is that the error handling is not working correctly in the Mautic-Node. Will fix that.

1 Like

Here is the real request:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        360,
        230
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "try",
        "responseMode": "lastNode",
        "options": {
          "rawBody": true
        }
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        560,
        240
      ]
    },
    {
      "parameters": {
        "email": "={{$node[\"Webhook\"].data[\"body\"][\"visitor\"][\"email\"]}}",
        "firstName": "=",
        "lastName": "={{$node[\"Webhook\"].data[\"body\"][\"visitor\"][\"name\"]}}",
        "additionalFields": {},
        "options": {}
      },
      "name": "Mautic",
      "type": "n8n-nodes-base.mautic",
      "typeVersion": 1,
      "position": [
        970,
        240
      ],
      "credentials": {
        "mauticApi": "FF Mautic Basic Auth"
      }
    },
    {
      "parameters": {
        "functionCode": "item.myVariable = item.body.visitor.email;\nreturn item;"
      },
      "name": "FunctionItem",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        770,
        240
      ]
    },
    {
      "parameters": {
        "fromEmail": "[email protected]",
        "toEmail": "[email protected]",
        "subject": "Testing",
        "text": "=testing {{$node[\"Webhook\"].data[\"body\"][\"visitor\"][\"email\"]}} {{$node[\"Webhook\"].data[\"body\"][\"visitor\"][\"username\"]}}",
        "options": {}
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 1,
      "position": [
        1120,
        240
      ],
      "credentials": {
        "smtp": "Sendgrid SMTP"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "FunctionItem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mautic": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem": {
      "main": [
        [
          {
            "node": "Mautic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Here is a screenshot of the Mautic node messing up on a live execution

Here is a successful test

It seems to have something to do with the email address perhaps. I am not sure why though. It’s like the module isn’t getting the address from the expression properly.

Yes is for sure the email. It expects a string but it receives an object. So looks like in the live-execution the email gets submitted differently than in your test.

1 Like

Yes you’re correct. Thanks for helping me double check that. I will have to mark that as a bug over at RocketChat’s support.

You are welcome! Happy to help!

Btw. fixed the Mautic error reporting. Will work now fine in the next version that gets released.

1 Like

Got released with [email protected]