AchimGaedkeLynker opened a new issue, #69813:
URL: https://github.com/apache/airflow/issues/69813

   ### Under which category would you file this issue?
   
   Providers
   
   ### Apache Airflow version
   
   3.3
   
   ### What happened and how to reproduce it?
   
   (On a system I can't report from) I use `SSHRemoteJobOperator` with 
`remote_base_dir="/tmp-data/airflow-ssh-jobs"`.
   
   The operator starts and tracks the remote job till the end - as it has 
before.
   
   But instead of finishing cleanly (as the remote command did after an 
hour...), it fails while cleaning up the job.
   It raises a `Value Error` with the description:
   
   ```text
   Invalid job directory: '/tmp-data/airflow-ssh-jobs/af_ ....'. Expected Path 
under '/tmp/airflow-ssh-jobs' for safety.
   ```
   
   Removing the `remote_base_dir` argument avoids this failure.
   
   ### What you think should happen instead?
   
   Either the remote_base_dir should be rejected when instantiating the 
operator or succeed at the very end.
   
   Looking at the code, 
https://github.com/apache/airflow/blob/7f60646cd9934dcea99dd4bbb33d75f5650eba74/providers/ssh/src/airflow/providers/ssh/operators/ssh_remote_job.py#L167
 seems to have different validation criteria than 
https://github.com/apache/airflow/blob/7f60646cd9934dcea99dd4bbb33d75f5650eba74/providers/ssh/src/airflow/providers/ssh/utils/remote_job.py#L33
 is very restrictive as it only allows paths beginning with the default path.
   
   which used inside 
https://github.com/apache/airflow/blob/7f60646cd9934dcea99dd4bbb33d75f5650eba74/providers/ssh/src/airflow/providers/ssh/operators/ssh_remote_job.py#L455
 ... i.e the cleanup fails at the very end.
   
   ### Operating System
   
   Ubuntu 24.04
   
   ### Deployment
   
   Virtualenv installation
   
   ### Apache Airflow Provider(s)
   
   ssh
   
   ### Versions of Apache Airflow Providers
   
   python 3.12
   apache-airflow-providers-ssh==5.0.3
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   Just occurred when updating from airflow 3.2.x to 3.3.0, incl 
apache-airflow-providers-ssh 5.0.3 ->5.0.2
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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