googleapis/mcp-toolbox · error
unable to retrieve rows column name: %w
Error message
unable to retrieve rows column name: %w
What it means
After a successful query, RunSQL calls results.Columns() to read the result set's column names; failure to access result-set metadata is wrapped as "unable to retrieve rows column name". This is rare and usually indicates a broken or already-closed connection/result object rather than a problem with the SQL itself.
Source
Thrown at internal/sources/mindsdb/mindsdb.go:119
func (s *Source) MindsDBPool() *sql.DB {
return s.Pool
}
func (s *Source) MySQLPool() *sql.DB {
return s.Pool
}
func (s *Source) RunSQL(ctx context.Context, statement string, params []any) (any, error) {
// MindsDB now supports MySQL prepared statements natively
results, err := s.MindsDBPool().QueryContext(ctx, statement, params...)
if err != nil {
return nil, fmt.Errorf("unable to execute query: %w", err)
}
cols, err := results.Columns()
if err != nil {
return nil, fmt.Errorf("unable to retrieve rows column name: %w", err)
}
// create an array of values for each column, which can be re-used to scan each row
rawValues := make([]any, len(cols))
values := make([]any, len(cols))
for i := range rawValues {
values[i] = &rawValues[i]
}
defer results.Close()
colTypes, err := results.ColumnTypes()
if err != nil {
return nil, fmt.Errorf("unable to get column types: %w", err)
}
out := []any{}
for results.Next() {
err := results.Scan(values...)View on GitHub (pinned to 8cc6e09de2)
Solutions
- Retry the query — transient connection drops resolve on re-execute
- Check MindsDB server logs for restarts or aborted connections
- Ensure no intermediate proxy terminates idle MySQL connections; enable keepalives
- Verify driver and server protocol versions are compatible
Defensive patterns
Strategy: retry
Try / catch
cols, err := results.Columns()
if err != nil {
// transient: close and retry the query once with backoff
results.Close()
return retryQuery(ctx, statement, params)
} Prevention
- Configure connection pool max-lifetime below proxy idle timeouts
- Enable MySQL keepalive settings in the DSN
- Monitor MindsDB server restarts
When it happens
Trigger: results.Columns() returns an error — typically when the underlying MySQL connection was dropped between execution and metadata read, or the driver returned a corrupt/aborted result set.
Common situations: MindsDB server restarting mid-query; connection killed by proxy/load-balancer idle timeout; driver bug or protocol desync after a large result set.
Related errors
- unable to get column types: %w
- unable to get column types: %w
- unable to retrieve rows column name: %w
- unable to get columns: %w
- unable to create pool: %w
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/ea62b7c0116deaf4.
Report an issue: GitHub.