{"record":{"id":"975e7fb8d833bd37","repo":"SigNoz/signoz","slug":"couldn-t-generate-nil-check-for-from-field-of-s-o","errorCode":null,"errorMessage":"couldn't generate nil check for From field of %s op %s: %w","messagePattern":"couldn't generate nil check for From field of (.+?) op (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/logparsingpipeline/pipelineBuilder.go","lineNumber":149,"sourceCode":"\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}\n\t\t\t} else if operator.Type == \"move\" || operator.Type == \"copy\" {\n\t\t\t\tfromNotNilCheck, err := fieldNotNilCheck(operator.From)\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 From field of %s op %s: %w\", operator.Type, operator.Name, err,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\toperator.If = fromNotNilCheck\n\t\t\t} else if operator.Type == \"remove\" {\n\t\t\t\tfieldNotNilCheck, err := fieldNotNilCheck(operator.Field)\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 field to be removed by op %s: %w\", operator.Name, err,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\toperator.If = fieldNotNilCheck\n\t\t\t} else if operator.Type == \"trace_parser\" {\n\t\t\t\tcleanTraceParser(&operator)\n\t\t\t} else if operator.Type == \"time_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(","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/logparsingpipeline/pipelineBuilder.go#L131-L167","documentation":"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.","triggerScenarios":"An enabled move/copy operator with From empty or not a resolvable field path, submitted through PreparePipelineProcessor / ApplyPipelines.","commonSituations":"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.","solutions":["Unwrap the error for the root cause from fieldNotNilCheck.","Set a valid from on the move/copy operator, e.g. attributes.raw to attributes.body.","Add pre-submit validation: move/copy require both from and to as valid field paths.","Check earlier pipeline stages actually create the referenced field before it is moved/copied."],"exampleFix":"// before\n- type: move\n  enabled: true\n  name: promote-level\n  to: severity\n  # from missing\n\n// after\n- type: move\n  enabled: true\n  name: promote-level\n  from: attributes.level\n  to: severity","handlingStrategy":"validation","validationCode":"if (op.Type == \"move\" || op.Type == \"copy\") && op.Enabled {\n\tif strings.TrimSpace(op.From) == \"\" || strings.TrimSpace(op.To) == \"\" {\n\t\treturn fmt.Errorf(\"%s operator %s requires both from and to\", op.Type, op.Name)\n\t}\n}","typeGuard":"func isMoveCopyOpValid(op pipelinetypes.PipelineOperator) bool {\n\treturn (op.Type != \"move\" && op.Type != \"copy\") || !op.Enabled ||\n\t\t(strings.TrimSpace(op.From) != \"\" && strings.TrimSpace(op.To) != \"\")\n}","tryCatchPattern":null,"preventionTips":["Validate from/to pairs client-side before pipeline submission.","Verify earlier pipeline stages produce the field referenced in from.","Keep pipeline configs in version control and lint them in CI."],"tags":["log-pipelines","move-operator","copy-operator","ottl","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"}