argoproj/argo-workflows · error

failure to create workflow client

Error message

failure to create workflow client: %w

What it means

DefaultClientForAuthorization could not construct the workflow clientset (workflow.NewForConfig) from the merged rest.Config. Like its siblings, it means the per-request Kubernetes clients could not be initialized for this authorization.

Solutions

  1. Inspect the wrapped error for the config problem
  2. Verify server kubeconfig and the caller's credential format
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/auth/gatekeeper.go:354 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/915a2ebae3b2cccf. Report an issue: GitHub.

Appendix: source

Thrown at server/auth/gatekeeper.go:354

	if claims.Email != "" {
		fields["email"] = claims.Email
	}
	return fields
}

func DefaultClientForAuthorization(authorization string, config *rest.Config) (*rest.Config, *servertypes.Clients, error) {
	restConfig, err := kubeconfig.GetRestConfig(authorization)
	if err != nil {
		return nil, nil, fmt.Errorf("failed to create REST config: %w", err)
	}
	restConfig = mergeServerRestConfig(config, restConfig)
	dynamicClient, err := dynamic.NewForConfig(restConfig)
	if err != nil {
		return nil, nil, fmt.Errorf("failure to create dynamic client: %w", err)
	}
	wfClient, err := workflow.NewForConfig(restConfig)
	if err != nil {
		return nil, nil, fmt.Errorf("failure to create workflow client: %w", err)
	}
	eventsClient, err := events.NewForConfig(restConfig)
	if err != nil {
		return nil, nil, fmt.Errorf("failure to create events client: %w", err)
	}
	kubeClient, err := kubernetes.NewForConfig(restConfig)
	if err != nil {
		return nil, nil, fmt.Errorf("failure to create kubernetes client: %w", err)
	}
	return restConfig, &servertypes.Clients{
		Dynamic:    dynamicClient,
		Workflow:   wfClient,
		Events:     eventsClient,
		Kubernetes: kubeClient,
	}, nil
}

func mergeServerRestConfig(argoServerConfig *rest.Config, newConfig *rest.Config) *rest.Config {

View on GitHub (pinned to 35bff19146)