influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.48k stars 5.54k forks source link

IoTDB output plugin not inserting records - 'root is not a legal path' #14057

Closed ccroitor closed 10 months ago

ccroitor commented 11 months ago

Relevant telegraf.conf

# Save metrics to an IoTDB Database
[[outputs.iotdb]]
  ## Configuration of IoTDB server connection
  host = "127.0.0.1"
  port = "6667"

  ## Configuration of authentication
  user = "root"
  password = "root"

  ## Timeout to open a new session.
  ## A value of zero means no timeout.
  timeout = "60s"

  ## Configuration of type conversion for 64-bit unsigned int
  ## IoTDB currently DOES NOT support unsigned integers (version 13.x).
  ## 32-bit unsigned integers are safely converted into 64-bit signed integers by the plugin,
  ## however, this is not true for 64-bit values in general as overflows may occur.
  ## The following setting allows to specify the handling of 64-bit unsigned integers.
  ## Available values are:
  ##   - "int64"       --  convert to 64-bit signed integers and accept overflows
  ##   - "int64_clip"  --  convert to 64-bit signed integers and clip the values on overflow to 9,223,372,036,854,775,807
  ##   - "text"        --  convert to the string representation of the value
  uint64_conversion = "int64"

  ## Configuration of TimeStamp
  ## TimeStamp is always saved in 64bits int. timestamp_precision specifies the unit of timestamp.
  ## Available value:
  ## "second", "millisecond", "microsecond", "nanosecond"(default)
  timestamp_precision = "millisecond"

  ## Handling of tags
  ## Tags are not fully supported by IoTDB.
  ## A guide with suggestions on how to handle tags can be found here:
  ##     https://iotdb.apache.org/UserGuide/Master/API/InfluxDB-Protocol.html
  ##
  ## Available values are:
  ##   - "fields"     --  convert tags to fields in the measurement
  ##   - "device_id"  --  attach tags to the device ID
  ##
  ## For Example, a metric named "root.sg.device" with the tags `tag1: "private"`  and  `tag2: "working"` and
  ##  fields `s1: 100`  and `s2: "hello"` will result in the following representations in IoTDB
  ##   - "fields"     --  root.sg.device, s1=100, s2="hello", tag1="private", tag2="working"
  ##   - "device_id"  --  root.sg.device.private.working, s1=100, s2="hello"
  convert_tags_to = "fields"

Logs from Telegraf

2023-10-06T11:48:54Z I! Loading config: /etc/telegraf/telegraf.conf
2023-10-06T11:48:54Z I! Starting Telegraf 1.28.2 brought to you by InfluxData the makers of InfluxDB
2023-10-06T11:48:54Z I! Available plugins: 240 inputs, 9 aggregators, 29 processors, 24 parsers, 59 outputs, 5 secret-stores
2023-10-06T11:48:54Z I! Loaded inputs: snmp
2023-10-06T11:48:54Z I! Loaded aggregators:
2023-10-06T11:48:54Z I! Loaded processors:
2023-10-06T11:48:54Z I! Loaded secretstores:
2023-10-06T11:48:54Z I! Loaded outputs: influxdb iotdb
2023-10-06T11:48:54Z I! Tags enabled: host=iotdb
2023-10-06T11:48:54Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"iotdb", Flush Interval:10s
2023-10-06T11:48:54Z D! [agent] Initializing plugins
2023-10-06T11:48:54Z I! [outputs.iotdb] Initialization completed.
2023-10-06T11:48:54Z D! [agent] Connecting outputs
2023-10-06T11:48:54Z D! [agent] Attempting connection to [outputs.iotdb]
2023-10-06T11:48:54Z D! [agent] Successfully connected to outputs.iotdb
2023-10-06T11:48:54Z D! [agent] Attempting connection to [outputs.influxdb]
2023-10-06T11:48:54Z D! [agent] Successfully connected to outputs.influxdb
2023-10-06T11:48:54Z D! [agent] Starting service inputs
2023-10-06T11:49:04Z D! [outputs.iotdb] Error Code: 301, Message: [EXECUTE_STATEMENT_ERROR(301)] Exception occurred: insertRecords failed. An error occurred when executing getDeviceToStorageGroup():root is not a legal path
2023-10-06T11:49:04Z D! [outputs.iotdb] Wrote batch of 1 metrics in 18.124118ms
2023-10-06T11:49:04Z D! [outputs.iotdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:04Z D! [outputs.influxdb] Wrote batch of 1 metrics in 35.034458ms
2023-10-06T11:49:04Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:14Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:14Z D! [outputs.iotdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:24Z D! [outputs.iotdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:24Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:34Z D! [outputs.iotdb] Error Code: 301, Message: [EXECUTE_STATEMENT_ERROR(301)] Exception occurred: insertRecords failed. An error occurred when executing getDeviceToStorageGroup():root is not a legal path
2023-10-06T11:49:34Z D! [outputs.iotdb] Wrote batch of 1 metrics in 8.466371ms
2023-10-06T11:49:34Z D! [outputs.iotdb] Buffer fullness: 0 / 10000 metrics
2023-10-06T11:49:34Z D! [outputs.influxdb] Wrote batch of 1 metrics in 85.080816ms
2023-10-06T11:49:34Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics

System info

Ubuntu 22.04.3 LTS, Telegraf 1.28.2, IoTDB version 1.2.1

Docker

No response

Steps to reproduce

  1. Install IoTDB 1.2.1 standalone
  2. Install Telegraf 1.28.2
  3. Configure Telegraf input (in our case SNMP) and output to IoTDB
  4. The IoTDB fails to write to exiting timeseries or to create automatically new ones

Expected behavior

We expect datapoints to be written to IoTDB timeseries.

Actual behavior

Write record fails.

IoTDB /etc/iotdb/logs/log_datanode_all.log:

2023-10-06 11:59:33,959 [pool-32-IoTDB-ClientRPC-Processor-1] WARN o.a.i.d.u.ErrorHandlingUtils:63 - Status code: EXECUTE_STATEMENT_ERROR(301), operation: insertRecords failed org.apache.iotdb.db.exception.sql.StatementAnalyzeException: An error occurred when executing getDeviceToStorageGroup():root is not a legal path

Additional info

No response

ccroitor commented 11 months ago

Other methods to write to the same IoTDB work, such as python script to IoTDB's REST API v2.

powersj commented 11 months ago

The error message from iotdb is:

getDeviceToStorageGroup():root is not a legal path

Looking at the Path Data Model, the parens are not valid.

Other methods to write to the same IoTDB work, such as python script to IoTDB's REST API v2.

Are you trying to write to this same path?

telegraf-tiger[bot] commented 10 months ago

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Forums or provide additional details in this issue and reqeust that it be re-opened. Thank you!