beeritis commented on issue #63703:
URL: https://github.com/apache/airflow/issues/63703#issuecomment-4125882187

   Also having this issue (currently on 3.16 but I see this affects even the 
latest version)
   
   Our current workaround to to run :
   
   ```bash
   airflow db clean --clean-before-timestamp "$(date -d '-15 days' 
+%Y-%m-%dT%H:%M:%S)" --skip-archive -y --tables 
"_xcom_archive,asset_event,callback_request,celery_taskmeta,celery_tasksetmeta,dag_run,deadline,import_error,job,log,sla_miss,task_instance,task_instance_history,task_reschedule,trigger,xcom"
   ```
   
   In short - we are having to exclude the `dag` table as `dag_version` is 
coded as a `dependant` table see 
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/utils/db_cleanup.py#L128.
 
   
   The db clean command then completes successfully.  I don't know if there are 
any caveats we should be aware of  for excluding the `dag` table..


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to