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

   ## Problem
   
   When using remote logging in Airflow 3.x with `remote_task_handler_kwargs` 
containing `FileTaskHandler` parameters like `max_bytes`, `backup_count`, or 
`delay`, the application crashes on startup with:
   
   ```
   TypeError: WasbRemoteLogIO.__init__() got an unexpected keyword argument 
'max_bytes'
   ```
   
   This is a regression from PR #48491 which introduced separate `RemoteLogIO` 
classes for remote storage operations.
   
   ## Root Cause
   
   In Airflow 2.x, `remote_task_handler_kwargs` configured the handler 
directly. In Airflow 3.x, the same kwargs dict is passed entirely to 
`RemoteLogIO` constructors (which only accept I/O-specific parameters like 
`remote_base`, `base_log_folder`, `delete_local_copy`), and then the dict is 
cleared to `{}`. This means:
   
   1. Handler-level params (`max_bytes`, `backup_count`, `delay`) cause 
`TypeError` in `RemoteLogIO.__init__`
   2. Even if they didn't error, they'd be lost before reaching the handler 
config update at the end
   
   ## Fix
   
   Separate `remote_task_handler_kwargs` into two groups before processing:
   - **Handler kwargs** (`max_bytes`, `backup_count`, `delay`) → preserved and 
applied to `FileTaskHandler` config
   - **Remote I/O kwargs** (everything else) → passed to `RemoteLogIO` 
constructors
   
   This restores backward compatibility with Airflow 2.x configuration while 
working correctly with the new RemoteLogIO architecture.
   
   Closes: #58770
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
   


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