Skip to content

Conversation

@o-nikolas
Copy link
Contributor

@o-nikolas o-nikolas commented Sep 10, 2025

Despite a None check already existing here

We still regularly see the below traceback failing our system tests, particularly on the Lambda executor. This PR adds an additional try/catch for TypeError around this code to ensure we default to None in cases where the since_time is either None or some other unacceptable value.

Traceback (most recent call last):
  File "/opt/airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py", line 704, in execute_sync
  File "/var/lang/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
  File "/var/lang/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
  File "/var/lang/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
  File "/var/lang/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
  File "/var/lang/lib/python3.12/concurrent/futures/_base.py", line 449, in result
  File "/var/lang/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
  File "/var/lang/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
  File "/opt/airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py", line 777, in await_pod_completion
  File "/opt/airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py", line 721, in fetch_requested_container_logs
  File "/opt/airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py", line 604, in fetch_container_logs
  File "/opt/airflow/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/pod_manager.py", line 529, in consume_logs
  File "/var/lang/lib/python3.12/site-packages/pendulum/datetime.py", line 1215, in __sub__
  File "/var/lang/lib/python3.12/site-packages/pendulum/datetime.py", line 712, in diff
  File "/var/lang/lib/python3.12/site-packages/pendulum/interval.py", line 183, in __init__
TypeError: 'NoneType' object cannot be converted to 'PyString'

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

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Sep 10, 2025
@o-nikolas
Copy link
Contributor Author

CC @isaiahiruoha

@isaiahiruoha
Copy link
Contributor

I thought this day would never come, changes lgtm 😁

@o-nikolas o-nikolas merged commit f97826d into apache:main Sep 11, 2025
88 checks passed
@o-nikolas o-nikolas deleted the onikolas/consume_logs_error_handling branch September 11, 2025 15:39
suman-himanshu pushed a commit to suman-himanshu/airflow that referenced this pull request Sep 17, 2025
Brunda10 pushed a commit to Brunda10/airflow that referenced this pull request Sep 17, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants