{"record":{"id":"a9261a5fa54def64","repo":"argoproj/argo-workflows","slug":"failed-to-suspend-s-w","errorCode":null,"errorMessage":"failed to suspend %s: %w","messagePattern":"failed to suspend (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/suspend.go","lineNumber":37,"sourceCode":"\n# Suspend the latest workflow:\n  argo suspend @latest\n`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\t\t\tctx, apiClient, err := client.NewAPIClient(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tserviceClient := apiClient.NewWorkflowServiceClient(ctx)\n\t\t\tnamespace := client.Namespace(ctx)\n\t\t\tfor _, wfName := range args {\n\t\t\t\t_, err := serviceClient.SuspendWorkflow(ctx, &workflowpkg.WorkflowSuspendRequest{\n\t\t\t\t\tName:      wfName,\n\t\t\t\t\tNamespace: namespace,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to suspend %s: %w\", wfName, err)\n\t\t\t\t}\n\t\t\t\tfmt.Printf(\"workflow %s suspended\\n\", wfName)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\treturn command\n}\n","sourceCodeStart":19,"sourceCodeEnd":46,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/suspend.go#L19-L46","documentation":"The 'argo suspend' command wraps any error returned by the SuspendWorkflow gRPC call for each named workflow. It fires when suspending one of the listed workflows fails — typically because the workflow does not exist, is already in a terminal phase (completed/failed), or the caller lacks RBAC permission — with the workflow name and underlying cause included.","triggerScenarios":"Thrown at cmd/argo/commands/suspend.go:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the workflow name and namespace","Verify RBAC allows patching workflows for suspension"],"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"}