naskio / n8n-nodes-influxdb

InfluxDB 2.x node for n8n.
https://www.npmjs.com/package/n8n-nodes-influxdb
MIT License
8 stars 1 forks source link

ERROR: Cannot read properties of undefined (reading 'map') #2

Open test123-all opened 1 year ago

test123-all commented 1 year ago

Hey, I happily found your influxdb node for n8n. But I can't get the block to work. Since there is no documentation, am I doing something wrong? Screenshot_20230122_161608

I get the following error:

ERROR: Cannot read properties of undefined (reading 'map')

Stack
TypeError: Cannot read properties of undefined (reading 'map')
    at Object.execute (/home/node/.n8n/nodes/node_modules/n8n-nodes-influxdb/nodes/InfluxDb/InfluxDb.node.ts:50:78)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:659:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:585:53

I tried the following:

The code/JSON to reproduce my not working minimal example n8n block workflow is:

{
  "meta": {
    "instanceId": "b4c0477d9c77b502d994bf5d4f1a071143b79c0201f8c81c86a75fe53af936a4"
  },
  "nodes": [
    {
      "parameters": {
        "measurement": "=measurementName",
        "tags": "=heightTag",
        "fields": "=heightField",
        "options": {
          "timestampField": "=timestamp_test"
        }
      },
      "id": "25bbe152-61cb-4116-9a44-cbe6fea27ab3",
      "name": "InfluxDB",
      "type": "n8n-nodes-influxdb.influxDb",
      "typeVersion": 1,
      "position": [
        1960,
        80
      ],
      "credentials": {
        "influxDb": {
          "id": "1",
          "name": "InfluxDB 2.x account"
        }
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "measurementName",
              "value": "test_measurement"
            },
            {
              "name": "heightTag",
              "value": "cm"
            },
            {
              "name": "timestamp_test",
              "value": "2023-01-22T00:20:46+0000"
            }
          ],
          "number": [
            {
              "name": "heightField",
              "value": 100
            }
          ]
        },
        "options": {}
      },
      "id": "50361251-e837-48d9-a79e-367293182727",
      "name": "Set1",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1700,
        80
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "id": "f8e898d3-26eb-4ef0-8fbd-807a2c62122e",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        1440,
        80
      ]
    }
  ],
  "connections": {
    "Set1": {
      "main": [
        [
          {
            "node": "InfluxDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Set1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Kind regards

Benjamin-Hofftoth commented 1 year ago

Same Issue on my side:

TypeError: Cannot read properties of undefined (reading 'map') at Object.execute (/home/XX/.n8n/nodes/node_modules/n8n-nodes-influxdb/nodes/InfluxDb/InfluxDb.node.ts:50:78) at Workflow.runNode (/home/XX/.npm/_npx/a8a7eec953f1f314/node_modules/n8n-workflow/src/Workflow.ts:1270:19) at /home/XX.npm/_npx/a8a7eec953f1f314/node_modules/n8n-core/src/WorkflowExecute.ts:939:29

Bildschirmfoto vom 2023-01-25 11-24-54

JaCoB1123 commented 1 year ago

I just had the same problem and the solution for me was adding a default tag and supplying any value.