{"record":{"id":"57e859e9659f918f","repo":"Billionmail/BillionMail","slug":"no-log-files-found-in-the-given-date-range","errorCode":null,"errorMessage":"No log files found in the given date range","messagePattern":"No log files found in the given date range","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/internal/controller/operation_log/operation_log_v1_get_output_log.go","lineNumber":22,"sourceCode":"\t\"billionmail-core/internal/service/public\"\n\t\"bufio\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"billionmail-core/api/operation_log/v1\"\n)\n\nfunc (c *ControllerV1) GetOutputLog(ctx context.Context, req *v1.GetOutputLogReq) (res *v1.GetOutputLogRes, err error) {\n\tres = &v1.GetOutputLogRes{}\n\n\tfiles, err := getLogFilesInRange(ctx, req.StartDate, req.EndDate)\n\tif err != nil {\n\t\tres.SetError(errors.New(public.LangCtx(ctx, \"No log files found in the given date range\")))\n\t\treturn res, nil\n\t}\n\n\tkeyword := strings.TrimSpace(req.Keyword)\n\tpage := req.Page\n\tpageSize := req.PageSize\n\tif page < 1 {\n\t\tpage = 1\n\t}\n\tif pageSize <= 0 {\n\n\t\tpageSize = 1000\n\t}\n\n\tvar collectedLines []string\n\tvar linesToSkip int\n\tif pageSize > 0 {\n\t\tlinesToSkip = (page - 1) * pageSize","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/operation_log/operation_log_v1_get_output_log.go#L4-L40","documentation":"GetOutputLog converts any error from getLogFilesInRange(ctx, req.StartDate, req.EndDate) into 'No log files found in the given date range'. This can mean the dates were unparseable, the range was inverted, or simply that no output logs fall within the range.","triggerScenarios":"Calling GetOutputLog with start_date/end_date outside the retained log window, on an instance with no logs at all, or with malformed dates that make getLogFilesInRange fail.","commonSituations":"Querying logs older than retention; typo'd dates (e.g. 2026-13-01); front-end sending empty strings for dates; new deployment with few logs.","solutions":["Send start_date and end_date in YYYY-MM-DD format with end_date >= start_date.","Query a range that overlaps the instance's actual log history.","Check the server logs/inner error to distinguish date-validation failure from an empty range."],"exampleFix":"// before\n{\"start_date\":\"09/01/2026\",\"end_date\":\"08/01/2026\"}\n// after\n{\"start_date\":\"2026-08-01\",\"end_date\":\"2026-09-01\"}","handlingStrategy":"validation","validationCode":"const DATE_RE = /^\\d{4}-\\d{2}-\\d{2}$/;\nif (!DATE_RE.test(startDate) || !DATE_RE.test(endDate) || endDate < startDate) {\n  throw new Error('Dates must be YYYY-MM-DD with end_date >= start_date');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await api.getOutputLog({startDate, endDate})\n} catch (e) {\n  if (/No log files found in the given date range/.test(e.message)) {\n    return {rows: [], total: 0} // empty-state, not an error\n  }\n  throw e\n}","preventionTips":["Always send YYYY-MM-DD dates from a date-picker constrained to the log retention window.","Never send empty or locale-formatted date strings.","Handle empty ranges as a normal empty result in the UI."],"tags":["logs","date-range","validation"],"backgroundTag":"no-logs-in-range","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}