jaegertracing/jaeger · error
failed to scan row: %w
Error message
failed to scan row: %w
What it means
While iterating service rows, GetServices scans each row into a dbmodel.Service via rows.ScanStruct; if the scan fails (schema mismatch, NULL in a non-nullable field, wrong column types), the error is appended and iteration breaks. The wrapped error identifies the offending column and Go type.
Source
Thrown at internal/storage/v2/clickhouse/tracestore/reader.go:123
}
}
}
}
func (r *Reader) GetServices(ctx context.Context) ([]string, error) {
rows, err := r.conn.Query(ctx, sql.SelectServices)
if err != nil {
return nil, fmt.Errorf("failed to query services: %w", err)
}
var (
services []string
errs []error
)
for rows.Next() {
var service dbmodel.Service
if scanErr := rows.ScanStruct(&service); scanErr != nil {
errs = append(errs, fmt.Errorf("failed to scan row: %w", scanErr))
break
}
services = append(services, service.Name)
}
if rowsErr := rows.Err(); rowsErr != nil {
errs = append(errs, fmt.Errorf("failed to read service rows: %w", rowsErr))
}
if closeErr := rows.Close(); closeErr != nil {
errs = append(errs, fmt.Errorf("failed to close rows: %w", closeErr))
}
if err := errors.Join(errs...); err != nil {
return nil, err
}
return services, nil
}
func (r *Reader) GetOperations(
ctx context.Context,View on GitHub (pinned to 806f444784)
Solutions
- Run the schema migrations matching your jaeger version so the services table matches dbmodel.Service
- Check the wrapped error for the failing column and fix its type/nullability
- Clean or backfill rows containing NULLs where the struct expects values
- Re-create the services aggregation table if it was hand-modified
Example fix
// before service_name Nullable(String) -- ScanStruct into string fails on NULL // after service_name String -- with NOT NULL, per jaeger schema
Defensive patterns
Strategy: try-catch
Validate before calling
// verify the services table schema matches expectations cols, err := conn.Query(ctx, "DESCRIBE TABLE service_names") // check service_name column is non-nullable String
Try / catch
services, err := reader.GetServices(ctx)
if err != nil {
if strings.Contains(err.Error(), "failed to scan row") {
log.Printf("service_names schema mismatch: %v", err) // fix schema, don't retry
}
return err
} Prevention
- Keep the applied schema version aligned with the jaeger binary version
- Declare service-name columns as non-nullable String per the official schema
- Validate imported/external data for NULLs before inserting into jaeger tables
- Add a CI check that DESCRIBE output matches the expected schema DDL
When it happens
Trigger: Calling GetServices against a services/name table whose columns don't match dbmodel.Service's fields — e.g. after a schema rename, or a NULL service name in a table expecting non-null String.
Common situations: Version skew between jaeger code and the applied ClickHouse schema; manually altered tables; data imported from another backend with different nullability conventions.
Related errors
- failed to scan span row: %w
- failed to scan dependency row: %w
- failed to get attribute metadata: %w
- query exists in template without ";"
- TraceID is not a 128bit integer
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/6482d4e6a4eed387.
Report an issue: GitHub.