{"record":{"id":"e72832a95cff7516","repo":"googleapis/mcp-toolbox","slug":"unable-to-retrieve-rows-column-name-w-e72832","errorCode":null,"errorMessage":"unable to retrieve rows column name: %w","messagePattern":"unable to retrieve rows column name: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/singlestore/singlestore.go","lineNumber":123,"sourceCode":"\nfunc (s *Source) ToConfig() sources.SourceConfig {\n\treturn s.Config\n}\n\n// SingleStorePool returns the underlying *sql.DB connection pool for SingleStore.\nfunc (s *Source) SingleStorePool() *sql.DB {\n\treturn s.Pool\n}\n\nfunc (s *Source) RunSQL(ctx context.Context, statement string, params []any) (any, error) {\n\tresults, err := s.SingleStorePool().QueryContext(ctx, statement, params...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to execute query: %w\", err)\n\t}\n\n\tcols, err := results.Columns()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to retrieve rows column name: %w\", err)\n\t}\n\n\t// create an array of values for each column, which can be re-used to scan each row\n\trawValues := make([]any, len(cols))\n\tvalues := make([]any, len(cols))\n\tfor i := range rawValues {\n\t\tvalues[i] = &rawValues[i]\n\t}\n\tdefer results.Close()\n\n\tcolTypes, err := results.ColumnTypes()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to get column types: %w\", err)\n\t}\n\n\tout := []any{}\n\tfor results.Next() {\n\t\terr := results.Scan(values...)","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/singlestore/singlestore.go#L105-L141","documentation":"RunSQL wraps results.Columns() errors with this message. Columns() inspects the result set metadata returned by the server; failure means the driver cannot obtain column names for the result set, typically because the connection or result set became invalid right after execution.","triggerScenarios":"QueryContext succeeded but the underlying connection dropped or the result set was invalidated before column metadata could be read.","commonSituations":"Network interruption mid-query, server-side connection kill, very short readTimeout causing the connection to be reaped between query and metadata read.","solutions":["Read the wrapped driver error to confirm whether it is a network/connection issue.","Retry the query; transient connection drops usually succeed on retry.","Increase readTimeout (via queryTimeout config) so slow result metadata does not hit the deadline.","Check server logs for connection kills or proxy/firewall idle timeouts.","Verify SingleStore cluster health and upgrade the go-sql-driver/mysql dependency if the error persists."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := source.RunSQL(ctx, stmt, params)\nif err != nil && strings.Contains(err.Error(), \"unable to retrieve rows column name\") {\n    time.Sleep(500 * time.Millisecond)\n    out, err = source.RunSQL(ctx, stmt, params) // single retry for transient drops\n}\nif err != nil { return err }","preventionTips":["Raise queryTimeout/readTimeout for slow queries","Check LB/proxy idle timeouts","Monitor cluster health for connection kills"],"tags":["singlestore","sql","resultset"],"backgroundTag":"sql-result-metadata-failure","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}