googleapis/mcp-toolbox · error

error during row iteration: %w

Error message

error during row iteration: %w

What it means

Runtime failure wrap in Invoke: results.Err() reported an error after the pgx row-iteration loop finished, meaning streaming of the result set aborted mid-way (network drop, context cancellation, or decode failure on later rows).

Source

Thrown at internal/tools/cockroachdb/cockroachdbexecutesql/cockroachdbexecutesql.go:143

	defer results.Close()

	fields := results.FieldDescriptions()

	out := []any{}
	for results.Next() {
		v, err := results.Values()
		if err != nil {
			return nil, util.NewClientServerError("unable to parse row", http.StatusInternalServerError, err)
		}
		row := orderedmap.Row{}
		for i, f := range fields {
			row.Add(f.Name, v[i])
		}
		out = append(out, row)
	}

	if err := results.Err(); err != nil {
		return nil, util.ProcessGeneralError(fmt.Errorf("error during row iteration: %w", err))
	}

	return out, nil
}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Inspect the wrapped error to see whether the connection dropped or the context was cancelled
  2. Add a LIMIT or narrower query to reduce result-set size and retry
  3. Check that column values do not overflow their destination types
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/tools/cockroachdb/cockroachdbexecutesql/cockroachdbexecutesql.go:143 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/5858b8b54631367c. Report an issue: GitHub.