SigNoz/signoz · error

select column is invalid %w

Error message

select column is invalid %w

What it means

Each column in selectColumns must pass AttributeKey.Validate (non-empty key, valid shape); otherwise the builder query is rejected.

Source

Thrown at pkg/query-service/model/v3/v3.go:1101

		if b.DataSource == DataSourceMetrics && len(b.GroupBy) > 0 && b.SpaceAggregation == SpaceAggregationUnspecified {
			if b.AggregateOperator == AggregateOperatorNoOp || b.AggregateOperator == AggregateOperatorRate {
				return fmt.Errorf("group by requires aggregate operator other than noop or rate")
			}
		}
	}

	if b.Having != nil {
		for _, having := range b.Having {
			if err := having.Operator.Validate(); err != nil {
				return fmt.Errorf("having operator is invalid: %w", err)
			}
		}
	}

	for _, selectColumn := range b.SelectColumns {
		if err := selectColumn.Validate(); err != nil {
			return fmt.Errorf("select column is invalid %w", err)
		}
	}

	if b.Expression == "" {
		return fmt.Errorf("expression is required")
	}

	if len(b.Functions) > 0 {
		for _, function := range b.Functions {
			if err := function.Name.Validate(); err != nil {
				return fmt.Errorf("function name is invalid: %w", err)
			}
			if function.Name == FunctionNameTimeShift {
				if len(function.Args) == 0 {
					return fmt.Errorf("timeShiftBy param missing in query")
				}
				_, ok := function.Args[0].(float64)
				if !ok {

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Remove entries with empty keys from selectColumns
  2. Ensure each entry has key plus type/dataType as needed

Example fix

// before
"selectColumns":[{"key":""}]
// after
"selectColumns":[{"key":"trace_id"}]
Defensive patterns

Strategy: validation

Validate before calling

for _, c := range q.SelectColumns { if strings.TrimSpace(c.Key) == "" { return errors.New("select column key required") } }

Type guard

func hasValidSelectColumns(cols []v3.AttributeKey) bool { for _, c := range cols { if c.Key == "" { return false } }; return true }

Prevention

When it happens

Trigger: selectColumns containing an entry with an empty key or malformed attribute.

Common situations: Logs/traces list panels where selected columns come from user input and empty entries slip in.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/5b31fd317f65a0a7. Report an issue: GitHub.