Skip to content

Conversation

@jscheffl
Copy link
Contributor

Had a longer research in iterations in our codebase why PR #59819 created a regression in retrieving variables as discussed in Slack (https://apache-airflow.slack.com/archives/C06K9Q5G2UA/p1767101218465539)

Root cause was due to refactoring I changed the default initialization of the fernet_key to be None instead of an empty string. This casued the config getter when checking to fallback where None was actually passed as fallback but the config value defaults existed and while preparing the default it was attempted to expand variables in the defaults which had in this case not been iniitalized and the string formatter made "None" into the defaults which then prevented triggering a regeneration of a new fernet. Which then as using "None" (String) as Fernet caused variables to fail encoding in DB.

Fix is to use empty string for fernet (as well to be consistent with JWT) as before PR #59819 - to be on the safe side removing the fallback and bad check for missing fernet being passed in config.

This PR fixes the regression and adds a test hoping that this does not happen again.

@potiuk potiuk added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 31, 2025
@potiuk potiuk added this to the Airflow 3.1.6 milestone Dec 31, 2025
@potiuk potiuk removed the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 31, 2025
@potiuk potiuk removed this from the Airflow 3.1.6 milestone Dec 31, 2025
@jscheffl
Copy link
Contributor Author

Correct, no backport needed as the problem was introduced indirectly by other PR which is also for 3.2.0/main only.

@jscheffl jscheffl merged commit 945f981 into apache:main Dec 31, 2025
71 checks passed
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Jan 2, 2026
* Fix FernetKey generation after removal of global in configuration.py

* Add pytest
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
* Fix FernetKey generation after removal of global in configuration.py

* Add pytest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants