{"record":{"id":"8093e68800e48f57","repo":"SigNoz/signoz","slug":"couldn-t-generate-nil-check-for-field-to-be-remove","errorCode":null,"errorMessage":"couldn't generate nil check for field to be removed by op %s: %w","messagePattern":"couldn't generate nil check for field to be removed by op (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/logparsingpipeline/pipelineBuilder.go","lineNumber":157,"sourceCode":"\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(\n\t\t\t\t\t\t\"couldn't generate nil check for parseFrom of time parser 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\tif operator.LayoutType == \"strptime\" {\n\t\t\t\t\tregex, err := pipelinetypes.RegexForStrptimeLayout(operator.Layout)\n\t\t\t\t\tif err != nil {","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/logparsingpipeline/pipelineBuilder.go#L139-L175","documentation":"While building a log parsing pipeline, SigNoz generates an OTTL-style `if` condition that verifies the target field is non-nil before a `remove` operator runs. This error means fieldNotNilCheck could not produce that check for operator.Field, almost always because the field path has an unsupported/invalid prefix or syntax. The pipeline is rejected at PreparePipelineProcessor/getOperators time, so no pipeline with that operator can be created.","triggerScenarios":"Creating/updating a parsing pipeline whose operators array contains {\"type\":\"remove\",\"field\":\"<invalid path>\"} — e.g. field \"foo\", \"attr.x\", or a path not starting with a recognized root like attributes./resource./body. POST/PUT to the pipelines API fails with this wrapped message naming the operator.","commonSituations":"Typos in field names in pipeline YAML/JSON; assuming any log field can be removed by bare name; copy-pasting pipelines between SigNoz versions with different allowed field roots; referencing nested keys without the attributes. prefix.","solutions":["Fix the field path to start with a valid root, e.g. attributes.foo, resource.foo, or body","Verify the exact spelling/case of the key against the actual log record","If the key is dynamic, wrap or guard differently instead of remove on a non-standard path"],"exampleFix":"// before\n{\"type\":\"remove\",\"field\":\"user_id\"}\n// after\n{\"type\":\"remove\",\"field\":\"attributes.user_id\"}","handlingStrategy":"validation","validationCode":"var fieldRootRe = regexp.MustCompile(`^(attributes|resource|body)(\\.[A-Za-z0-9_.-]+)?$`)\nfunc validFieldPath(f string) bool { return fieldRootRe.MatchString(f) }\nfor _, op := range pipeline.Operators {\n  if op.Type == \"remove\" && !validFieldPath(op.Field) { return fmt.Errorf(\"bad field %q\", op.Field) }\n}","typeGuard":"func isRemoveOp(op postprocess.Operator) bool { return op.Type == \"remove\" && validFieldPath(op.Field) }","tryCatchPattern":"If pipeline create/update returns an error, surface the operator name from the message to the user for correction rather than retrying.","preventionTips":["Always fully qualify fields with attributes./resource./body prefixes","Validate operator configs with a schema/linter before submitting","Preview pipelines on sample logs in the UI before saving"],"tags":["signoz","log-parsingpipeline","ottl","field-validation"],"backgroundTag":"invalid-field-path","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}