I just deployed an Airflow (v2.7.1). When I try to trigger the DAG, I get this error:
And from this is the log says:
webserver sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) null value in column “clear_number” of relation “dag_run” violates not-null constraint │
webserver DETAIL: Failing row contains (1418, my_dummy_operator, 2024-05-07 15:02:12.586603+00, 2024-05-07 15:02:12.566004+00, null, null, queued, manual__2024-05-07T15:02:12.566004+00:00, null, t, manual, │
│ x80057d942e, 2024-05-07 15:02:12.566004+00, 2024-05-07 15:02:12.566004+00, null, 52940d8f03dc1dc1ada15eb42dd4a4b5, 1, 2024-05-07 15:02:12.58827+00, null).
webserver [SQL: INSERT INTO dag_run (dag_id, queued_at, execution_date, start_date, end_date, state, run_id, creating_job_id, external_trigger, run_type, conf, data_interval_start, data_interval_end, last_sch │
│ eduling_decision, dag_hash, log_template_id, updated_at) VALUES (%(dag_id)s, %(queued_at)s, %(execution_date)s, %(start_date)s, %(end_date)s, %(state)s, %(run_id)s, %(creating_job_id)s, %(external_trigger)s, │
│ %(run_type)s, %(conf)s, %(data_interval_start)s, %(data_interval_end)s, %(last_scheduling_decision)s, %(dag_hash)s, (SELECT max(log_template.id) AS max_1 │
webserver FROM log_template), %(updated_at)s) RETURNING dag_run.id]
webserver [parameters: {‘dag_id’: ‘my_dummy_operator’, ‘queued_at’: datetime.datetime(2024, 5, 7, 15, 2, 12, 586603, tzinfo=Timezone(‘UTC’)), ‘execution_date’: DateTime(2024, 5, 7, 15, 2, 12, 566004, tzinfo=T │
│ imezone(‘UTC’)), ‘start_date’: None, ‘end_date’: None, ‘state’: <DagRunState.QUEUED: ‘queued’>, ‘run_id’: ‘manual__2024-05-07T15:02:12.566004+00:00’, ‘creating_job_id’: None, ‘external_trigger’: True, ‘run_ty │
│ pe’: <DagRunType.MANUAL: ‘manual’>, ‘conf’: <psycopg2.extensions.Binary object at 0x7f9803f4b8d0>, ‘data_interval_start’: DateTime(2024, 5, 7, 15, 2, 12, 566004, tzinfo=Timezone(‘UTC’)), ‘data_interval_end’: │
│ DateTime(2024, 5, 7, 15, 2, 12, 566004, tzinfo=Timezone(‘UTC’)), ‘last_scheduling_decision’: None, ‘dag_hash’: ‘52940d8f03dc1dc1ada15eb42dd4a4b5’, ‘updated_at’: datetime.datetime(2024, 5, 7, 15, 2, 12, 588270 │
│ , tzinfo=Timezone(‘UTC’))}]
webserver (Background on this error at: https://sqlalche.me/e/14/gkpj)
webserver 95.90.243.24 – – [07/May/2024:15:02:12 +0000] “GET /dags/
This is the DAG:
from airflow import DAG
from airflow.operators.empty import EmptyOperator
import datetime
DEFAULT_ARGS = {
"owner": "me",
"email": ["[email protected]"],
"start_date": datetime.datetime(2024, 5, 2),
"catchup": False,
"depends_on_past": False,
"retries": 1,
"retry_delay": datetime.timedelta(minutes=15),
}
with DAG(
dag_id="my_dummy_operator",
description="My Dummy operator",
schedule="@once",
default_args=DEFAULT_ARGS,
tags=[
"tutorial",
],
) as dag:
start = EmptyOperator(task_id="start")
end = EmptyOperator(task_id="end")
start >> end