{"record":{"id":"c7d90101321dcf86","repo":"argoproj/argo-workflows","slug":"failure-to-create-dynamic-client-w-c7d901","errorCode":null,"errorMessage":"failure to create dynamic client: %w","messagePattern":"failure to create dynamic client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/auth/gatekeeper.go","lineNumber":350,"sourceCode":"\tif fields == nil {\n\t\tfields = logging.Fields{}\n\t}\n\tfields[\"subject\"] = claims.Subject\n\tif claims.Email != \"\" {\n\t\tfields[\"email\"] = claims.Email\n\t}\n\treturn fields\n}\n\nfunc DefaultClientForAuthorization(authorization string, config *rest.Config) (*rest.Config, *servertypes.Clients, error) {\n\trestConfig, err := kubeconfig.GetRestConfig(authorization)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to create REST config: %w\", err)\n\t}\n\trestConfig = mergeServerRestConfig(config, restConfig)\n\tdynamicClient, err := dynamic.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failure to create dynamic client: %w\", err)\n\t}\n\twfClient, err := workflow.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failure to create workflow client: %w\", err)\n\t}\n\teventsClient, err := events.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failure to create events client: %w\", err)\n\t}\n\tkubeClient, err := kubernetes.NewForConfig(restConfig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failure to create kubernetes client: %w\", err)\n\t}\n\treturn restConfig, &servertypes.Clients{\n\t\tDynamic:    dynamicClient,\n\t\tWorkflow:   wfClient,\n\t\tEvents:     eventsClient,\n\t\tKubernetes: kubeClient,","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/server/auth/gatekeeper.go#L332-L368","documentation":"After building the merged rest.Config, dynamic.NewForConfig failed — the config is syntactically unusable for the dynamic client (e.g. malformed host URL). This is a per-request auth-path failure in DefaultClientForAuthorization.","triggerScenarios":"Thrown at server/auth/gatekeeper.go:350 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the server's kubeconfig/host configuration","Fix the Authorization credential so the derived rest.Config is valid"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}