argoproj/argo-workflows · error

unknown output mode: %s

Error message

unknown output mode: %s

What it means

The 'argo cron list' command only supports the '', 'wide', and 'name' output modes; any other --output value reaches this default branch of the switch and is rejected. It fires when a user passes an unsupported output format (e.g. json or yaml) to argo cron list, which this command does not implement.

Source

Thrown at cmd/argo/commands/cron/list.go:63

			}
			listOpts := metav1.ListOptions{}
			listOpts.LabelSelector = listArgs.labelSelector
			cronWfList, err := serviceClient.ListCronWorkflows(ctx, &cronworkflowpkg.ListCronWorkflowsRequest{
				Namespace:   namespace,
				ListOptions: &listOpts,
			})
			if err != nil {
				return err
			}
			switch listArgs.output.String() {
			case "", "wide":
				printTable(ctx, cronWfList.Items, &listArgs)
			case "name":
				for _, cronWf := range cronWfList.Items {
					fmt.Println(cronWf.Name)
				}
			default:
				return fmt.Errorf("unknown output mode: %s", listArgs.output.String())
			}
			return nil
		},
	}
	command.Flags().BoolVarP(&listArgs.allNamespaces, "all-namespaces", "A", false, "Show workflows from all namespaces")
	command.Flags().VarP(&listArgs.output, "output", "o", "Output format. "+listArgs.output.Usage())
	command.Flags().StringVarP(&listArgs.labelSelector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects must satisfy all of the specified label constraints.")
	return command
}

func printTable(ctx context.Context, wfList []wfv1.CronWorkflow, listArgs *listFlags) {
	w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0)
	if listArgs.allNamespaces {
		_, _ = fmt.Fprint(w, "NAMESPACE\t")
	}
	_, _ = fmt.Fprint(w, "NAME\tAGE\tLAST RUN\tNEXT RUN\tSCHEDULES\tTIMEZONE\tSUSPENDED")
	_, _ = fmt.Fprint(w, "\n")
	for _, cwf := range wfList {

View on GitHub (pinned to 35bff19146)

Solutions

  1. Use one of: (default), wide, or name for --output
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cmd/argo/commands/cron/list.go:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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