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

   ## Problem
   
   `init_log_folder()` iterates through all parent directories from `/` calling 
`mkdir()` on each. For paths on mounted filesystems (e.g. 
`/mnt/nfs-share/airflow/logs`), this calls `mkdir('/mnt')` and 
`mkdir('/mnt/nfs-share')` which fails with `PermissionError` because the 
Airflow user cannot create system-level directories. `exist_ok=True` only 
suppresses `FileExistsError`, not `PermissionError`, crashing all Airflow CLI 
commands including `airflow db migrate`.
   
   ## Fix
   
   - Replaced the explicit parent loop in `init_log_folder()` with 
`Path.mkdir(parents=True, exist_ok=True)` which only creates directories that 
don't already exist, stopping at the first existing parent
   - Wrapped the call in `try/except (PermissionError, OSError)` to log a 
warning instead of crashing
   - Wrapped the `init_log_folder()` call in `configure_logging()` with the 
same try/except so CLI commands continue even if the log folder cannot be 
created
   
   Fixes #63863


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