{"record":{"id":"2aabc8622b99023a","repo":"t8y2/dbx","slug":"iotdb-show-variables-did-not-return-timestamppreci","errorCode":null,"errorMessage":"IoTDB SHOW VARIABLES did not return TimestampPrecision","messagePattern":"IoTDB SHOW VARIABLES did not return TimestampPrecision","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/iotdb/driver.go","lineNumber":296,"sourceCode":"\t}\n\tdefer dataset.Close()\n\tcolumns := dataset.GetColumnNames()\n\tvariableIndex, valueIndex := int32(1), int32(2)\n\tfor index, column := range columns {\n\t\tswitch strings.ToLower(strings.TrimSpace(column)) {\n\t\tcase \"variable\":\n\t\t\tvariableIndex = int32(index + 1)\n\t\tcase \"value\":\n\t\t\tvalueIndex = int32(index + 1)\n\t\t}\n\t}\n\tfor {\n\t\thasNext, err := dataset.Next()\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif !hasNext {\n\t\t\treturn \"\", errors.New(\"IoTDB SHOW VARIABLES did not return TimestampPrecision\")\n\t\t}\n\t\tvariable, err := dataset.GetStringByIndex(variableIndex)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif !strings.EqualFold(strings.ReplaceAll(strings.TrimSpace(variable), \"_\", \"\"), \"TimestampPrecision\") {\n\t\t\tcontinue\n\t\t}\n\t\tvalue, err := dataset.GetStringByIndex(valueIndex)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif precision := normalizeTimestampPrecision(value); precision != \"\" {\n\t\t\treturn precision, nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"unsupported IoTDB timestamp precision: %s\", value)\n\t}\n}","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/iotdb/driver.go#L278-L314","documentation":"queryTimestampPrecision runs 'SHOW VARIABLES' and scans rows for the TimestampPrecision variable. If the dataset is exhausted without finding that variable name, the driver cannot determine the server's timestamp precision and fails.","triggerScenarios":"The connected IoTDB server version does not expose TimestampPrecision in SHOW VARIABLES (older/newer versions), or the result set ends before the variable row appears.","commonSituations":"Connecting to an older IoTDB release lacking the variable; server configured with restricted variable visibility; driver/server version mismatch.","solutions":["Upgrade or verify the IoTDB server version supports TimestampPrecision in SHOW VARIABLES (check with the CLI: SHOW VARIABLES).","If precision is known/fixed, set it explicitly in connection parameters instead of relying on auto-detection, if the driver supports it.","Match the driver version to the server version (e.g. use an iotdb-session version aligned with the server's)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"precision, err := queryTimestampPrecision(client)\nif err != nil {\n\tif strings.Contains(err.Error(), \"TimestampPrecision\") {\n\t\tlog.Printf(\"server does not expose TimestampPrecision; using default ms\")\n\t\treturn \"ms\", nil // fallback default\n\t}\n\treturn \"\", err\n}","preventionTips":["Pin compatible IoTDB server/driver versions in deployment manifests.","Verify 'SHOW VARIABLES' output includes TimestampPrecision before enabling the driver.","Add a smoke test that connects and checks precision detection against your target server version."],"tags":["iotdb","sql","server-compatibility","timestamp"],"backgroundTag":"server-metadata-missing","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}