SigNoz/signoz · error

couldn't generate nil check for parseFrom of regex op %s: %w

Error message

couldn't generate nil check for parseFrom of regex op %s: %w

What it means

While building the OTTL-style pipeline processor, getOperators generates a nil-check expression for the ParseFrom field of every enabled regex_parser operator. If fieldNotNilCheck(operator.ParseFrom) fails (typically because ParseFrom is empty or malformed), the builder aborts with this wrapped error naming the operator. The message wraps the underlying cause with %w, so inspect err with errors.Unwrap for specifics.

Source

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

		// Ensure name is unique
		if _, nameExists := processors[name]; nameExists {
			name = fmt.Sprintf("%s-%d", name, pipelineIdx)
		}

		processors[name] = processor
		names = append(names, name)
	}
	return processors, names, nil
}

func getOperators(ops []pipelinetypes.PipelineOperator) ([]pipelinetypes.PipelineOperator, error) {
	filteredOp := []pipelinetypes.PipelineOperator{}
	for i, operator := range ops {
		if operator.Enabled {
			if operator.Type == "regex_parser" {
				parseFromNotNilCheck, err := fieldNotNilCheck(operator.ParseFrom)
				if err != nil {
					return nil, fmt.Errorf(
						"couldn't generate nil check for parseFrom of regex op %s: %w", operator.Name, err,
					)
				}
				operator.If = fmt.Sprintf(
					`%s && %s matches "%s"`,
					parseFromNotNilCheck,
					operator.ParseFrom,
					strings.ReplaceAll(
						strings.ReplaceAll(operator.Regex, `\`, `\\`),
						`"`, `\"`,
					),
				)

			} else if operator.Type == "grok_parser" {
				parseFromNotNilCheck, err := fieldNotNilCheck(operator.ParseFrom)
				if err != nil {
					return nil, fmt.Errorf(
						"couldn't generate nil check for parseFrom of grok op %s: %w", operator.Name, err,

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Inspect the wrapped error (errors.Unwrap / %w chain) to see the exact reason fieldNotNilCheck failed.
  2. Set a valid parse_from on the regex_parser operator, e.g. attributes.body or resource.service.name.
  3. Validate operator payloads before submission: every regex_parser/grok_parser must have a non-empty parse_from.
  4. If importing pipelines from another source, re-check the schema version expected by your query-service.

Example fix

// before
- type: regex_parser
  enabled: true
  name: extract-code
  # parse_from missing

// after
- type: regex_parser
  enabled: true
  name: extract-code
  parse_from: attributes.body
  regex: "(?P<code>\\d{3})"
Defensive patterns

Strategy: validation

Validate before calling

func validateRegexOp(op pipelinetypes.PipelineOperator) error {
	if op.Type == "regex_parser" && op.Enabled {
		if strings.TrimSpace(op.ParseFrom) == "" {
			return fmt.Errorf("regex_parser %s requires parse_from", op.Name)
		}
	}
	return nil
}
for _, op := range req.Pipelines[0].Config {
	if err := validateRegexOp(op); err != nil { return err }
}

Type guard

func isRegexOpValid(op pipelinetypes.PipelineOperator) bool {
	return op.Type != "regex_parser" || !op.Enabled || fieldNotNilCheckCanParse(op.ParseFrom)
}

Try / catch

ops, err := getOperators(pipeline.Config)
if err != nil {
	var target *targetErrType
	if strings.Contains(err.Error(), "nil check for parseFrom of regex op") {
		// surface field-level error to the user editing the pipeline
	}
	return ops, err
}

Prevention

When it happens

Trigger: Enabling a regex_parser operator whose ParseFrom is empty, not a valid attribute path, or unparseable by fieldNotNilCheck, then calling PreparePipelineProcessor (via ApplyPipelines / pipeline create or update APIs).

Common situations: User submits a pipeline YAML/JSON where a regex_parser lacks parse_from; UI form submitted before the parse_from field was filled; copy-pasted pipeline config with a typo'd attribute name; format change between API versions.

Related errors


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