Bugfix/fix fernet after removal global in configuration#59958
Merged
jscheffl merged 2 commits intoapache:mainfrom Dec 31, 2025
Merged
Conversation
jscheffl
commented
Dec 31, 2025
potiuk
approved these changes
Dec 31, 2025
Contributor
Author
|
Correct, no backport needed as the problem was introduced indirectly by other PR which is also for 3.2.0/main only. |
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
jhgoebbert
pushed a commit
to jhgoebbert/airflow_Owen-CH-Leung
that referenced
this pull request
Feb 8, 2026
* Fix FernetKey generation after removal of global in configuration.py * Add pytest
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Mar 4, 2026
* Fix FernetKey generation after removal of global in configuration.py * Add pytest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Noneinstead of an empty string. This casued the config getter when checking to fallback whereNonewas 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.