rokadepiyush49-rgb opened a new issue, #77513:
URL: https://github.com/apache/airflow/issues/77513

   **Under which category would you file this issue?** Providers
   **Apache Airflow Provider(s):** amazon
   **Versions of Apache Airflow Providers:** apache-airflow-providers-amazon 
9.41.0 (also on `main`)
   **Apache Airflow version:** 3.x (the bug is in the provider)
   **Deployment:** Other (reproduced locally with moto and a local FTP server)
   
   **What happened and how to reproduce it?**
   With `s3_filenames="*"`, both operators transfer every key that `list_keys` 
returns under `s3_key`. A folder created with the S3 console's *Create folder* 
button is stored as an empty object whose key ends in `/`. The operators try to 
store that key as a file at the destination directory path, and the server 
rejects it, so the task fails before any real file is transferred.
   
   ```python
   # bucket contents: "reports/" (console folder marker), "reports/jan.csv"
   S3ToFTPOperator(task_id="s3_to_ftp", s3_bucket="bucket", s3_key="reports/",
                   ftp_path="/out/", s3_filenames="*")
   ```
   ```
   ftplib.error_perm: 550 Is a directory.
   ```
   `S3ToSFTPOperator` has the same code path (`sftp_client.put(..., "/out/")`). 
With a string prefix instead of `"*"`, markers are not transferred but can 
appear in the "not selected" warning.
   
   **What you think should happen instead?**
   Keys ending in `/` should be skipped and logged, as #76408 did for 
`S3ToAzureBlobStorageOperator`. Unlike object stores, an SFTP/FTP server cannot 
hold a file whose path ends in `/`, so every marker should be skipped, not only 
those that overlap another key.
   
   **Anything else?** Nested keys (`reports/sub/two.txt`) also need the 
destination subdirectory to exist, because neither operator creates remote 
directories. That is existing behavior and separate from this bug. (Found and 
reproduced with help from Claude Code.)
   
   **Are you willing to submit PR?** Yes
   


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

  • [I] S3ToSFTPOperator and S3ToF... rokadepiyush49-rgb (via GitHub) via commits

Reply via email to