diff --git a/src/DIRAC/Resources/Computing/SSHComputingElement.py b/src/DIRAC/Resources/Computing/SSHComputingElement.py index b157a0d6e87..81b8b7df6bd 100644 --- a/src/DIRAC/Resources/Computing/SSHComputingElement.py +++ b/src/DIRAC/Resources/Computing/SSHComputingElement.py @@ -507,12 +507,15 @@ def __executeHostCommand(self, command, options, ssh=None, host=None): # Examine results of the job submission if sshStatus == 0: output = sshStdout.strip().replace("\r", "").strip() + if not output: + return S_ERROR("No output from remote command") + try: index = output.index("============= Start output ===============") output = output[index + 42 :] - except Exception: - self.log.exception("Invalid output from remote command", output) + except ValueError: return S_ERROR(f"Invalid output from remote command: {output}") + try: output = unquote(output) result = json.loads(output)