argoproj/argo-workflows · error

--since-time and --since cannot be used together

Error message

--since-time and --since cannot be used together

What it means

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.

Source

Thrown at cmd/argo/commands/logs.go:65

# Print the logs of a pods:

  argo logs --since=1h my-pod

# Print the logs of the latest workflow:
  argo logs @latest
`,
		Args: cobra.RangeArgs(1, 2),
		RunE: func(cmd *cobra.Command, args []string) error {
			// parse all the args
			workflow := args[0]
			podName := ""

			if len(args) == 2 {
				podName = args[1]
			}

			if since > 0 && sinceTime != "" {
				return errors.New("--since-time and --since cannot be used together")
			}

			if since > 0 {
				logOptions.SinceSeconds = new(int64(since.Seconds()))
			}

			if sinceTime != "" {
				parsedTime, err := time.Parse(time.RFC3339, sinceTime)
				if err != nil {
					return err
				}
				sinceTime := metav1.NewTime(parsedTime)
				logOptions.SinceTime = &sinceTime
			}

			if tailLines >= 0 {
				logOptions.TailLines = new(tailLines)
			}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Remove either --since or --since-time, keeping only one
  2. If you need an absolute start, convert the timestamp to a duration (or vice versa) before invoking
  3. In wrapper scripts, make the two flags mutually exclusive (e.g. only append --since when --since-time is unset)

Example fix

// before
argo logs my-wf --since 1h --since-time 2026-01-01T00:00:00Z
// after
argo logs my-wf --since-time 2026-01-01T00:00:00Z
Defensive patterns

Strategy: validation

Validate before calling

# reject before invoking argo
if [ -n "$SINCE" ] && [ -n "$SINCE_TIME" ]; then echo "--since-time and --since cannot be used together" >&2; exit 2; fi
argo logs "$WF" ${SINCE:+--since "$SINCE"} ${SINCE_TIME:+--since-time "$SINCE_TIME"}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/981694a8e0f9de06. Report an issue: GitHub.