From 08088d2874e404de0245253c108cd9b446c18fa7 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai <mchellathura@magento.com>
Date: Thu, 19 May 2016 19:13:49 -0500
Subject: [PATCH] MAGETWO-52000: [Github][PR]impossible to see what is wrong
 with cron - unhelpful error message #3189

- updating job set cache
---
 .../Magento/Setup/Model/Cron/JobSetCache.php  | 20 +++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/setup/src/Magento/Setup/Model/Cron/JobSetCache.php b/setup/src/Magento/Setup/Model/Cron/JobSetCache.php
index 7f58f34b7b1..cc12b8dea1e 100644
--- a/setup/src/Magento/Setup/Model/Cron/JobSetCache.php
+++ b/setup/src/Magento/Setup/Model/Cron/JobSetCache.php
@@ -63,12 +63,20 @@ class JobSetCache extends AbstractJob
                     $arguments[AbstractCacheManageCommand::INPUT_KEY_TYPES] = explode(' ', $this->params[0]);
                 }
                 $arguments['command'] = 'cache:enable';
-                $definition = new InputDefinition([
-                    new InputArgument(AbstractCacheManageCommand::INPUT_KEY_TYPES, InputArgument::REQUIRED),
-                    new InputArgument('command', InputArgument::REQUIRED),
-                ]);
-
-                $this->command->setDefinition($definition);
+                $inputDefinition = [];
+                if ($this->command->getDefinition()->hasArgument('command')) {
+                    $inputDefinition[] = new InputArgument('command', InputArgument::REQUIRED);
+                }
+                if ($this->command->getDefinition()->hasArgument(AbstractCacheManageCommand::INPUT_KEY_TYPES)) {
+                    $inputDefinition[] = new InputArgument(
+                        AbstractCacheManageCommand::INPUT_KEY_TYPES,
+                        InputArgument::REQUIRED
+                    );
+                }
+                if (!empty($inputDefinition)) {
+                    $definition = new InputDefinition($inputDefinition);
+                    $this->command->setDefinition($definition);
+                }
             } else {
                 $arguments['command'] = 'cache:disable';
             }
-- 
GitLab