Skip to content

Disable use of LogTemplate table by default#61880

Merged
potiuk merged 1 commit intoapache:v2-11-testfrom
potiuk:disable-log-template-history
Feb 14, 2026
Merged

Disable use of LogTemplate table by default#61880
potiuk merged 1 commit intoapache:v2-11-testfrom
potiuk:disable-log-template-history

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Feb 13, 2026

Accessing the database when rendering log template might introduce unnecesary risks to execute code in webserver and we should disable it by default.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk potiuk force-pushed the disable-log-template-history branch from bac7d55 to 2926bea Compare February 13, 2026 20:36
@potiuk potiuk marked this pull request as ready for review February 13, 2026 20:36
@potiuk potiuk force-pushed the disable-log-template-history branch 2 times, most recently from 3d9cbcb to 23f8827 Compare February 13, 2026 20:37
@potiuk potiuk added this to the Airflow 2.11.1 milestone Feb 13, 2026
elasticsearch_id=airflow_conf.get(
"elasticsearch",
"log_id_template",
fallback="{dag_id}-{task_id}-{run_id}-{map_index}-{try_number}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needs to be {{ }}. like this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really - that's a string that is already default - the {{ is only needed when we read it from config and where it is processed first by Jinja template. But yeah - I will double check if this works as expected (also this fallback is not going to be used most likely - it's only in case the code is run before ProvidersManager discovery - because once providers manager processes it, there is a default defined from provider.yaml.

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

Accessing the database when rendering log template might introduce
unnecesary risks to execute code in webserver and we should
disable it by default.

Update airflow/config_templates/config.yml

Co-authored-by: GPK <gopidesupavan@gmail.com>
@potiuk potiuk force-pushed the disable-log-template-history branch from e1a37cf to 0962b09 Compare February 14, 2026 11:41
@potiuk
Copy link
Member Author

potiuk commented Feb 14, 2026

Fixed tests - also added more tests with / without configuration set.

@potiuk potiuk merged commit b337a54 into apache:v2-11-test Feb 14, 2026
66 checks passed
@potiuk potiuk deleted the disable-log-template-history branch February 14, 2026 12:26
potiuk added a commit that referenced this pull request Feb 16, 2026
Accessing the database when rendering log template might introduce
unnecesary risks to execute code in webserver and we should
disable it by default.

Update airflow/config_templates/config.yml

Co-authored-by: GPK <gopidesupavan@gmail.com>
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.

3 participants

Comments