{"record":{"id":"0d906bbe19d94519","repo":"cilium/cilium","slug":"failed-to-parse-the-since-time-w-0d906b","errorCode":null,"errorMessage":"failed to parse the since time: %w","messagePattern":"failed to parse the since time: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hubble/cmd/observe/flows.go","lineNumber":784,"sourceCode":"\tif first && last {\n\t\treturn nil, fmt.Errorf(\"cannot set both --first and --last\")\n\t}\n\tif first && selectorOpts.all {\n\t\treturn nil, fmt.Errorf(\"cannot set both --first and --all\")\n\t}\n\tif first && selectorOpts.follow {\n\t\treturn nil, fmt.Errorf(\"cannot set both --first and --follow\")\n\t}\n\tif last && selectorOpts.all {\n\t\treturn nil, fmt.Errorf(\"cannot set both --last and --all\")\n\t}\n\n\t// convert selectorOpts.since into a param for GetFlows\n\tvar since, until *timestamppb.Timestamp\n\tif selectorOpts.since != \"\" {\n\t\tst, err := hubtime.FromString(selectorOpts.since)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse the since time: %w\", err)\n\t\t}\n\n\t\tsince = timestamppb.New(st)\n\t\tif err := since.CheckValid(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to convert `since` timestamp to proto: %w\", err)\n\t\t}\n\t}\n\t// Set the until field if --until option is specified and --follow\n\t// is not specified. If --since is specified but --until is not, the server sets the\n\t// --until option to the current timestamp.\n\tif selectorOpts.until != \"\" && !selectorOpts.follow {\n\t\tut, err := hubtime.FromString(selectorOpts.until)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse the until time: %w\", err)\n\t\t}\n\t\tuntil = timestamppb.New(ut)\n\t\tif err := until.CheckValid(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to convert `until` timestamp to proto: %w\", err)","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/hubble/cmd/observe/flows.go#L766-L802","documentation":"The --since flag value is parsed with hubtime.FromString, which accepts relative durations (e.g. 5m) and absolute timestamps. If parsing fails, getFlowsRequest wraps the underlying error with this message, aborting request construction.","triggerScenarios":"Running `hubble observe --since blah`, `--since 2024-13-01` (invalid date), or an unparseable relative duration like `--since 5mins`.","commonSituations":"Shell quoting stripping units or adding stray characters; assuming arbitrary date formats are accepted (e.g. US-format MM/DD/YYYY); timezone-suffixed strings not supported by the parser.","solutions":["Use a valid relative duration like --since 5m, 1h, or 24h","Use an RFC3339 absolute timestamp, e.g. --since 2024-01-01T00:00:00Z","Run `hubble observe --help` / check hubtime.FromString docs for accepted formats","Quote the value in shell to avoid mangling (e.g. --since '5m')"],"exampleFix":"// before\nhubble observe --since 5 mins ago\n// after\nhubble observe --since 5m","handlingStrategy":"validation","validationCode":"func validSince(s string) error {\n    if s == \"\" { return nil }\n    if _, err := hubtime.FromString(s); err != nil {\n        return fmt.Errorf(\"--since %q unparseable: %w\", s, err)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"req, err := getFlowsRequest(ofilter, allow, deny)\nif err != nil && strings.HasPrefix(err.Error(), \"failed to parse the since\") {\n    return fmt.Errorf(\"check --since format (e.g. 5m or RFC3339): %w\", err)\n}","preventionTips":["Prefer simple relative durations (5m, 1h, 24h) in scripts","Always quote time flags in shell","Add pre-flight validation of --since/--until values in wrappers","Test scripts with the exact timestamp formats they emit"],"tags":["cli","time-parsing","hubble","validation"],"backgroundTag":"invalid-timestamp-format","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}