Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Dec 2, 2025

For instance, if you set this config

[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
@ashb ashb added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 2, 2025
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Good catch

@ashb ashb merged commit 586fe93 into apache:main Dec 2, 2025
57 checks passed
@ashb ashb deleted the custom-percent-log-fmt-error-handling branch December 2, 2025 17:50
github-actions bot pushed a commit that referenced this pull request Dec 2, 2025
…ing. (#58959)

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
(cherry picked from commit 586fe93)

Co-authored-by: Ash Berlin-Taylor <ash@apache.org>
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Dec 2, 2025
…ing. (apache#58959)

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
(cherry picked from commit 586fe93)

Co-authored-by: Ash Berlin-Taylor <ash@apache.org>
@ashb ashb added this to the Airflow 3.1.4 milestone Dec 2, 2025
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Dec 3, 2025
…#58959)

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
…#58959)

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants