Closed yannibenoit closed 1 year ago
Thanks for opening your first issue here! Be sure to follow the issue template!
Check the airflow-scheduler log around the same time as the task was terminated. Particularly logs about "resetting orphaned tasks". Another thing to check is if the healthcheck in the compose file for the airflow-worker is firing.
@hterik thanks for your reply
Check the airflow-scheduler log around the same time as the task was terminated. Particularly logs about "resetting orphaned tasks".
I took a look to the scheduler logs i don't see what's wrong
The only think i don't understand is why in the log i see singer_wootric_stitch has 0/16 running and queued task
and my DAG only have two tasks
[2022-12-06 10:38:10,088] {dag.py:3427} INFO - Setting next_dagrun for singer_wootric_stitch to 2022-12-06T02:30:00+00:00, run_after=2022-12-07T02:30:00+00:00
[2022-12-06 10:42:15,335] {scheduler_job.py:1399} INFO - Resetting orphaned tasks for active dag runs
[2022-12-06 10:42:28,367] {scheduler_job.py:361} INFO - 1 tasks up for execution:
<TaskInstance: singer_wootric_stitch.bash_create_and_init_wootric_venv manual__2022-12-06T10:42:27.697205+00:00 [scheduled]>
[2022-12-06 10:42:28,368] {scheduler_job.py:429} INFO - DAG singer_wootric_stitch has 0/16 running and queued tasks
[2022-12-06 10:42:28,368] {scheduler_job.py:511} INFO - Setting the following tasks to queued state:
<TaskInstance: singer_wootric_stitch.bash_create_and_init_wootric_venv manual__2022-12-06T10:42:27.697205+00:00 [scheduled]>
[2022-12-06 10:42:28,370] {scheduler_job.py:550} INFO - Sending TaskInstanceKey(dag_id='singer_wootric_stitch', task_id='bash_create_and_init_wootric_venv', run_id='manual__2022-12-06T10:42:27.697205+00:00', try_number=1, map_index=-1) to executor with priority 3 and queue default
[2022-12-06 10:42:28,370] {base_executor.py:95} INFO - Adding to queue: ['airflow', 'tasks', 'run', 'singer_wootric_stitch', 'bash_create_and_init_wootric_venv', 'manual__2022-12-06T10:42:27.697205+00:00', '--local', '--subdir', 'DAGS_FOLDER/stitch-wootric.py']
[2022-12-06 10:42:28,416] {scheduler_job.py:608} INFO - Executor reports execution of singer_wootric_stitch.bash_create_and_init_wootric_venv run_id=manual__2022-12-06T10:42:27.697205+00:00 exited with status queued for try_number 1
[2022-12-06 10:42:28,421] {scheduler_job.py:635} INFO - Setting external_id for <TaskInstance: singer_wootric_stitch.bash_create_and_init_wootric_venv manual__2022-12-06T10:42:27.697205+00:00 [queued]> to e70c0577-a3ac-48e8-90d7-53ca8b1e0ed1
[2022-12-06 10:42:35,383] {scheduler_job.py:608} INFO - Executor reports execution of singer_wootric_stitch.bash_create_and_init_wootric_venv run_id=manual__2022-12-06T10:42:27.697205+00:00 exited with status failed for try_number 1
[2022-12-06 10:42:35,388] {scheduler_job.py:665} INFO - TaskInstance Finished: dag_id=singer_wootric_stitch, task_id=bash_create_and_init_wootric_venv, run_id=manual__2022-12-06T10:42:27.697205+00:00, map_index=-1, run_start_date=2022-12-06 10:42:28.784786+00:00, run_end_date=2022-12-06 10:42:33.995946+00:00, run_duration=5.21116, state=failed, executor_state=failed, try_number=1, max_tries=0, job_id=1445, pool=default_pool, queue=default, priority_weight=3, operator=BashOperator, queued_dttm=2022-12-06 10:42:28.369081+00:00, queued_by_job_id=1443, pid=356
[2022-12-06 10:42:36,244] {dagrun.py:585} ERROR - Marking run <DagRun singer_wootric_stitch @ 2022-12-06 10:42:27.697205+00:00: manual__2022-12-06T10:42:27.697205+00:00, state:running, queued_at: 2022-12-06 10:42:27.715605+00:00. externally triggered: True> failed
[2022-12-06 10:42:36,244] {dagrun.py:672} INFO - DagRun Finished: dag_id=singer_wootric_stitch, execution_date=2022-12-06 10:42:27.697205+00:00, run_id=manual__2022-12-06T10:42:27.697205+00:00, run_start_date=2022-12-06 10:42:28.349133+00:00, run_end_date=2022-12-06 10:42:36.244274+00:00, run_duration=7.895141, state=failed, external_trigger=True, run_type=manual, data_interval_start=2022-12-05 02:30:00+00:00, data_interval_end=2022-12-06 02:30:00+00:00, dag_hash=1d2d3ebd4d08de6ec4eec5ab9f865a15
[2022-12-06 10:42:36,248] {dag.py:3427} INFO - Setting next_dagrun for singer_wootric_stitch to 2022-12-06T02:30:00+00:00, run_after=2022-12-07T02:30:00+00:00
Another thing to check is if the healthcheck in the compose file for the airflow-worker is firing. healthcheck seems running when i run
docker ps
command
Found a fix after looking at a stack overflow post -> Celery Executor - Airflow Impersonation "run_as_user" Recorded pid xxx does not match the current pid - Stack Overflow
I was running my bash operator with a run_as_user=airflow
, i think i don't need anymore
Apache Airflow version
2.4.3
What happened
I recently upgraded airflow to 2.4.3
Some DAGs are not working anymore and i see an error in logs
What you think should happen instead
Dag must get executed successfully without any sigterm signal.
How to reproduce
No response
Operating System
NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)"
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==6.0.0 apache-airflow-providers-common-sql==1.2.0 apache-airflow-providers-docker==3.3.0 apache-airflow-providers-ftp==3.1.0 apache-airflow-providers-google==8.4.0 apache-airflow-providers-http==4.0.0 apache-airflow-providers-imap==3.0.0 apache-airflow-providers-mongo==3.0.0 apache-airflow-providers-postgres==5.2.2 apache-airflow-providers-slack==6.0.0 apache-airflow-providers-sqlite==3.2.1
Deployment
Docker-Compose
Deployment details
Attached docker-compose template use by Ansible to Deploy
Anything else
No response
Are you willing to submit PR?
Code of Conduct