Billionmail/BillionMail · warning

No log files found in the given date range

Error message

No log files found in the given date range

What it means

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.

Source

Thrown at core/internal/controller/operation_log/operation_log_v1_get_output_log.go:22

	"billionmail-core/internal/service/public"
	"bufio"
	"context"
	"errors"
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"time"

	"billionmail-core/api/operation_log/v1"
)

func (c *ControllerV1) GetOutputLog(ctx context.Context, req *v1.GetOutputLogReq) (res *v1.GetOutputLogRes, err error) {
	res = &v1.GetOutputLogRes{}

	files, err := getLogFilesInRange(ctx, req.StartDate, req.EndDate)
	if err != nil {
		res.SetError(errors.New(public.LangCtx(ctx, "No log files found in the given date range")))
		return res, nil
	}

	keyword := strings.TrimSpace(req.Keyword)
	page := req.Page
	pageSize := req.PageSize
	if page < 1 {
		page = 1
	}
	if pageSize <= 0 {

		pageSize = 1000
	}

	var collectedLines []string
	var linesToSkip int
	if pageSize > 0 {
		linesToSkip = (page - 1) * pageSize

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Send start_date and end_date in YYYY-MM-DD format with end_date >= start_date.
  2. Query a range that overlaps the instance's actual log history.
  3. Check the server logs/inner error to distinguish date-validation failure from an empty range.

Example fix

// before
{"start_date":"09/01/2026","end_date":"08/01/2026"}
// after
{"start_date":"2026-08-01","end_date":"2026-09-01"}
Defensive patterns

Strategy: validation

Validate before calling

const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
if (!DATE_RE.test(startDate) || !DATE_RE.test(endDate) || endDate < startDate) {
  throw new Error('Dates must be YYYY-MM-DD with end_date >= start_date');
}

Try / catch

try {
  return await api.getOutputLog({startDate, endDate})
} catch (e) {
  if (/No log files found in the given date range/.test(e.message)) {
    return {rows: [], total: 0} // empty-state, not an error
  }
  throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/57e859e9659f918f. Report an issue: GitHub.