{"record":{"id":"5250268cc59b0e5c","repo":"amir20/dozzle","slug":"invalid-end-time-format-expected-rfc3339-w","errorCode":null,"errorMessage":"invalid end time format (expected RFC3339): %w","messagePattern":"invalid end time format \\(expected RFC3339\\): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/tools_logs.go","lineNumber":52,"sourceCode":"\n\tcs, err := deps.HostService.FindContainer(hostID, containerID, deps.Labels)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"container not found: %w\", err)\n\t}\n\n\tstart := time.Now().Add(-1 * time.Hour)\n\tend := time.Now()\n\tif args.Start != \"\" {\n\t\tt, err := time.Parse(time.RFC3339, args.Start)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid start time format (expected RFC3339): %w\", err)\n\t\t}\n\t\tstart = t\n\t}\n\tif args.End != \"\" {\n\t\tt, err := time.Parse(time.RFC3339, args.End)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid end time format (expected RFC3339): %w\", err)\n\t\t}\n\t\tend = t\n\t}\n\n\tvar re *regexp.Regexp\n\tif args.Regex != \"\" {\n\t\tvar err error\n\t\tre, err = regexp.Compile(args.Regex)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid regex pattern: %w\", err)\n\t\t}\n\t}\n\n\tctx, cancel := context.WithCancel(ctx)\n\tdefer cancel()\n\n\tlogCh, err := cs.LogsBetweenDates(ctx, start, end, container.STDOUT|container.STDERR)\n\tif err != nil {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/amir20/dozzle/blob/d9463cbe21874e44ab79db6fa63e746ca7d22928/internal/cloud/tools_logs.go#L34-L70","documentation":"Same validation as the start time, applied to args.End. A non-empty end argument that fails time.Parse(time.RFC3339, ...) is wrapped as 'invalid end time format (expected RFC3339)'. Defaults to time.Now() when omitted.","triggerScenarios":"Calling fetch_container_logs with args.end like 'now', '2024/05/01', '1700000000', or an RFC3339-like string lacking an offset ('2024-05-01T10:00:00').","commonSituations":"Tool callers using locale-specific date formatting; unix epoch integers passed as end boundaries; partial ISO dates without seconds or zone.","solutions":["Pass end as full RFC3339 with timezone, e.g. 2024-05-01T10:00:00Z","Omit end (defaults to now)","Validate the timestamp client-side with a strict RFC3339 parser before the call"],"exampleFix":"// before\n{\"container_id\":\"abc\",\"end\":\"now\"}\n// after\n{\"container_id\":\"abc\",\"end\":\"2024-05-01T10:00:00Z\"}","handlingStrategy":"validation","validationCode":"function isValidRFC3339(s) { if (!s) return true; return /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$/.test(s) && !isNaN(Date.parse(s)); }\nif (args.end && !isValidRFC3339(args.end)) args.end = new Date().toISOString();","typeGuard":"null","tryCatchPattern":null,"preventionTips":["Use toISOString() for end boundaries","Include timezone offset always (Z or ±hh:mm)","Omit end when you want 'now'"],"tags":["cloud-tools","time-parsing","validation"],"backgroundTag":"invalid-date-format","analyzedSha":"d9463cbe21874e44ab79db6fa63e746ca7d22928","analyzedAt":"2026-09-07T10:08:55.855Z","contentChangedAt":"2026-09-07T10:08:55.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}