Maxdeboer9 commented on issue #53077: URL: https://github.com/apache/airflow/issues/53077#issuecomment-3265385466
I am using the Apache Airflow image 3.0.6 with the latest docker provider 4.4.2: `default@0cae6d17f5b7:/opt/airflow$ python -c "import airflow.providers.docker; import pkg_resources; print(pkg_resources.get_distribution('apache-airflow-providers-docker').version)" 4.4.2` The following basic use of the task.docker operator: `from datetime import datetime from zoneinfo import ZoneInfo from airflow import DAG from airflow.decorators import task @task.docker( image="python:3.12", network_mode="bridge", task_id="get_evc_data_docker", multiple_outputs=True, docker_url="unix://var/run/docker.sock", mount_tmp_dir=False ) def evc_data_operator(some_text: str) -> None: print(some_text) def_args = { "owner": "airflow", "retries": 0, "start_date": datetime(2025, 6, 28, tzinfo=ZoneInfo("Europe/Amsterdam")), } with DAG( dag_id="some_test_dag", default_args=def_args, catchup=False, schedule="0 9 * * 1", ) as dag: data_evc_task = evc_data_operator("Some text passed to docker operator") data_evc_task` Will result in the following error: ` INFO - DAG bundles loaded: dags-folder: source="airflow.dag_processing.bundles.manager.DagBundlesManager" INFO - Filling up the DagBag from /opt/airflow/dags/peaklogger/test_dag.py: source="airflow.models.dagbag.DagBag" INFO - Starting docker container from image python:3.12: source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator" INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_SCRIPT"]);f = open("/tmp/script.py", "wb"); f.write(x);': source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator" INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_INPUT"]);f = open("/tmp/script.in", "wb"); f.write(x);': source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator" INFO - + python3 /tmp/script.py /tmp/script.in /tmp/script.out none /tmp/script.out: source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator" INFO - Some text passed to docker operator: source="airflow.task.operators.airflow.providers.docker.decorators.docker._DockerDecoratedOperator" ERROR - Task failed with exception: source="task" AttributeError: '_DockerDecoratedOperator' object has no attribute 'xcom_push` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org