{"record":{"id":"c96b5b067c40f68f","repo":"argoproj/argo-workflows","slug":"failed-to-create-workflow-template-w","errorCode":null,"errorMessage":"failed to create workflow template: %w","messagePattern":"failed to create workflow template: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/template/create.go","lineNumber":58,"sourceCode":"\t\treturn err\n\t}\n\tserviceClient, err := apiClient.NewWorkflowTemplateServiceClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tworkflowTemplates := generateWorkflowTemplates(ctx, filePaths, cliOpts.strict)\n\n\tfor _, wftmpl := range workflowTemplates {\n\t\tif wftmpl.Namespace == \"\" {\n\t\t\twftmpl.Namespace = client.Namespace(ctx)\n\t\t}\n\t\tcreated, err := serviceClient.CreateWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateCreateRequest{\n\t\t\tNamespace: wftmpl.Namespace,\n\t\t\tTemplate:  &wftmpl,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create workflow template: %w\", err)\n\t\t}\n\t\tprintWorkflowTemplate(created, cliOpts.output.String())\n\t}\n\treturn nil\n}\n","sourceCodeStart":40,"sourceCodeEnd":64,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/template/create.go#L40-L64","documentation":"CreateWorkflowTemplates wraps any error returned by the CreateWorkflowTemplate gRPC call for each template loaded from the given file paths. It fires when the server rejects a template creation — commonly due to validation failure (strict spec errors), a duplicate template name, or RBAC denial in the target namespace — preserving the server-side cause via %w.","triggerScenarios":"Thrown at cmd/argo/commands/template/create.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lint the template file with argo template lint","Check for name collisions and RBAC permissions in the namespace"],"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"}