hsnprsd opened a new pull request, #24915:
URL: https://github.com/apache/airflow/pull/24915

   Current logs of ssh operator are too verbose. SSH hook already logs stdout 
and stderr of the running command in task logs, so there is no need for 
including stderr in AirflowException message returned by run_ssh_client_command.
   
   Example of current logs:
   ```
   <combined stderr & stdout of command>
   
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/ssh/operators/ssh.py",
 line 173, in execute
       result = self.run_ssh_client_command(ssh_client, self.command)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/ssh/operators/ssh.py",
 line 160, in run_ssh_client_command
       self.raise_for_status(exit_status, agg_stderr)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/ssh/operators/ssh.py",
 line 153, in raise_for_status
       raise AirflowException(f"error running cmd: {self.command}, error: 
{error_msg}")
   airflow.exceptions.AirflowException: error running cmd: **<ssh command>**, 
error: **<stderr of command>**
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.7/site-packages/divar_airflow/operators/spark_operator/ssh/spark_operator.py",
 line 199, in execute
       return super().execute(**context)
     File 
"/home/airflow/.local/lib/python3.7/site-packages/airflow/providers/ssh/operators/ssh.py",
 line 175, in execute
       raise AirflowException(f"SSH operator error: {str(e)}")
   airflow.exceptions.AirflowException: SSH operator error: error running cmd: 
**<ssh command>**, error: error running cmd: **<ssh command>**, error: 
**<stderr of command>**
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to