Billionmail/BillionMail · warning

no log files found

Error message

no log files found

What it means

getSortedLogFiles scans the log directory and returns this error when no entries ending in .log are found. It is the internal sentinel that GetLatestOutputLog translates into 'No log files found'. It distinguishes 'directory readable but empty of logs' from other read errors.

Source

Thrown at core/internal/controller/operation_log/operation_log_v1_get_latest_output_log.go:69

	return res, nil
}

func getSortedLogFiles() ([]string, error) {
	logDir := public.AbsPath("../logs/core/out")
	entries, err := os.ReadDir(logDir)
	if err != nil {
		return nil, err
	}

	var fileNames []string
	for _, entry := range entries {
		if !entry.IsDir() && strings.HasSuffix(entry.Name(), ".log") {
			fileNames = append(fileNames, entry.Name())
		}
	}

	if len(fileNames) == 0 {
		return nil, errors.New("no log files found")
	}

	sort.Sort(sort.Reverse(sort.StringSlice(fileNames)))

	var paths []string
	for _, file := range fileNames {
		paths = append(paths, filepath.Join(logDir, file))
	}

	return paths, nil
}

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Ensure the process actually writes .log files to ../logs/core/out.
  2. Include rotated archives in your search if you need history (getSortedLogFiles only sees *.log).
  3. Adjust log configuration so output logs keep the .log suffix.

Example fix

// before
logs/core/out/  (empty; archives in logs/core/out/archive/*.gz)
// after
restore rotation to keep at least the newest core-YYYY-MM-DD.log in logs/core/out/
Defensive patterns

Strategy: fallback

Validate before calling

const files = fs.readdirSync(logDir).filter(f => f.endsWith('.log'));
if (files.length === 0) {
    // skip the call; fall back to archived/compressed logs
}

Try / catch

paths, err := getSortedLogFiles()
if err != nil && err.Error() == "no log files found" {
    return []string{}, nil // treat as empty result, keep serving the UI
}

Prevention

When it happens

Trigger: The directory ../logs/core/out exists and is listable but contains zero *.log files (e.g. only .gz rotated files, subdirectories, or unrelated files).

Common situations: Log rotation moved all logs to compressed archives; a cleanup cron deleted logs; logs written with a different extension by a custom log config.

Related errors


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