You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new using docker decorator in airflow for isolation. For some reason, my team decided to go environment isolation using docker container for more portability because out airflow also run inside container. I am not really sure how to fix this error, but I suspect this error occured when container task is pushing value to xcom. This error is not always happen but I'm not really sure what condition really trigger this situation.
This error happenned when executing task get_data_survey()
[2026-02-05 09:15:26] INFO - DAG bundles loaded: data-engineer-2025, projek_engineer
[2026-02-05 09:15:26] INFO - Filling up the DagBag from /app/projek_engineer/airflow-dags/dag-etl/myproject2025.py
[2026-02-05 09:15:32] INFO - Starting docker container from image localhost/projek_engineer-myproject2025:latest
[2026-02-05 09:15:32] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_SCRIPT"]);f = open("/tmp/script.py", "wb"); f.write(x);'
[2026-02-05 09:15:32] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_INPUT"]);f = open("/tmp/script.in", "wb"); f.write(x);'
[2026-02-05 09:15:32] INFO - + python3 /tmp/script.py /tmp/script.in /tmp/script.out none /tmp/script.out
[2026-02-05 09:16:17] INFO - downloading metadata myplatform-myproject2025
[2026-02-05 09:16:17] INFO - downloading dataset myplatform-myproject2025 offset=425
[2026-02-05 09:16:17] INFO - downloading dataset myplatform-myproject2025 offset=426
[2026-02-05 09:16:19] ERROR - Task failed with exception
ReadError: file could not be opened successfully:
- method gz: ReadError('empty file')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('empty file')
This is the log if there's no error
[2026-02-05 09:18:26] INFO - DAG bundles loaded: data-engineer-2025, projek_engineer
[2026-02-05 09:18:26] INFO - Filling up the DagBag from /app/projek_engineer/airflow-dags/dag-etl/myproject2025.py
[2026-02-05 09:18:32] INFO - Starting docker container from image localhost/projek_engineer-myproject2025:latest
[2026-02-05 09:18:32] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_SCRIPT"]);f = open("/tmp/script.py", "wb"); f.write(x);'
[2026-02-05 09:18:32] INFO - + python3 -c 'import base64, os;x = base64.b64decode(os.environ["__PYTHON_INPUT"]);f = open("/tmp/script.in", "wb"); f.write(x);'
[2026-02-05 09:18:32] INFO - + python3 /tmp/script.py /tmp/script.in /tmp/script.out none /tmp/script.out
[2026-02-05 09:19:17] INFO - downloading metadata myplatform-myproject2025
[2026-02-05 09:19:17] INFO - downloading dataset myplatform-myproject2025 offset=425
[2026-02-05 09:19:17] INFO - downloading dataset myplatform-myproject2025 offset=426
[2026-02-05 09:19:20] INFO - Pushing xcom ti=RuntimeTaskInstance(id=UUID('019c2af0-0af0-7e7b-bb66-5b74d4064511'), task_id='get_data_survey', dag_id='myproject2025', run_id='scheduled__2026-02-04T23:15:00+00:00', try_number=1, dag_version_id=UUID('019c236b-da90-7cc2-b35e-5087fda54754'), map_index=0, hostname='systemd-airflow', context_carrier={}, task=<Task(_DockerDecoratedOperator): get_data_survey>, bundle_instance=LocalDagBundle(name=projek_engineer), max_tries=0, start_date=datetime.datetime(2026, 2, 5, 9, 19,20, 625965, tzinfo=datetime.timezone.utc), end_date=None, state=<TaskInstanceState.RUNNING: 'running'>, is_mapped=True, rendered_map_index=None)
As I mentioned earlier, the error is not always happens. Some time , the dag run without any error, sometime error happen in check_status_survey(), sometime happen in one of get_data_survey() dynamic task. I have tried to use mount_tmp_dir=False or auto_remove='never' and error stil happen sometime. The check_status_survey() has nested dictionary value to push, and get_data_survey() has a simple dictionary with 4 paired key-value(s). By retrying the error task, sometime it resolves the error. Adding retry mechanism also is not really assuring but worked sometime.
From what I suspect, this is a race condition situation for task container is being closed before it is done to push value to xcom.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am new using docker decorator in airflow for isolation. For some reason, my team decided to go environment isolation using docker container for more portability because out airflow also run inside container. I am not really sure how to fix this error, but I suspect this error occured when container task is pushing value to xcom. This error is not always happen but I'm not really sure what condition really trigger this situation.
This error happenned when executing task get_data_survey()
This is the log if there's no error
This is its dag code
As I mentioned earlier, the error is not always happens. Some time , the dag run without any error, sometime error happen in
check_status_survey(), sometime happen in one ofget_data_survey()dynamic task. I have tried to usemount_tmp_dir=Falseorauto_remove='never'and error stil happen sometime. Thecheck_status_survey()has nested dictionary value to push, andget_data_survey()has a simple dictionary with 4 paired key-value(s). By retrying the error task, sometime it resolves the error. Adding retry mechanism also is not really assuring but worked sometime.From what I suspect, this is a race condition situation for task container is being closed before it is done to push value to xcom.
Beta Was this translation helpful? Give feedback.
All reactions