{"record":{"id":"62867714f7ae5748","repo":"SigNoz/signoz","slug":"couldn-t-process-json-parser-op-s-s","errorCode":null,"errorMessage":"couldn't process json_parser op %s: %s","messagePattern":"couldn't process json_parser op (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/logparsingpipeline/pipelineBuilder.go","lineNumber":127,"sourceCode":"\t\t\t\t\tstrings.ReplaceAll(\n\t\t\t\t\t\tstrings.ReplaceAll(operator.Regex, `\\`, `\\\\`),\n\t\t\t\t\t\t`\"`, `\\\"`,\n\t\t\t\t\t),\n\t\t\t\t)\n\n\t\t\t} else if operator.Type == \"grok_parser\" {\n\t\t\t\tparseFromNotNilCheck, err := fieldNotNilCheck(operator.ParseFrom)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\t\"couldn't generate nil check for parseFrom of grok op %s: %w\", operator.Name, err,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\toperator.If = parseFromNotNilCheck\n\n\t\t\t} else if operator.Type == \"json_parser\" {\n\t\t\t\toperators, err := processJSONParser(&operator)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"couldn't process json_parser op %s: %s\", operator.Name, err)\n\t\t\t\t}\n\n\t\t\t\tfilteredOp = append(filteredOp, operators...)\n\t\t\t\tcontinue // Continue here to skip deduplication of json_parser operator\n\t\t\t} else if operator.Type == \"add\" {\n\t\t\t\tif strings.HasPrefix(operator.Value, \"EXPR(\") && strings.HasSuffix(operator.Value, \")\") {\n\t\t\t\t\texpression := strings.TrimSuffix(strings.TrimPrefix(operator.Value, \"EXPR(\"), \")\")\n\t\t\t\t\tfieldsNotNilCheck, err := fieldsReferencedInExprNotNilCheck(expression)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\t\t\"could'nt generate nil check for fields referenced in value expr of add operator %s: %w\",\n\t\t\t\t\t\t\toperator.Name, err,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif fieldsNotNilCheck != \"\" {\n\t\t\t\t\t\toperator.If = fieldsNotNilCheck\n\t\t\t\t\t}\n\t\t\t\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/logparsingpipeline/pipelineBuilder.go#L109-L145","documentation":"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).","triggerScenarios":"Enabling a json_parser whose configuration processJSONParser rejects (empty/invalid parse_from, or invalid parse_to/trace/attributes options), then running PreparePipelineProcessor or ApplyPipelines.","commonSituations":"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.","solutions":["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.","Validate the json_parser block against the pipeline schema (parse_from required; parse_to/enable_trace_parsing consistent) before submitting.","Log the full error string — the %s suffix carries the specific reason from processJSONParser.","If parsing is optional, set enabled: false until the config is fixed."],"exampleFix":"// before\n- type: json_parser\n  enabled: true\n  name: parse-json\n  # parse_from missing\n\n// after\n- type: json_parser\n  enabled: true\n  name: parse-json\n  parse_from: attributes.body","handlingStrategy":"validation","validationCode":"if op.Type == \"json_parser\" && op.Enabled && strings.TrimSpace(op.ParseFrom) == \"\" {\n\treturn fmt.Errorf(\"json_parser %s requires parse_from\", op.Name)\n}","typeGuard":"func isJSONOpValid(op pipelinetypes.PipelineOperator) bool {\n\treturn op.Type != \"json_parser\" || !op.Enabled || strings.TrimSpace(op.ParseFrom) != \"\"\n}","tryCatchPattern":"if err != nil {\n\tif strings.Contains(err.Error(), \"couldn't process json_parser op\") {\n\t\t// extract operator name from message and highlight it in the editor\n\t}\n}","preventionTips":["Validate json_parser blocks (parse_from plus consistent parse_to/trace options) before apply.","Dry-run pipelines on sample logs in the UI before saving."],"tags":["log-pipelines","json-parser","ottl","validation","pipeline-builder"],"backgroundTag":"pipeline-operator-validation-failed","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}