{"record":{"id":"eeda537a412d2b36","repo":"Billionmail/BillionMail","slug":"no-log-files-found-eeda53","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_output_log.go","lineNumber":133,"sourceCode":"\tendDate, err := time.Parse(layout, end)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid end_date: %v\", err)\n\t}\n\tif endDate.Before(startDate) {\n\t\treturn nil, fmt.Errorf(\"end_date must not be before start_date\")\n\t}\n\n\tvar files []string\n\n\tfor d := startDate; !d.After(endDate); d = d.AddDate(0, 0, 1) {\n\t\tfname := filepath.Join(logDir, d.Format(\"2006-01-02\")+\".log\")\n\t\tif _, err := os.Stat(fname); err == nil {\n\t\t\tfiles = append(files, fname)\n\t\t}\n\t}\n\n\tif len(files) == 0 {\n\t\treturn nil, fmt.Errorf(\"no log files found\")\n\t}\n\treturn files, nil\n}\n","sourceCodeStart":115,"sourceCodeEnd":137,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/operation_log/operation_log_v1_get_output_log.go#L115-L137","documentation":"After iterating day-by-day from start_date to end_date and stat-ing each expected <yyyy-mm-dd>.log file in logDir, if no files exist the function returns this error instead of an empty list. It signals that there is simply no log data for the requested window on this server.","triggerScenarios":"Requesting a date range before logging was enabled, dates far in the future, a logDir path that is wrong/misconfigured, or logs deleted/rotated away (os.Stat fails for every candidate file).","commonSituations":"Fresh deployment with no logs yet; logs stored on a different volume/mount in Docker than the controller's logDir expects; log rotation/cleanup removed old files the user asks for; wrong container queried (querying app logs on a node that doesn't serve them).","solutions":["Verify log files of the form YYYY-MM-DD.log actually exist in the configured logDir","Check the logDir configuration/mount (Docker volume) matches where logs are written","Re-run the query with a date range that covers days on which the application actually ran and logged","If logs were rotated/deleted, restore them from backup or accept the empty result"],"exampleFix":"# before\ncurl '.../operation-log/output?start_date=2025-01-01&end_date=2025-01-02'\n# after (range with existing files)\ncurl '.../operation-log/output?start_date=2026-09-01&end_date=2026-09-05'","handlingStrategy":"fallback","validationCode":"// No reliable pre-check via public API; treat as expected empty case:\nconst rangeHasData = lastKnownLogDate === null || new Date(endDate) >= new Date(lastKnownLogDate);","typeGuard":null,"tryCatchPattern":"try {\n  const files = await api.getOutputLog({ start_date, end_date });\n} catch (err) {\n  if (String(err.message).includes('no log files found')) {\n    return { files: [], message: 'No logs for this range' }; // degrade gracefully\n  }\n  throw err;\n}","preventionTips":["Pick date ranges within the deployment's active logging window","Verify the server's logDir is correctly configured and mounted","Check log rotation settings so needed files still exist"],"tags":["filesystem","logging","missing-files"],"backgroundTag":"log-file-not-found","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"}