SigNoz/signoz · error

couldn't process json_parser op %s: %s

Error message

couldn't process json_parser op %s: %s

What it means

When an enabled json_parser operator is processed, getOperators delegates to processJSONParser to expand it (potentially into multiple operators). If that helper returns an error — usually an invalid ParseFrom or unparseable JSON handling options — the builder aborts with the operator's name and the inner error text (joined with %s, so it is not unwrappable).

Source

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

					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,
					)
				}
				operator.If = parseFromNotNilCheck

			} else if operator.Type == "json_parser" {
				operators, err := processJSONParser(&operator)
				if err != nil {
					return nil, fmt.Errorf("couldn't process json_parser op %s: %s", operator.Name, err)
				}

				filteredOp = append(filteredOp, operators...)
				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
					}
				}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Check the operator named in the message and fix its json_parser config — ensure parse_from points to a real field such as attributes.body.
  2. Validate the json_parser block against the pipeline schema (parse_from required; parse_to/enable_trace_parsing consistent) before submitting.
  3. Log the full error string — the %s suffix carries the specific reason from processJSONParser.
  4. If parsing is optional, set enabled: false until the config is fixed.

Example fix

// before
- type: json_parser
  enabled: true
  name: parse-json
  # parse_from missing

// after
- type: json_parser
  enabled: true
  name: parse-json
  parse_from: attributes.body
Defensive patterns

Strategy: validation

Validate before calling

if op.Type == "json_parser" && op.Enabled && strings.TrimSpace(op.ParseFrom) == "" {
	return fmt.Errorf("json_parser %s requires parse_from", op.Name)
}

Type guard

func isJSONOpValid(op pipelinetypes.PipelineOperator) bool {
	return op.Type != "json_parser" || !op.Enabled || strings.TrimSpace(op.ParseFrom) != ""
}

Try / catch

if err != nil {
	if strings.Contains(err.Error(), "couldn't process json_parser op") {
		// extract operator name from message and highlight it in the editor
	}
}

Prevention

When it happens

Trigger: Enabling a json_parser whose configuration processJSONParser rejects (empty/invalid parse_from, or invalid parse_to/trace/attributes options), then running PreparePipelineProcessor or ApplyPipelines.

Common situations: JSON pipeline config missing parse_from on a json_parser; enabling trace parsing options that require a valid parse_to; malformed operator payloads pasted into the UI or API.

Related errors


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