{"record":{"id":"981694a8e0f9de06","repo":"argoproj/argo-workflows","slug":"since-time-and-since-cannot-be-used-together","errorCode":null,"errorMessage":"--since-time and --since cannot be used together","messagePattern":"--since-time and --since cannot be used together","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/logs.go","lineNumber":65,"sourceCode":"# Print the logs of a pods:\n\n  argo logs --since=1h my-pod\n\n# Print the logs of the latest workflow:\n  argo logs @latest\n`,\n\t\tArgs: cobra.RangeArgs(1, 2),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\t// parse all the args\n\t\t\tworkflow := args[0]\n\t\t\tpodName := \"\"\n\n\t\t\tif len(args) == 2 {\n\t\t\t\tpodName = args[1]\n\t\t\t}\n\n\t\t\tif since > 0 && sinceTime != \"\" {\n\t\t\t\treturn errors.New(\"--since-time and --since cannot be used together\")\n\t\t\t}\n\n\t\t\tif since > 0 {\n\t\t\t\tlogOptions.SinceSeconds = new(int64(since.Seconds()))\n\t\t\t}\n\n\t\t\tif sinceTime != \"\" {\n\t\t\t\tparsedTime, err := time.Parse(time.RFC3339, sinceTime)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tsinceTime := metav1.NewTime(parsedTime)\n\t\t\t\tlogOptions.SinceTime = &sinceTime\n\t\t\t}\n\n\t\t\tif tailLines >= 0 {\n\t\t\t\tlogOptions.TailLines = new(tailLines)\n\t\t\t}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/logs.go#L47-L83","documentation":"The `argo logs` command accepts either `--since` (a relative duration) or `--since-time` (an absolute RFC3339 timestamp) to bound how far back logs are fetched, but not both — Kubernetes pod log options can only carry one start boundary (SinceSeconds vs SinceTime). The CLI pre-validates this in cobra's Args/RunE and returns this error before any API call is made.","triggerScenarios":"Running `argo logs <workflow> --since 1h --since-time 2026-01-01T00:00:00Z`; both flags set means since>0 && sinceTime!=\"\" at cmd/argo/commands/logs.go:65.","commonSituations":"Shell scripts that conditionally append flags but accidentally pass both; copying an example command and adding an extra time flag; wrapper scripts with defaults for one flag while the user supplies the other.","solutions":["Remove either --since or --since-time, keeping only one","If you need an absolute start, convert the timestamp to a duration (or vice versa) before invoking","In wrapper scripts, make the two flags mutually exclusive (e.g. only append --since when --since-time is unset)"],"exampleFix":"// before\nargo logs my-wf --since 1h --since-time 2026-01-01T00:00:00Z\n// after\nargo logs my-wf --since-time 2026-01-01T00:00:00Z","handlingStrategy":"validation","validationCode":"# reject before invoking argo\nif [ -n \"$SINCE\" ] && [ -n \"$SINCE_TIME\" ]; then echo \"--since-time and --since cannot be used together\" >&2; exit 2; fi\nargo logs \"$WF\" ${SINCE:+--since \"$SINCE\"} ${SINCE_TIME:+--since-time \"$SINCE_TIME\"}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep only one time-bound flag in your logs wrapper","Prefer --since for relative windows, --since-time for absolute points","Document the exclusivity in team runbooks/scripts"],"tags":["cli","flag-conflict","argo-cli","logs"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}