{"record":{"id":"1468fe5be5338611","repo":"SigNoz/signoz","slug":"couldn-t-generate-nil-check-for-parsefrom-of-time","errorCode":null,"errorMessage":"couldn't generate nil check for parseFrom of time parser op %s: %w","messagePattern":"couldn't generate nil check for parseFrom of time parser op (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/logparsingpipeline/pipelineBuilder.go","lineNumber":167,"sourceCode":"\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 {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\t\t\"couldn't generate layout regex for time_parser %s: %w\", operator.Name, err,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\toperator.If = fmt.Sprintf(\n\t\t\t\t\t\t`%s && %s matches \"%s\"`, operator.If, operator.ParseFrom, regex,\n\t\t\t\t\t)\n\t\t\t\t} else if operator.LayoutType == \"epoch\" {\n\t\t\t\t\tvalueRegex := `^\\\\s*[0-9]+\\\\s*$`","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/logparsingpipeline/pipelineBuilder.go#L149-L185","documentation":"For time_parser operators the builder prepends a nil check on operator.ParseFrom so the parser is skipped when the source timestamp field is absent. This error means a nil-check expression could not be generated for ParseFrom, typically because the path is empty or uses an unrecognized/invalid prefix. The pipeline creation aborts with the operator's name in the message.","triggerScenarios":"A pipeline operator {\"type\":\"time_parser\",\"parse_from\":\"<bad path>\"} where parse_from is missing, empty, or not rooted at a valid field root (attributes./resource./body). Also triggered by leading/trailing whitespace or malformed dot notation.","commonSituations":"Forgetting parse_from in time_parser config; writing parse_from: \"timestamp\" instead of \"attributes.timestamp\"; JSON vs YAML quoting mistakes that make the field empty.","solutions":["Set parse_from to a valid fully-qualified path such as attributes.timestamp","Ensure the field actually exists in the ingested logs","Validate required fields (parse_from, layout) in your config/pipeline-as-code tooling before submitting"],"exampleFix":"// before\n{\"type\":\"time_parser\",\"parse_from\":\"timestamp\",\"layout_type\":\"strptime\",\"layout\":\"2006-01-02\"}\n// after\n{\"type\":\"time_parser\",\"parse_from\":\"attributes.timestamp\",\"layout_type\":\"strptime\",\"layout\":\"2006-01-02\"}","handlingStrategy":"validation","validationCode":"for _, op := range pipeline.Operators {\n  if op.Type == \"time_parser\" && !validFieldPath(op.ParseFrom) {\n    return fmt.Errorf(\"time_parser %s: invalid parse_from %q\", op.Name, op.ParseFrom)\n  }\n}","typeGuard":"func hasValidParseFrom(op postprocess.Operator) bool { return op.Type != \"time_parser\" || validFieldPath(op.ParseFrom) }","tryCatchPattern":"Catch the wrapped error from the pipelines API and map it back to the offending operator name for a user-facing fix.","preventionTips":["Require parse_from in time_parser config schema","Use attributes.timestamp as the canonical source","Dry-run pipelines against sample logs before saving"],"tags":["signoz","log-parsingpipeline","time-parser","field-validation"],"backgroundTag":"invalid-field-path","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}