Skip to content

Exceptions become a mess in logs using a Python 3.11 docker operator - part 2 #58911

@notatallshaw-gts

Description

@notatallshaw-gts

Apache Airflow version

2.11.0

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

This is a follow up to #33692, which was only partially fixed by the submitted PR #43840

I just upgraded to Airflow 2.11.0, removed my internal patch to fix log formatting, but now I see errors like this:

[2025-11-30, 23:00:57 EST] {docker.py:66} INFO -   File ".../.venv/lib/python3.12/site-packages/click/core.py", line 814, in invoke
[2025-11-30, 23:00:57 EST] {docker.py:66} INFO -     return callback(*args, **kwargs)
[2025-11-30, 23:00:57 EST] {docker.py:66} INFO -            ^^^^^^^^^
[2025-11-30, 23:00:57 EST] {docker.py:66} INFO - ^^^^^^^^^^^^^^^
[2025-11-30, 23:00:57 EST] {docker.py:66} INFO - ^

What you think should happen instead?

The code should more carefully track chunks, it could receive midline splits like this:

[
    b"    rv = self.invoke(ctx)\n         ^^^",  # Note: no trailing newline, splits the carets
    b"^^^^^^^^^^^^^\n",  # Continuation of previous line
]

How to reproduce

Have an exception when using Docker Operator.

Operating System

Linux

Versions of Apache Airflow Providers

apache-airflow-providers-docker==4.4.3

Deployment

Self Hosted / Self Configured

Deployment details

Celery + Redis + Docker Swarm

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions