{"record":{"id":"4b4fc7a7bcbbc421","repo":"Billionmail/BillionMail","slug":"no-log-files-found-4b4fc7","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":69,"sourceCode":"\treturn res, nil\n}\n\nfunc getSortedLogFiles() ([]string, error) {\n\tlogDir := public.AbsPath(\"../logs/core/out\")\n\tentries, err := os.ReadDir(logDir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar fileNames []string\n\tfor _, entry := range entries {\n\t\tif !entry.IsDir() && strings.HasSuffix(entry.Name(), \".log\") {\n\t\t\tfileNames = append(fileNames, entry.Name())\n\t\t}\n\t}\n\n\tif len(fileNames) == 0 {\n\t\treturn nil, errors.New(\"no log files found\")\n\t}\n\n\tsort.Sort(sort.Reverse(sort.StringSlice(fileNames)))\n\n\tvar paths []string\n\tfor _, file := range fileNames {\n\t\tpaths = append(paths, filepath.Join(logDir, file))\n\t}\n\n\treturn paths, nil\n}\n","sourceCodeStart":51,"sourceCodeEnd":81,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/operation_log/operation_log_v1_get_latest_output_log.go#L51-L81","documentation":"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.","triggerScenarios":"The directory ../logs/core/out exists and is listable but contains zero *.log files (e.g. only .gz rotated files, subdirectories, or unrelated files).","commonSituations":"Log rotation moved all logs to compressed archives; a cleanup cron deleted logs; logs written with a different extension by a custom log config.","solutions":["Ensure the process actually writes .log files to ../logs/core/out.","Include rotated archives in your search if you need history (getSortedLogFiles only sees *.log).","Adjust log configuration so output logs keep the .log suffix."],"exampleFix":"// before\nlogs/core/out/  (empty; archives in logs/core/out/archive/*.gz)\n// after\nrestore rotation to keep at least the newest core-YYYY-MM-DD.log in logs/core/out/","handlingStrategy":"fallback","validationCode":"const files = fs.readdirSync(logDir).filter(f => f.endsWith('.log'));\nif (files.length === 0) {\n    // skip the call; fall back to archived/compressed logs\n}","typeGuard":null,"tryCatchPattern":"paths, err := getSortedLogFiles()\nif err != nil && err.Error() == \"no log files found\" {\n    return []string{}, nil // treat as empty result, keep serving the UI\n}","preventionTips":["Keep at least the newest uncompressed .log file in the output directory under your rotation policy.","Generate regular activity so output logs are always present.","Align custom log configs with the .log suffix the scanner expects."],"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-12T22:17:10.623Z"}