{"record":{"id":"947bfe01639e69bb","repo":"googleapis/mcp-toolbox","slug":"unable-to-retrieve-rows-column-name-w","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/clickhouse/clickhouse.go","lineNumber":121,"sourceCode":"\nfunc (s *Source) ClickHousePool() *sql.DB {\n\treturn s.Pool\n}\n\nfunc (s *Source) RunSQL(ctx context.Context, statement string, params parameters.ParamValues) (any, error) {\n\tvar sliceParams []any\n\tif params != nil {\n\t\tsliceParams = params.AsSlice()\n\t}\n\tresults, err := s.ClickHousePool().QueryContext(ctx, statement, sliceParams...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to execute query: %w\", err)\n\t}\n\tdefer results.Close()\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\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...)\n\t\tif err != nil {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/clickhouse/clickhouse.go#L103-L139","documentation":"After executing the query, RunSQL calls results.Columns() to obtain column names. Failure here (wrapped as this error) means the result set metadata could not be retrieved from the driver.","triggerScenarios":"Calling results.Columns() on a rows object in an invalid state — typically after the connection or result stream broke.","commonSituations":"Connection dropped between query execution and metadata read, driver returned closed/invalid rows.","solutions":["Check the wrapped error for connection-level failures.","Verify network stability between toolbox and ClickHouse.","Retry the query; this is usually transient infrastructure-level.","Ensure no concurrent Close on the results."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"rows, err := src.RunSQL(ctx, stmt)\nif err != nil {\n    if strings.Contains(err.Error(), \"unable to retrieve rows column name\") {\n        return retryWithBackoff(ctx, stmt) // transient stream failure\n    }\n    return err\n}","preventionTips":["Avoid concurrent use of the same connection.","Keep result sets within memory/time limits.","Monitor network stability to ClickHouse."],"tags":["clickhouse","query","metadata"],"backgroundTag":"result-metadata-unavailable","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"}