t8y2/dbx · error

not connected

Error message

not connected

What it means

Bailed by require_connection (TDengine driver) when the operation is invoked while self.connection is None — i.e. connect has not been called or disconnect already ran. All connection-dependent entry points (validate_connection, execute_statements, use_database, cursors) funnel through this guard, so any call before connect or after disconnect fails fast.

Source

Thrown at agents/drivers/tdengine/src/driver.rs:668

            Ok(rows) => rows,
            Err(error) if token.is_cancelled() => return Err(error),
            Err(_) => return Ok(String::new()),
        };
        let Some(row) = rows.first() else {
            return Ok(String::new());
        };
        for value in row.iter().skip(1) {
            if let Some(value) = json_text(value) {
                if value.to_ascii_uppercase().contains("CREATE") {
                    return Ok(value.to_string());
                }
            }
        }
        Ok(row.last().and_then(json_text).unwrap_or_default().to_string())
    }

    fn require_connection(&self) -> Result<&Taos> {
        self.connection.as_ref().ok_or_else(|| anyhow!("not connected"))
    }
}

impl QueryCursor {
    async fn next_row(&mut self, token: &CancellationToken, timeout_secs: u64) -> Result<Option<Vec<Value>>> {
        if self.rows_read >= self.max_rows {
            return Ok(None);
        }
        if let Some(row) = self.pending_row.take() {
            self.rows_read += 1;
            return Ok(Some(row));
        }
        let row = self.next_raw_row(token, timeout_secs).await?;
        if row.is_some() {
            self.rows_read += 1;
        }
        Ok(row)
    }

View on GitHub (pinned to c0390bff16)

Solutions

  1. Call connect with valid ConnectParams before issuing operations
  2. Check for a prior disconnect/close_session that cleared the connection
  3. Retry the operation after re-establishing the session
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agents/drivers/tdengine/src/driver.rs:668 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/a0f3cc64d56496a1. Report an issue: GitHub.