Billionmail/BillionMail · warning

No log files found

Error message

No log files found

What it means

GetLatestOutputLog converts any error from getSortedLogFiles() into the user-facing message 'No log files found' (localized via LangCtx) and returns success with the error set on res. It means the output-log directory ../logs/core/out contained no readable .log files, or the directory could not be read.

Source

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

import (
	"billionmail-core/api/operation_log/v1"
	"billionmail-core/internal/service/public"
	"context"
	"errors"
	"os"
	"path/filepath"
	"sort"
	"strings"
)

const latestLogLinesLimit = 1000

func (c *ControllerV1) GetLatestOutputLog(ctx context.Context, req *v1.GetLatestOutputLogReq) (res *v1.GetLatestOutputLogRes, err error) {
	res = &v1.GetLatestOutputLogRes{}

	files, err := getSortedLogFiles()
	if err != nil {
		res.SetError(errors.New(public.LangCtx(ctx, "No log files found")))
		return res, nil
	}

	var collectedLines []string

	for _, file := range files {

		lines, readErr := readLines(file, "")
		if readErr != nil {
			continue
		}

		for j := len(lines) - 1; j >= 0; j-- {
			collectedLines = append(collectedLines, lines[j])

			if len(collectedLines) >= latestLogLinesLimit {
				goto endLoop
			}

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Verify the directory ../logs/core/out (relative to the running process) exists and contains *.log files.
  2. Fix volume mounts / working directory so the relative path resolves (or deploy public.AbsPath logic consistently).
  3. Check directory read permissions for the service user.
  4. Generate some activity so output logs are created, then retry.

Example fix

// docker-compose before
# no logs volume
// after
volumes:
  - ./data/logs:/app/logs  # ensures ../logs/core/out exists next to the binary
Defensive patterns

Strategy: fallback

Validate before calling

// Check the log directory before calling the API
const fs = require('fs');
const dir = path.resolve(process.cwd(), '../logs/core/out');
const hasLogs = fs.existsSync(dir) && fs.readdirSync(dir).some(f => f.endsWith('.log'));

Try / catch

const res = await api.getLatestOutputLog();
if (res.error && /no log files found/i.test(res.error.message)) {
    showEmptyState('No output logs available yet'); // fallback UI instead of failing
}

Prevention

When it happens

Trigger: Calling GetLatestOutputLog on an instance where no output logs have been written yet, the logs directory is missing/misplaced relative to the working directory, or directory read permissions deny listing.

Common situations: Fresh deployment with no core output logs; container where the ../logs/core/out path does not resolve because the binary's working directory differs; volume not mounted; logs owned by another user.

Related errors


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