{"record":{"id":"205e5a10aabcbd64","repo":"googleapis/mcp-toolbox","slug":"unable-to-parse-rows-w","errorCode":null,"errorMessage":"unable to parse rows: %w","messagePattern":"unable to parse rows: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cassandra/cassandra.go","lineNumber":118,"sourceCode":"\nfunc (s *Source) RunSQL(ctx context.Context, statement string, params parameters.ParamValues) (any, error) {\n\tsliceParams := params.AsSlice()\n\titer := s.CassandraSession().Query(statement, sliceParams...).IterContext(ctx)\n\n\t// Create a slice to store the out\n\tvar out []map[string]interface{}\n\n\t// Scan results into a map and append to the slice\n\tfor {\n\t\trow := make(map[string]interface{}) // Create a new map for each row\n\t\tif !iter.MapScan(row) {\n\t\t\tbreak // No more rows\n\t\t}\n\t\tout = append(out, row)\n\t}\n\n\tif err := iter.Close(); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse rows: %w\", err)\n\t}\n\treturn out, nil\n}\n\nvar _ sources.Source = &Source{}\n\nfunc initCassandraSession(ctx context.Context, tracer trace.Tracer, c Config) (*gocql.Session, error) {\n\t//nolint:all // Reassigned ctx\n\tctx, span := sources.InitConnectionSpan(ctx, tracer, SourceType, c.Name)\n\tdefer span.End()\n\n\t// Validate authentication configuration\n\tif c.Password != \"\" && c.Username == \"\" {\n\t\treturn nil, fmt.Errorf(\"invalid Cassandra configuration: password provided without a username\")\n\t}\n\n\tcluster := gocql.NewCluster(c.Hosts...)\n\tcluster.ProtoVersion = c.ProtoVersion","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cassandra/cassandra.go#L100-L136","documentation":"RunSQL executes a CQL statement via gocql Query.Iter; when iter.Close() returns an error, it means the iteration/consumption of the result set failed (including server-side errors surfaced at the end of iteration), wrapped as 'unable to parse rows'.","triggerScenarios":"Calling RunSQL when the iterator fails while consuming rows or on final Close — e.g. query timeout, coordinator error, or malformed result.","commonSituations":"Query timeouts, node failures mid-scan, invalid query caught server-side, consistency errors during result streaming.","solutions":["Read the wrapped inner error for the actual CQL/server failure.","Retry the statement if it was a transient timeout or node error.","Fix the CQL statement if it is invalid for the schema.","Check cluster health; a coordinator may have died mid-query.","Increase timeout/consistency settings in the cluster config if appropriate."],"exampleFix":"// before\nrows, err := src.RunSQL(ctx, \"SELECT * FROM missing_table\")\n// after\nrows, err := src.RunSQL(ctx, \"SELECT * FROM existing_table\")","handlingStrategy":"try-catch","validationCode":"rows, err := src.RunSQL(ctx, stmt)\nif err != nil { /* handle */ }","typeGuard":null,"tryCatchPattern":"rows, err := src.RunSQL(ctx, stmt)\nif err != nil {\n    if strings.Contains(err.Error(), \"timeout\") { /* retry */ }\n    return fmt.Errorf(\"runsql failed: %w\", err)\n}","preventionTips":["Validate CQL statements against the schema before running.","Set reasonable timeouts and consistency levels.","Monitor cluster health to catch node failures early."],"tags":["cassandra","query","row-parsing"],"backgroundTag":"row-iteration-failed","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"}