diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 6dc2436d..4e3ff9f5 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -963,12 +963,15 @@ class BatchMasterView(MasterView): # run command in subprocess log.debug("launching command in subprocess: %s", cmd) try: - subprocess.check_output(cmd, stderr=subprocess.PIPE) + # nb. we do not capture stderr, but on failure the stdout + # will contain a simple error string + subprocess.check_output(cmd) except subprocess.CalledProcessError as error: log.warning("command failed with exit code %s! output was:", error.returncode) - log.warning(error.stderr.decode('utf_8')) - raise + output = error.output.decode('utf_8') + log.warning(output) + raise Exception(output) def action_subprocess_thread(self, key, port, username, handler_action, progress, **kwargs): """ @@ -1009,8 +1012,8 @@ class BatchMasterView(MasterView): progress.session.load() progress.session['error'] = True progress.session['error_msg'] = ( - "{} of '{}' batch failed (see logs for more info)").format( - handler_action, self.handler.batch_key) + "{} of '{}' batch failed: {} (see logs for more info)").format( + handler_action, self.handler.batch_key, error) progress.session.save() return