{"record":{"id":"7b9a57e7eeb1ab13","repo":"Billionmail/BillionMail","slug":"no-log-files-found","errorCode":null,"errorMessage":"No log files found","messagePattern":"No log files found","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/internal/controller/operation_log/operation_log_v1_get_latest_output_log.go","lineNumber":21,"sourceCode":"import (\n\t\"billionmail-core/api/operation_log/v1\"\n\t\"billionmail-core/internal/service/public\"\n\t\"context\"\n\t\"errors\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n)\n\nconst latestLogLinesLimit = 1000\n\nfunc (c *ControllerV1) GetLatestOutputLog(ctx context.Context, req *v1.GetLatestOutputLogReq) (res *v1.GetLatestOutputLogRes, err error) {\n\tres = &v1.GetLatestOutputLogRes{}\n\n\tfiles, err := getSortedLogFiles()\n\tif err != nil {\n\t\tres.SetError(errors.New(public.LangCtx(ctx, \"No log files found\")))\n\t\treturn res, nil\n\t}\n\n\tvar collectedLines []string\n\n\tfor _, file := range files {\n\n\t\tlines, readErr := readLines(file, \"\")\n\t\tif readErr != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor j := len(lines) - 1; j >= 0; j-- {\n\t\t\tcollectedLines = append(collectedLines, lines[j])\n\n\t\t\tif len(collectedLines) >= latestLogLinesLimit {\n\t\t\t\tgoto endLoop\n\t\t\t}","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/operation_log/operation_log_v1_get_latest_output_log.go#L3-L39","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the directory ../logs/core/out (relative to the running process) exists and contains *.log files.","Fix volume mounts / working directory so the relative path resolves (or deploy public.AbsPath logic consistently).","Check directory read permissions for the service user.","Generate some activity so output logs are created, then retry."],"exampleFix":"// docker-compose before\n# no logs volume\n// after\nvolumes:\n  - ./data/logs:/app/logs  # ensures ../logs/core/out exists next to the binary","handlingStrategy":"fallback","validationCode":"// Check the log directory before calling the API\nconst fs = require('fs');\nconst dir = path.resolve(process.cwd(), '../logs/core/out');\nconst hasLogs = fs.existsSync(dir) && fs.readdirSync(dir).some(f => f.endsWith('.log'));","typeGuard":null,"tryCatchPattern":"const res = await api.getLatestOutputLog();\nif (res.error && /no log files found/i.test(res.error.message)) {\n    showEmptyState('No output logs available yet'); // fallback UI instead of failing\n}","preventionTips":["Mount the logs volume in containers so ../logs/core/out always exists.","Run the binary with a working directory where the relative logs path resolves.","Grant the service user read access to the logs directory.","Treat this as an empty-state condition, not a hard failure."],"tags":["filesystem","logs","not-found"],"backgroundTag":"log-files-missing","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}