SigNoz/signoz · error

couldn't generate nil check for From field of %s op %s: %w

Error message

couldn't generate nil check for From field of %s op %s: %w

What it means

For enabled move or copy operators, getOperators generates a nil-check for operator.From via fieldNotNilCheck; any failure aborts pipeline building with the operator type and name wrapped in. A move/copy must declare a valid source (From) field; empty or malformed values fail the guard generation.

Source

Thrown at pkg/query-service/app/logparsingpipeline/pipelineBuilder.go:149

				continue // Continue here to skip deduplication of json_parser operator
			} else if operator.Type == "add" {
				if strings.HasPrefix(operator.Value, "EXPR(") && strings.HasSuffix(operator.Value, ")") {
					expression := strings.TrimSuffix(strings.TrimPrefix(operator.Value, "EXPR("), ")")
					fieldsNotNilCheck, err := fieldsReferencedInExprNotNilCheck(expression)
					if err != nil {
						return nil, fmt.Errorf(
							"could'nt generate nil check for fields referenced in value expr of add operator %s: %w",
							operator.Name, err,
						)
					}
					if fieldsNotNilCheck != "" {
						operator.If = fieldsNotNilCheck
					}
				}
			} else if operator.Type == "move" || operator.Type == "copy" {
				fromNotNilCheck, err := fieldNotNilCheck(operator.From)
				if err != nil {
					return nil, fmt.Errorf(
						"couldn't generate nil check for From field of %s op %s: %w", operator.Type, operator.Name, err,
					)
				}
				operator.If = fromNotNilCheck
			} else if operator.Type == "remove" {
				fieldNotNilCheck, err := fieldNotNilCheck(operator.Field)
				if err != nil {
					return nil, fmt.Errorf(
						"couldn't generate nil check for field to be removed by op %s: %w", operator.Name, err,
					)
				}
				operator.If = fieldNotNilCheck
			} else if operator.Type == "trace_parser" {
				cleanTraceParser(&operator)
			} else if operator.Type == "time_parser" {
				parseFromNotNilCheck, err := fieldNotNilCheck(operator.ParseFrom)
				if err != nil {
					return nil, fmt.Errorf(

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Unwrap the error for the root cause from fieldNotNilCheck.
  2. Set a valid from on the move/copy operator, e.g. attributes.raw to attributes.body.
  3. Add pre-submit validation: move/copy require both from and to as valid field paths.
  4. Check earlier pipeline stages actually create the referenced field before it is moved/copied.

Example fix

// before
- type: move
  enabled: true
  name: promote-level
  to: severity
  # from missing

// after
- type: move
  enabled: true
  name: promote-level
  from: attributes.level
  to: severity
Defensive patterns

Strategy: validation

Validate before calling

if (op.Type == "move" || op.Type == "copy") && op.Enabled {
	if strings.TrimSpace(op.From) == "" || strings.TrimSpace(op.To) == "" {
		return fmt.Errorf("%s operator %s requires both from and to", op.Type, op.Name)
	}
}

Type guard

func isMoveCopyOpValid(op pipelinetypes.PipelineOperator) bool {
	return (op.Type != "move" && op.Type != "copy") || !op.Enabled ||
		(strings.TrimSpace(op.From) != "" && strings.TrimSpace(op.To) != "")
}

Prevention

When it happens

Trigger: An enabled move/copy operator with From empty or not a resolvable field path, submitted through PreparePipelineProcessor / ApplyPipelines.

Common situations: Renaming a field with move but leaving from blank; config generated by scripts that omit from when only to is set; typo'd field path after renaming attributes earlier in the pipeline.

Related errors


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